Hey guys.
So i've created a static library project and written the code ( one header file and one cpp file ). I have built it and it resulted in (.a) file.
I told the compiler where to look for the header file and the library file but my example code wont compile :S
Do i have to link something ?
Or did i make some error in the process ?


//K0ns3rv

Recommended Answers

All 4 Replies

What compiler are you using and what is the specific error that you are getting?

I am using gcc ( with netbeans os is linux ).
The errors I am getting seems like standard linking errors.
For example :
/Example.cpp:28: undefined reference to `Vector3f::Vector3f(float*)'

It seems to find the header file atleast

EDIT: Also got similar error in Visual studio 2008 .

Solved it, seems i had to set the location of the library file in the project properties. Is it possible to set the library location for all new projects ?

Also, when you are compiling with a library in the command line you have to put -l{libraryname} for each library you are using, it doesn't suffice with putting the path.

Solved it, seems i had to set the location of the library file in the project properties. Is it possible to set the library location for all new projects ?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.