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.
I used to program PHP for quite a while, and I am trying to break into the world of machine programming...but darn it's hard. Anyways, I am trying to compile a program using wxWidgets in C (I know a bit of C from programming PHP in the past but for the most part I'm just learning it catch-as-catch-can). When I try to compile, with GCC, I get an error saying it cannot find the wx.h include (code: #include <wx/wx.h>). My wx.h file is located in /usr/local/include/wx-2.6/wx/wx.h. I imagine this is just a stupid mistake on my part but I have not been able to figure it out. I successfully installed wxWidgets with no errors. I run on 64 bit Fedora Core 4. Can anyone help me with this?
I tried that, and I get a long series of errors saying that a number of other include files aren't there...and yet they are.
In file included from testspace.c:23:
/usr/local/include/wx-2.6/wx/wx.h:15:21: error: wx/defs.h: No such file or directory
/usr/local/include/wx-2.6/wx/wx.h:16:23: error: wx/object.h: No such file or directory
/usr/local/include/wx-2.6/wx/wx.h:17:25: error: wx/dynarray.h: No such file or directory
/usr/local/include/wx-2.6/wx/wx.h:18:21: error: wx/list.h: No such file or directory
/usr/local/include/wx-2.6/wx/wx.h:19:21: error: wx/hash.h: No such file or directory
/usr/local/include/wx-2.6/wx/wx.h:20:23: error: wx/string.h: No such file or directory
/usr/local/include/wx-2.6/wx/wx.h:21:21: error: wx/intl.h: No such file or directory
/usr/local/include/wx-2.6/wx/wx.h:22:20: error: wx/log.h: No such file or directory
/usr/local/include/wx-2.6/wx/wx.h:23:22: error: wx/event.h: No such file or directory
/usr/local/include/wx-2.6/wx/wx.h:24:20: error: wx/app.h: No such file or directory
/usr/local/include/wx-2.6/wx/wx.h:25:22: error: wx/utils.h: No such file or directory
/usr/local/include/wx-2.6/wx/wx.h:26:23: error: wx/stream.h: No such file or directory
...Now I'm assuming that each and every include within that include would have to be changed to that directory in the same way... Could it just be that I have to switch this wx folder to a different directory for GCC to pick up on the includes automatically?
this is what i have to use outside of kdevelop to compile..
Code:
g++ `wx-config --libs --cxxflags` wxtest.cpp
my headers are in /usr/local/include/wx-2.6 and i have a symlink wx to the wx-2.6 dir in there also
i have never seen a wx program written in straight C.. since you have to derive from the wxApp class i dont know if it is possible.. though i have not done very much with wx so i only know a little..
Those commands work perfectly. Thanks, xhi. But now I get the error: ./a.out: error while loading shared libraries: libwx_gtk2_xrc-2.6.so.0: cannot open shared object file: No such file or directory
Yet, libwx_gtk2_xrc-2.6.so.0 is there, located in /usr/local/lib
I've sort of figured it out, it seems to be another distro problem. The libraries are not linked properly, and Fedora definitely does not want me to link them properly. Using ldconfig on installation seems to have done absolutely nothing, and no matter how many reinstallations I try it's just not going to happen. Not to mention, Fedora won't let me uninstall it! make uninstall doesn't work! GRR! Is there any way to manually link the libraries?
My permissions are set to 755 and I've been doing all this from root. /etc/ld.so.conf only has a link to include ld.so.conf.d/*.conf --I tried editing ld.so.conf to include that WX library, and then ran ldconfig. Nothing happened. Within folder /etc/ld.so.conf.d, which ld.so.conf links to, there's 5 small .conf files for MySQL, QT and Xorg (all containing a single library link, for example, /usr/X11R6/lib)
ok i guess there are some differences to how ld is setup between slackware and your distro ??
/etc/ld.so.conf is where ldconfig finds lib locations to add libs to the cache so that they can be linked at runtime..
look through those files and see if /usr/local/lib is anywhere to be found.. if not try to put in a line like
/usr/local/lib
at the top of /etc/ld.so.conf
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.