Hi,
I am new in the forum as on unix. I am developing a project on Windows and I am trying to port it to unix. I have installed Ubuntu 14 and I have create Makefiles to compile those projects.
I have a project that generates a shared library (.so) and another project that generates an executable. When I generate the shared library I dont have any problem, but the nightmare begins when I try to compile the executable. When I try to compile it I am having a lot of undefined references. The wierd thing is that the compiler finds all the .so dependencies but I am having undefined references for all of them. This is the makefile of this project:
I am having undefined references of my library, Boost, Glew, Glut and GL. If I remove the library directories (-L options) then I am having an error, the linker does not find libMySharedLib.so, so this makes me think that before the linker was finding my library. I have to say that I have downloaded all the dependencies using apt-get.
I dont know if this is a common error or I am doing something wrong.
When you compile a library in Windows or OSX, you do link it. If you unmet have references, you do get an error.
When you compile a library in Linux, there is no apparent linking. There will be no warnings of references that cannot be linked to something. You will get those errors when you try to link an executable.
IIRC, you can look with nm what is in your .so and what does it refer to.
I have found the problem. The problem was the order of the parameters in the compiler instruction, I had to put at the end the list of shared libraries to link.