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
Static Linking with Codelite on Linux
-
- CodeLite Curious
- Posts: 1
- Joined: Thu Aug 18, 2011 6:07 pm
- Genuine User: Yes
- IDE Question: c++
- Contact:
-
- CodeLite Plugin
- Posts: 819
- Joined: Wed Sep 03, 2008 7:26 pm
- Contact:
Re: Static Linking with Codelite on Linux
Hi Todd,
Alternatively, use dynamic linking instead and live happily ever after .
Regards,
David
Shouldn't -static be in the linker options instead or as well?I set my compiler options to -g;-static
which is what will happen if both are available. Try moving/renaming the .so and see what happens then.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.
Alternatively, use dynamic linking instead and live happily ever after .
Regards,
David