linux noob - trying to compile samples Topic is solved

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
Ansible
Knows some wx things
Knows some wx things
Posts: 49
Joined: Fri Jan 20, 2006 8:26 pm

linux noob - trying to compile samples

Post by Ansible »

I'm trying to get the samples to work in ubuntu 7.04 - I downloaded and build the source according to instructions, it seemed to work. When I go to the samples dir, say, 'sample/aui' I type

make -f makefile.unx

and it compiles and builds what I guess is an executable file named 'auidemo'. Typing auidemo from the command line yields:

bash: auidemo: command not found

and it doesn't working clicking on it from nautilus. What's the deal?
timg
Earned some good credits
Earned some good credits
Posts: 148
Joined: Mon Jan 23, 2006 6:52 pm

Post by timg »

Make sure the compiled file is executable - if you don't know how to do that, google it. (chmod 777 auidemo)

then you need to change to the directory your demo file is and
type:

./auidemo
Ansible
Knows some wx things
Knows some wx things
Posts: 49
Joined: Fri Jan 20, 2006 8:26 pm

Post by Ansible »

The 'auidemo' file has execute permission. typeing ./auidemo gets this:

./auidemo: error while loading shared libraries: libwx_gtk2_aui-2.8.so.0: cannot open shared object file: No such file or directory

Why would ./auidemo be different from plain 'auidemo'? That makes no sense to me.
timg
Earned some good credits
Earned some good credits
Posts: 148
Joined: Mon Jan 23, 2006 6:52 pm

Post by timg »

these are unix questions (or in your case linux questions) ...

when you type a "command" in linux, it looks in the path to find a matching executable. putting a "./" in front of the name of the executable tells the shell to look in the current directory for the executable.

the other error just means it can't find the shared library it needs to run. you either need to install the library or fix your environment variables so the library can be located by the executable.
tan
wxWorld Domination!
wxWorld Domination!
Posts: 1471
Joined: Tue Nov 14, 2006 7:58 am
Location: Saint-Petersburg, Russia

Post by tan »

Hi,
Ansible wrote:The 'auidemo' file has execute permission. typeing ./auidemo gets this:

./auidemo: error while loading shared libraries: libwx_gtk2_aui-2.8.so.0: cannot open shared object file: No such file or directory
i think it is the same problem:
http://forums.wxwidgets.org/viewtopic.php?t=15170
Ansible wrote: Why would ./auidemo be different from plain 'auidemo'? That makes no sense to me.
You don't have a current dir (./) in the PATH.
OS: Windows XP Pro
Compiler: MSVC++ 7.1
wxWidgets: 2.8.10
upCASE
Moderator
Moderator
Posts: 3176
Joined: Mon Aug 30, 2004 6:55 am
Location: Germany, Cologne

Post by upCASE »

Hi!
First of all you wouldn't need the makefile.unx. The normal process would be to run configure and have it generate a makefile for you.

Simply try the following:
1. Extract the sources to a dir
2. go to that dir on the console
3. create a subdir (if you like), like "mkdir build_gtk"
4. go to that dir
5. call "../configure" (pass the options you need. To see available options, call "../configure --help")
6. wait until configure is done
7. do a "make"
8. grab a coffee and wait :)
9. once it finishes do a "make install"
10. go to a sample dir (like samples/minimal)
11. do a "make"
12. start the app "./minimal"

I suppose the problem might be that you did not installed the shared libs (make install). If you already build everything properly you could try to do that instead of recompiling everthing.
OS: OpenSuSE, Ubuntu, Win XP Pro
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4

"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda
Ansible
Knows some wx things
Knows some wx things
Posts: 49
Joined: Fri Jan 20, 2006 8:26 pm

Post by Ansible »

Ah, ok. I was going to the samples dir at wxGTK-2.8.4/samples. I didn't realize there was another one under wxGTK-2.8.4/buildgtk/samples. Thx all for the help.
Ansible
Knows some wx things
Knows some wx things
Posts: 49
Joined: Fri Jan 20, 2006 8:26 pm

Post by Ansible »

Ok I thought this issue was behind me, but now I'm trying to get a project to build in eclipse. All seems to be well, it builds fine, but I get the same error:

./TestCPPProj: error while loading shared libraries: libwx_gtk2_aui-2.8.so.0: cannot open shared object file: No such file or directory

I read another post that said I should type in this at the console to solve the problem:

export LD_LIBRARY_PATH=[wxdir]/lib

but that doesn't seem to help. There must be a way for it to compile correctly; the makefiles in buildgtk/samples work. Thx for any suggestions...
Ansible
Knows some wx things
Knows some wx things
Posts: 49
Joined: Fri Jan 20, 2006 8:26 pm

Post by Ansible »

Post Reply