I got my first app working on Linux then added to it at work on windows and now I am having trouble getting the new version to work on linux. I added a library and I am getting a linker error or errors. How do you add an external library in Linux.
I added the include and lib path in setup/build Methods and have libzmq in the package organizer without the when field since it is used in both.
But linux does not need or have .lib files so how does this work in Linux?
dolik.rce Messages: 1791 Registered: August 2008 Location: Czech Republic
Ultimate Contributor
Hi Jeff,
Do I understand correctly that you're working with the ZMQ package from bazaar? (If not, maybe you should give it a try )
Either way, there are .so and/or .a files instead of .lib. So you have to have file named libzmq.so (or libzmq.a if you prefer static linking). You don't say which distribution you use, so just as an example: For ubuntu you have to install package libzmq-dev which will place the libraries into the /usr/lib directory.
The rest of the steps should be the same as on windows, with the exception that you don't have to specify the lib path as the compiler will find it automatically if it is in /usr/lib.
I have built zmq myself, there are to be many libs, this is more about the general "how do I add an external library in linux" than ZMQ itself.
I am running gentoo and the .so is in /usr/local/lib64
I added paths just like in windows, but it just doesn't work.
I tried a few combinations but no dice. Are there hardcoded paths inside the IDE?
I think I know the difference between .a,.lib.so,.dll and also made sure the shared library button is checked. But am not sure how upp handles them. For example I expect entries in Package->Organizer to be for static libs, not shared libs. I expect the entries in build system to point to the directories needed for include and libs.
Must be that it does not update LD_LIBRARY_PATH or add the -L ???