Static Linking with Codelite on Linux
Posted: Thu Aug 18, 2011 6:43 pm
Hello everyone. My name is Todd and I have just started using CodeLite. So far, I really like it... but I'm having a problem.
I am using CodeLite version 2.8.0.4537 on Lubuntu. I am trying to compile the boost.regex example located at http://www.boost.org/doc/libs/1_47_0/mo ... st-library.
I set my compiler options to -g;-static. I set the search paths to .;/usr/local/boost_1_47_0.
On the linker page, I set my library path to /usr/local/boost_1_47_0/stage/lib and I set libraries to boost_regex.
Everything compiles fine with no errors, but when I try to run the resulting program I get the following error...
./regex_test: error while loading shared libraries: libboost_regex.so.1.47.0: cannot open shared object file: No such file or directory
First, this sounds like it's trying to link to the dynamic version of the library, even though I specifically told the compiler to use the static version.
Second, I verified that BOTH the static & the dynamic versions are in the directory /usr/local/boost_1_47_0/stage/lib. So, even if it was linking against the dynamic version of the library, it should be finding the file.
I have tried to run the file both from withing the IDE and locally in a terminal window with the same result.
Can anyone tell me what I'm doing wrong?
TIA,
Todd
I am using CodeLite version 2.8.0.4537 on Lubuntu. I am trying to compile the boost.regex example located at http://www.boost.org/doc/libs/1_47_0/mo ... st-library.
I set my compiler options to -g;-static. I set the search paths to .;/usr/local/boost_1_47_0.
On the linker page, I set my library path to /usr/local/boost_1_47_0/stage/lib and I set libraries to boost_regex.
Everything compiles fine with no errors, but when I try to run the resulting program I get the following error...
./regex_test: error while loading shared libraries: libboost_regex.so.1.47.0: cannot open shared object file: No such file or directory
First, this sounds like it's trying to link to the dynamic version of the library, even though I specifically told the compiler to use the static version.
Second, I verified that BOTH the static & the dynamic versions are in the directory /usr/local/boost_1_47_0/stage/lib. So, even if it was linking against the dynamic version of the library, it should be finding the file.
I have tried to run the file both from withing the IDE and locally in a terminal window with the same result.
Can anyone tell me what I'm doing wrong?
TIA,
Todd