Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: squizzz on November 03, 2005, 10:04:19 pm

Title: [solved] CB compiles, but won't run
Post by: squizzz on November 03, 2005, 10:04:19 pm
Hi,

I've tried to compile&run CB on Linux for some time already, but have never succeeded.
Now when RC2 with Autotools support came up, I feel I'm almost there, but still few things prevents me from being successful.

I've tried installing RC2 on my SuSE10 box at least 2 times:

First time, I used Autotools - everything worked quite well, C::B compiled fine (unfortunately the only wxGTK-devel I've found was 2.6.0.1) but won't run - simply nothing happens, nothing appears, etc.

Second time, I installed SuSE10 rpm someone posted here. It installed well, integrated with YaST, etc, but ends up the same - won't run, nothing appears, etc.

So, my questions are:
- what additional (runtime or devel) packages are needed?
- does CB installation on Linux requires manual wxWidgets compilation?

Thanks,
Jan


Title: Re: CB compiles, but won't run
Post by: doscott on November 03, 2005, 10:32:34 pm
Try running from a command terminal. I have found that if you build the wx library with debugging enabled there is a ton of stuff getting dumped that you won't see unless you run from a terminal, that makes it look like it's dead.

It can also be a case of the wx library is not in the path, and you will also see that info when running from the command line.
Title: Re: CB compiles, but won't run
Post by: mandrav on November 03, 2005, 11:16:27 pm
No, it works just fine with any wxGTK version your distro uses.
After installation, you should run ldconfig.
And try launching C::B from command-line to see any messages...
Title: Re: CB compiles, but won't run
Post by: squizzz on November 03, 2005, 11:23:45 pm
Thanks, that was enough to give the next clue, which is:
Quote
codeblocks: error while loading shared libraries: libwx_gtk_xrc-2.6.so.0: cannot open shared object file: No such file or directory

It seems that I do not have libwx_gtk_xrc-2.6.so.0 anywhere on my drive, but instead there is libwx_gtk2_xrc-2.6.so.0.
And it seems that I need different runtime libraries for wxWidgets, right...? (I'm a Linux newbie) 
Title: Re: CB compiles, but won't run
Post by: sethjackson on November 04, 2005, 12:09:23 am
I think you need wxGTK + the XRC lib..... and the wxGTK lib is something like libwx_gtk2-2.6.so.0.... I don't use Linux that much (shame shame, mainly becuase I am a PC gamer and well DirectX games don't work to well on Linux) but assuming that the wxGTK lib is named similar to the wxGTK XRC lib the lib name should be something like that.......

Anyways OT, but your sig is soooooooooo funny. Is it original?
Title: Re: CB compiles, but won't run
Post by: yop on November 04, 2005, 12:28:04 am
In my suse box, I built wxWidgets myself and had no problems. If you've run ldconfig and the libraries do not reside to some insane path then try removing the precompiled libs and build wxWidgets from source using the guide from cb wiki
Title: Re: CB compiles, but won't run
Post by: mandrav on November 04, 2005, 08:33:57 am
Thanks, that was enough to give the next clue, which is:
Quote
codeblocks: error while loading shared libraries: libwx_gtk_xrc-2.6.so.0: cannot open shared object file: No such file or directory

It seems that I do not have libwx_gtk_xrc-2.6.so.0 anywhere on my drive, but instead there is libwx_gtk2_xrc-2.6.so.0.
And it seems that I need different runtime libraries for wxWidgets, right...? (I'm a Linux newbie) 

Can you tell us what is returned if you run "wx-config --libs"?
Title: Re: CB compiles, but won't run
Post by: squizzz on November 04, 2005, 11:53:47 am
Can you tell us what is returned if you run "wx-config --libs"?

wx-config --libs says:
Quote
There is no such file or directory

I just uninstalled wxGTK-devel I installed using some suspicious *.rpm some time ago (I think I failed to run CB compiled with this one because it has had wrong flags used to compile wxGTK, can't be sure though)  and successfully compiled wxGTK 2.6.1 from sources... (PII 450MHz == pain)

now wx-config --libs says:
Quote
-L/opt/wx/2.6/lib -pthread   -L/usr/X11R6/lib  -lwx_gtk2u-2.6

Now I will try to compile CB RC2 from sources.


@sethjackson: I know not whether this quote is original or not, but it is fun to say it from time to time, esp. when software you are working on (astonishingly) compiles without errors. :)
Title: Re: CB compiles, but won't run
Post by: mandrav on November 04, 2005, 02:24:29 pm
Quote
Now I will try to compile CB RC2 from sources.

Now you 'll succeed ;)
Title: Re: CB compiles, but won't run
Post by: squizzz on November 04, 2005, 06:25:11 pm
Whoops... something went wrong. :(

"./configure" step goes well - no errors/warnings. The only "suspicious" line could be:
Quote
(...)
checking for wx-config... /opt/wx/2.6/bin/wx-config
checking for wxWidgets version >= 2.4.2... yes (version 2.6.1)
checking for wxWidgets static library... no
configure: Configuring Code::Blocks...
(...)
It is not stated even as warning however, and "configure" script ends correctly.

Unfortunately "make" fails...
After ~1 hour of compilation everything ends up with:
Quote
/opt/wx/2.6/lib/libwx_gtk2u-2.6.so: undefined reference to `pango_x_get_context'
collect2: ld returned 1 exit status

Strange, since I do have libpango packages installed.

Also some 3-4 strange warnings appear in the meantime, but unfortunately they don't get logged to file (make >> make.log) but only are printed onto terminal. They also don't appear again unless I perform another clean make* (which lasts about an hour :( ), so I can't quote them now.

(*) by clean make I mean either first "make" or "make" done after "make clean", don't know the right term

Title: Re: CB compiles, but won't run
Post by: TheTuxKeeper on November 04, 2005, 07:11:07 pm
checking for wxWidgets static library... no
That's no error. There are two types of libraries static and dynamic, normally distributions take dynamic ones.


I use Suse 10 with the original wxGTK packages and it works! You need wxGTK, wxGTK-compat, wxGTK-gl and wxGTK-devel, these are all version 2.6.1. You can download them from one of the Suse mirror server. Just add one to the Yast install sources.
FTP mirror in poland (in your profile stands that you're from poland, is this right?):
Server: ftp.man.poznan.pl
directory: pub/linux/opensuse/opensuse/distribution/SL-10.0-OSS/inst-source/

Then go to install new software in Yast and install wxGTK-devel and its dependencies.

After that try again using the source RPM. How is discribed here: Compiling Code::Blocks in RPM based distributions (http://wiki.codeblocks.org/index.php/Compiling_Code::Blocks_in_RPM_based_distributions)

Daniel
Title: Re: CB compiles, but won't run
Post by: squizzz on November 04, 2005, 10:40:55 pm
I use Suse 10 with the original wxGTK packages and it works! You need wxGTK, wxGTK-compat, wxGTK-gl and wxGTK-devel, these are all version 2.6.1. You can download them from one of the Suse mirror server. Just add one to the Yast install sources.
FTP mirror in poland (in your profile stands that you're from poland, is this right?):
Server: ftp.man.poznan.pl
directory: pub/linux/opensuse/opensuse/distribution/SL-10.0-OSS/inst-source/

Then go to install new software in Yast and install wxGTK-devel and its dependencies.
Thanks a lot for the info! Didn't know that possibility (which solves a lot of trouble!). And yes, my profile info is correct.

Quote
After that try again using the source RPM. How is discribed here: Compiling Code::Blocks in RPM based distributions (http://wiki.codeblocks.org/index.php/Compiling_Code::Blocks_in_RPM_based_distributions)
What can I say... It works! :)
Your source *.rpm is simply bulletproof... Thanks!

Presumably the thing I was doing wrong myself was either wrong devel packages or (VERY highly probable) that I messed sources with batch dos2unix operation...  :oops:

Thanks for everyone's replies!
Jan
Title: Re: [solved] CB compiles, but won't run
Post by: rickg22 on November 04, 2005, 11:04:09 pm
Can you add this to the wiki? Many linux users probably got the wrong wxGTK installed, or simply don't have them installed.
Title: Re: [solved] CB compiles, but won't run
Post by: grv575 on November 05, 2005, 02:21:46 am
also if you want to log those error messages do:

make 2>&1 >> log.txt

means redirect file descriptor 2 to file descriptor 1 (0 = stdin, 1 = stdout, 2=stderr).  So then stdout will contain both normal stdout output plus stderr messages and append them to log.txt.

if you want to both see the compilation process and log it do:

make 2>&1 | tee -a log.txt