ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
i don't know how to look for this so i have to ask. i hate asking, it makes me feel like an idiot, but i cannot find the answer anywhere.
i am running an amd64 machine with an msi mainboard, 512 mb ram (cant remember if i upgraded or not since, dunno how to check aside form pull the cover.)fc9(what a mistake) and i use gcc as my compiler, whatever came on the installer disk.
i am a wxWidgets programmer and have never had any issues like this, in fact i have never heard of this. linker errors or the program runs, simple as that. now what?
i built wxWidgets myself, i have a good share of experience doing that with the configure script so i really don't think it is a problem there, unless they wrote the script wrong somehow. then i opened an old project and got it ready to build. after all the linker and path garbage i got an executable to build. then i try to run it and it stops in 0 seconds. running in the terminal says that it cannot find library whatever. dynamically linking to wxWidgets i get the wx library not found, statically i get some system library not found. i messed with path and placement of wxwidgets as much as i could think of. i even put an alias in usr/local/lib and linked it to my wxWidgets folder. (wxW 2.8.8) i tried copying the libraries next to the app and the app next to the libraries, both in /usr/local/lib and in the build folder in my home directory. nothing works. not even using /usr/lib. i updated the ide as i changed everything, remember i got it to link, it just will not run.
You're right - in general, if you can link it, you *should* be able to run it. But there *are* exceptions. If it's saying "it cannot find library whatever" ... please cut/paste exactly *which* librar(ies)! That would definitely help.
Please try this:
1. Go back to your original build script (which presumably has reasonable defaults, and presumably uses shared libraries). Verify that you can compile and link without errors.
2. Run "ldd" on your executable.
This will tell you exactly what shared libraries you need, and exactly where the system expects to find them at runtime.
Cut/paste your ld output for future reference.
3. Run your program.
Carefully cut/paste any errors you see.
4. You might even consider compiling and linking your program with "-g", and running inside of "gdb". This might give additional info.
5. Post back all specifics:
a) exactly what you tried
b) exactly what happened (i.e. the ldd output, console errors and/or gdb errors you cut/pasted above)
You probably just need to run ldconfig. That's normally required before a newly-installed library will work. Many library installers will run it for you (mine do,) but not all. If that doesn't work, then go with what paulsm4 says.
ta0kira
i found an article or something on adding to the library path. i didn't know how before and i didn't think it was an issue since everything built ok. it said redhat didn't put /usr/local/lib as part of the library search path. that is the wxwidgets default location. so that is what clued me in. (i run fedora) it said to edit ld.so.conf. so i did and ran ldconfig as root this time. now it works.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.