Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: Funto on July 25, 2005, 05:02:12 pm

Title: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: Funto on July 25, 2005, 05:02:12 pm
I'm trying to compile Code::Blocks on my Ubuntu Linux Hoary system, with wxWidgets 2.5.3 but it doesn't work; most of the problems are due to the wxString class, and using the _() macro solves the problem; however there are a lot of wxStrings in the project...
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: rickg22 on July 25, 2005, 05:25:08 pm
Yes, it's a known problem. Codeblocks doesn't support unicode yet.

The tested configuration is wxwidgets 2.6.1 (with the patch) compiled WITHOUT unicode support. The compilation instructions are in the wiki.
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: Funto on July 25, 2005, 06:36:24 pm
Ok...so if I want to compile I have to change my wxWidgets installation :(

When do you think Code::Blocks is going to support Unicode mode?
Oh yet another thing : is it planned for it to support cross-compiling with MinGW under Linux?

PS : this IDE is really, really a great work, thanks for it, I think it's going to become my main IDE under both platforms :)
PS2 : what do you think about adding SCons (http://www.scons.org) support via a plug-in?
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: mandrav on July 25, 2005, 06:45:05 pm
Ok...so if I want to compile I have to change my wxWidgets installation :(

When do you think Code::Blocks is going to support Unicode mode?

After 1.0 is released, which won't be long (RC1 will be released today).

PS2 : what do you think about adding SCons (http://www.scons.org) support via a plug-in?

You might want to talk with RShadow. He 's creating a SCons build system for C::B, but not a plugin AFAIK. Search the forums for SCons to find the topic.

Yiannis.
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: mandrav on July 25, 2005, 06:55:43 pm
Funto,

did you install wx2.5.3 with apt-get?
Because I have yet to see a binary wx package supporting gtk2 (C::B only supports gtk2)...
I suggest you download wxGTK-2.6.1 (http://www.wxwidgets.org) and build it. It's trivial to compile and a *lot* newer than 2.5.3 you 're currently using.

From personal experience though, the most stable C::B under linux is with wxGTK-2.4.2.

Yiannis.

PS: I use Ubuntu 5.04 too and I 'm *thinking* of releasing a .deb for it.
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: Funto on July 25, 2005, 07:16:38 pm
Wooow there even will be a SCons support O_o
That's amazing, it's the best IDE I know...:)
I've just imported my existing SCons-Linux/VC++-Windows project under Code::Blocks, no problem, the importer works well...congrats ;)

Quote
did you install wx2.5.3 with apt-get?
Yes, I did.

Quote
Because I have yet to see a binary wx package supporting gtk2 (C::B only supports gtk2)...
Under Ubuntu, the wx-2.4 package only supports GTK1 and is compiled in ANSI mode while the wx-2.5 package uses Unicode and GTK2.

Well, I think I will compile wx 2.6/GTK2 by myself and install it in ANSI mode...
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: rickg22 on July 25, 2005, 07:22:43 pm
PS: I use Ubuntu 5.04 too and I 'm *thinking* of releasing a .deb for it.

I vote for that one! :)
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: Funto on July 25, 2005, 07:54:47 pm
Just a tip about porting to Unicode : wxString::c_str() and wxString::fn_str() are different, c_str() is used when passing argument to a wx function/method while fn_str() is used when passing it to normal C functions.
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: Funto on July 26, 2005, 01:40:17 am
There isn't any "--disable-unicode" option in wxGTK2.6's ./configure !

If I want to compile it under Linux it seems that I have to use the old wxGTK 2.4...
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: mandrav on July 26, 2005, 08:56:14 am
There isn't any "--disable-unicode" option in wxGTK2.6's ./configure !

If I want to compile it under Linux it seems that I have to use the old wxGTK 2.4...
I don't use any unicode switch in the configure line and it compiles as ansi.
I think you must explicitely use --enable-unicode...

Yiannis.
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: Funto on July 26, 2005, 01:18:49 pm
Ah...I didn't know this :D

Nevertheless I will keep trying to compile this with wx 2.4, as it seems that you still experience problems with 2.6 no?
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: Funto on July 26, 2005, 01:44:59 pm
After compiling wxDockit, having to hack the code, and adding the -lwxdockit and -I./src/wxDockit/include options to Makefile.unix, I get this :
Quote
funto@home:~/Desktop/codeblocks-1.0-RC1/src $ make -f Makefile.unix clean
Cleaning target tinyXML...
Cleaning target sdk...
Cleaning target src...
Cleaning target plugin_Astyle...
Cleaning target plugin_CompilerGCC...
Cleaning target plugin_DebuggerGDB...
Cleaning target plugin_CodeCompletion...
Cleaning target plugin_ClassWizard...
Cleaning target plugin_DefMimeHandler...
Cleaning target plugin_PluginsWizard...
Cleaning target plugin_ToDo...
Cleaning target plugin_XPManifest...
Cleaning target console_runner...
funto@home:~/Desktop/codeblocks-1.0-RC1/src $ make -f Makefile.unix
Compiling sdk/tinyxml/tinystr.cpp...
Compiling sdk/tinyxml/tinyxml.cpp...
Compiling sdk/tinyxml/tinyxmlerror.cpp...
Compiling sdk/tinyxml/tinyxmlparser.cpp...
Linking static library sdk/tinyxml/libtxml.a...
ar: création de sdk/tinyxml/libtxml.a
ranlib sdk/tinyxml/libtxml.a
Compiling sdk/Managers/Managers.cpp...
Compiling sdk/Managers/StdAfx.cpp...
Compiling sdk/autodetectcompilers.cpp...
Compiling sdk/cbeditor.cpp...
Compiling sdk/cbeditorprintout.cpp...
Compiling sdk/cbplugin.cpp...
Compiling sdk/cbproject.cpp...
Compiling sdk/cbworkspace.cpp...
Compiling sdk/compileoptionsbase.cpp...
Compiling sdk/compiler.cpp...
Compiling sdk/compilerfactory.cpp...
Compiling sdk/compileroptions.cpp...
Compiling sdk/compiletargetbase.cpp...
Compiling sdk/configmanager.cpp...
Compiling sdk/configuretoolsdlg.cpp...
Compiling sdk/confirmreplacedlg.cpp...
Compiling sdk/devcpploader.cpp...
Compiling sdk/editarrayfiledlg.cpp...
Compiling sdk/editarrayorderdlg.cpp...
Compiling sdk/editarraystringdlg.cpp...
Compiling sdk/editorbase.cpp...
Compiling sdk/editorcolorset.cpp...
Compiling sdk/editorconfigurationdlg.cpp...
sdk/editorconfigurationdlg.cpp:522:10: attention : #warning "wxComboBox::SetString() doesn't work under non-win32 platforms"
Compiling sdk/editorlexerloader.cpp...
Compiling sdk/editormanager.cpp...
sdk/editormanager.cpp: Dans member function « void
   EditorManager::ActivateNext() »:
sdk/editormanager.cpp:448: attention : comparison between signed and unsigned
   integer expressions
sdk/editormanager.cpp: Dans member function « int
   EditorManager::FindPageFromEditor(EditorBase*) »:
sdk/editormanager.cpp:648: attention : comparison between signed and unsigned
   integer expressions
Compiling sdk/editpathdlg.cpp...
Compiling sdk/edittooldlg.cpp...
Compiling sdk/filegroupsandmasks.cpp...
Compiling sdk/finddlg.cpp...
Compiling sdk/globals.cpp...
Compiling sdk/importers_globals.cpp...
Compiling sdk/incrementalselectlistdlg.cpp...
Compiling sdk/macrosmanager.cpp...
Compiling sdk/managedthread.cpp...
Compiling sdk/manager.cpp...
Compiling sdk/menuitemsmanager.cpp...
Compiling sdk/messagelog.cpp...
Compiling sdk/messagemanager.cpp...
Compiling sdk/msvc7loader.cpp...
Compiling sdk/msvc7workspaceloader.cpp...
Compiling sdk/msvcloader.cpp...
Compiling sdk/msvcworkspaceloader.cpp...
Compiling sdk/multiselectdlg.cpp...
Compiling sdk/newfromtemplatedlg.cpp...
Compiling sdk/personalitymanager.cpp...
Compiling sdk/pipedprocess.cpp...
Compiling sdk/pluginmanager.cpp...
Compiling sdk/pluginsconfigurationdlg.cpp...
Compiling sdk/printing_types.cpp...
Compiling sdk/projectbuildtarget.cpp...
Compiling sdk/projectfileoptionsdlg.cpp...
Compiling sdk/projectlayoutloader.cpp...
Compiling sdk/projectloader.cpp...
Compiling sdk/projectmanager.cpp...
Compiling sdk/projectoptionsdlg.cpp...
Compiling sdk/projectsfilemasksdlg.cpp...
Compiling sdk/projecttemplateloader.cpp...
Compiling sdk/replacedlg.cpp...
Compiling sdk/sdk_events.cpp...
Compiling sdk/searchresultslog.cpp...
Compiling sdk/selecttargetdlg.cpp...
Compiling sdk/simplelistlog.cpp...
Compiling sdk/simpletextlog.cpp...
Compiling sdk/templatemanager.cpp...
Compiling sdk/toolsmanager.cpp...
Compiling sdk/workspaceloader.cpp...
Compiling sdk/xtra_classes.cpp...
Compiling sdk/xtra_res.cpp...
Linking shared library devel/libcodeblocks.so...
Compiling src/app.cpp...
src/resources/icons/app.xpm:2: attention : `char*app[44]' defined but not used
Compiling src/dlgabout.cpp...
Compiling src/dlgaboutplugin.cpp...
Compiling src/environmentsettingsdlg.cpp...
Compiling src/impexpconfig.cpp...
Compiling src/main.cpp...
Compiling src/prefix.c...
Compiling src/printdlg.cpp...
Compiling src/startherepage.cpp...
Linking executable devel/codeblocks.exe...
devel/libcodeblocks.so: undefined reference to `CustomVars::~CustomVars [in-charge]()'
devel/libcodeblocks.so: undefined reference to `CustomVars::Load(wxString const&)'
devel/libcodeblocks.so: undefined reference to `VarsArray::operator=(VarsArray const&)'
devel/libcodeblocks.so: undefined reference to `VarsArray::VarsArray[in-charge](VarsArray const&)'
devel/libcodeblocks.so: undefined reference to `CustomVars::Add(wxString const&, wxString const&)'
devel/libcodeblocks.so: undefined reference to `CustomVars::CustomVars[in-charge]()'
devel/libcodeblocks.so: undefined reference to `ExternalDepsDlg::~ExternalDepsDlg [in-charge]()'
devel/libcodeblocks.so: undefined reference to `ExternalDepsDlg::ExternalDepsDlg[in-charge](wxWindow*, cbProject*, ProjectBuildTarget*)'
devel/libcodeblocks.so: undefined reference to `CustomVars::Save(wxString const&)'
collect2: ld a retourné 1 code d'état d'exécution
make: *** [devel/codeblocks.exe] Erreur 1

What should I do to continue the compilation process?? Here I'm stuck...
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: rickg22 on July 26, 2005, 03:50:52 pm
Are you sure you obtained the VERSION_1_0 branch from CVS? This is the one used to compile version 1.0.

CVS HEAD needs wxwidgets 2.6.
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: mandrav on July 26, 2005, 06:59:16 pm
Are you sure you obtained the VERSION_1_0 branch from CVS? This is the one used to compile version 1.0.

CVS HEAD needs wxwidgets 2.6.

Rick is right. Up-to-date is VERSION_1_0 and Makefile.unix (for wx2.4). Or you could just download the source package and avoid using CVS.

Yiannis.
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: Funto on July 26, 2005, 07:13:25 pm
I've just downloaded the source package and get these errors when doing make -f Makefile.unix :

Quote
Linking executable devel/codeblocks.exe...
devel/libcodeblocks.so: undefined reference to `CustomVars::~CustomVars [in-charge]()'
devel/libcodeblocks.so: undefined reference to `CustomVars::Load(wxString const&)'
devel/libcodeblocks.so: undefined reference to `VarsArray::operator=(VarsArray const&)'
devel/libcodeblocks.so: undefined reference to `VarsArray::VarsArray[in-charge](VarsArray const&)'
devel/libcodeblocks.so: undefined reference to `CustomVars::Add(wxString const&, wxString const&)'
devel/libcodeblocks.so: undefined reference to `CustomVars::CustomVars[in-charge]()'
devel/libcodeblocks.so: undefined reference to `ExternalDepsDlg::~ExternalDepsDlg [in-charge]()'
devel/libcodeblocks.so: undefined reference to `ExternalDepsDlg::ExternalDepsDlg[in-charge](wxWindow*, cbProject*, ProjectBuildTarget*)'
devel/libcodeblocks.so: undefined reference to `CustomVars::Save(wxString const&)'
collect2: ld a retourné 1 code d'état d'exécution
make: *** [devel/codeblocks.exe] Erreur 1

Where did you put wxDockit??
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: rickg22 on July 26, 2005, 07:25:36 pm
wxdockit isn't present in version 1.0. It seems you need to delete your codeblocks sources (and devel and output) directory and restart from scratch.
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: mandrav on July 26, 2005, 07:40:52 pm
I've just downloaded the source package and get these errors when doing make -f Makefile.unix :

Quote
Linking executable devel/codeblocks.exe...
devel/libcodeblocks.so: undefined reference to `CustomVars::~CustomVars [in-charge]()'
devel/libcodeblocks.so: undefined reference to `CustomVars::Load(wxString const&)'
devel/libcodeblocks.so: undefined reference to `VarsArray::operator=(VarsArray const&)'
devel/libcodeblocks.so: undefined reference to `VarsArray::VarsArray[in-charge](VarsArray const&)'
devel/libcodeblocks.so: undefined reference to `CustomVars::Add(wxString const&, wxString const&)'
devel/libcodeblocks.so: undefined reference to `CustomVars::CustomVars[in-charge]()'
devel/libcodeblocks.so: undefined reference to `ExternalDepsDlg::~ExternalDepsDlg [in-charge]()'
devel/libcodeblocks.so: undefined reference to `ExternalDepsDlg::ExternalDepsDlg[in-charge](wxWindow*, cbProject*, ProjectBuildTarget*)'
devel/libcodeblocks.so: undefined reference to `CustomVars::Save(wxString const&)'
collect2: ld a retourné 1 code d'état d'exécution
make: *** [devel/codeblocks.exe] Erreur 1

Please use "make -f Makefile.unix clean" and then "make -f Makefile.unix"

Yiannis.
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: Funto on July 26, 2005, 08:44:06 pm
Quote
wxdockit isn't present in version 1.0. It seems you need to delete your codeblocks sources (and devel and output) directory and restart from scratch.
But I had already started from scratch...

1) I downloaded the last source archive from the site
2) I did a make -f Makefile.unix

I've just tried to do the make -f Makefile.unix clean as you asked me to but, of course, it gives the same results...

And I don't understand how it would be able to compile, since, there is no wxDockit provided and since the Makefile.unix never talks about wxDockit...
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: mandrav on July 26, 2005, 08:50:33 pm
Quote
wxdockit isn't present in version 1.0. It seems you need to delete your codeblocks sources (and devel and output) directory and restart from scratch.

And I don't understand how it would be able to compile, since, there is no wxDockit provided and since the Makefile.unix never talks about wxDockit...
That's the point: the stable branch, VERSION_1_0, does not use wxDockit. This is only in HEAD...
That's why we told you to delete the directory and start from scratch. It seems you have mixed various versions (CVS-HEAD, CVS-VERSION_1_0, source package).

Yiannis.
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: rickg22 on July 26, 2005, 08:58:21 pm
Anyway, the source code tarball (which was broken yesterday) is already on the website. If you don't want to mess with CVS stuff, just untar the file on a new directory and do the make.
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: Funto on July 27, 2005, 12:28:29 am
Quote
That's the point: the stable branch, VERSION_1_0, does not use wxDockit. This is only in HEAD...
Ok, this explains why I couldn't find any wxDockit ^^

Quote
It seems you have mixed various versions (CVS-HEAD, CVS-VERSION_1_0, source package).
But I didn't...I promise you that I've downloaded the source package and run make -f Makefile.unix, and I get these errors. Am I the only one who gets these errors???
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: rickg22 on July 27, 2005, 01:35:57 am
You could do a grep for the offending lines in the sourcecode, and publish the snips here to shock everyone. Then we can compare with our own versions.
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: Funto on July 27, 2005, 03:13:29 am
I don't really understand what you mean, and I don't know how to use grep... :oops:

However, I FINALLY got something working : in fact, the file Makefile.unix is NOT up to date; I added the references to sdk/customvars.cpp/.h and sdk/externaldepsdlg.cpp/.h to this *unredeable* Makefile and finally got libcodeblocks.so compiled with some definitions which were missing, and which prevented codeblocks.exe to compile.

So I got codeblocks.exe, but as for the following, libastyle.so doesn't compile because of a missing rule concerning customvars.cpp (in fact there are 2 different customvars.cpp files !)...

Well, I copied the libcodeblocks.so file to /usr/lib and created a CodeBlocks folder with a "share" directory, containing what was in my Win32 installation and finally Code::Blocks launches ! But of course the project templates are those for Win32...etc.
It's not a valuable installation ^^

I think the problem is that you forgot to regenerate the Makefile.unix file from the Code::Blocks project...

So please update this so that Linux users can test it :)

Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: Funto on July 27, 2005, 03:20:35 am
I know somebody else who is trying to compile with Mandriva/wxGTK 2.4 ANSi and he gets the same errors ^^

This confirms that the Makefile.unix is not up to date in my opinion ^^
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: rickg22 on July 27, 2005, 04:26:39 am
Oh no! :(

Anyway. When you manage to compile, do this:

* Open the codeblocks project under linux.
* Generate the makefile with Codeblocks (I just hope THAT's how Yiannis managed to generate the makefile).
* Upload it here

Ta-da! :)
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: Funto on July 27, 2005, 08:21:03 am
There are 2 issues with what you are talking about :
-1st, my Code::Blocks install is really primitive, in so far as I don't have any plugins : I think that's why I can't generate the Makefile, and that's why I can't compile from C::B itself.
-2ndly, it seems that the UNIX C::B project isn't up do date either : when I look into Sources->sdk, I can't see customvars.cpp for example, which is one of the files I had to add manually. This is right for the unix-wx2.6 project too :( And when I try to open the Windows project C::B crashes...
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: rickg22 on July 27, 2005, 08:35:35 am
hmmmmmmmm
Then it seems we'll have to wait for Yiannis to release an updated makefile.unix

or we could ask any of us users to generate one from cvs VERSION_1_0. Anyone?
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: knue on July 27, 2005, 09:46:41 pm
the Makefile.unix does not contain information for
sdk/customvars.h
sdk/customvars.cpp

sdk/externaldepsdlg.h
sdk/externaldepsdlg.cpp

I am currently trieng to fix this
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: knue on July 27, 2005, 10:27:18 pm
yeah it worx:

I attached the makefile.

Remember to do this:

# dos2unix -n update update.unix
# chmod +x update.unix
# ./update.unix

start with:
# cd output
# ./run.sh

enjoy

PS:
Cuz the file is greater than 128 kb I had to compress it but i am not allowed to post *.tar.gz-files. So I added the .txt
Just rename and extract

[attachment deleted by admin]
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: mandrav on July 27, 2005, 10:33:01 pm
Try this makefile (rename it to Makefile.tgz). This should be in the source package. If it's not, my bad, sorry.

[EDIT]
Hey knue, thanks for doing the same thing :)
[/EDIT]

Yiannis.

[attachment deleted by admin]
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: knue on July 27, 2005, 10:58:29 pm
The Makefile.unix.wx2.6 does not work neither
Have you anupdated version?
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: rickg22 on July 27, 2005, 11:15:51 pm
Yiannis: Please updload the Makefile.unix.2.6 to the /downloads page on the website. When you're done, tell me so I can update the website.
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: mandrav on July 27, 2005, 11:19:16 pm
The Makefile.unix.wx2.6 does not work neither
Have you anupdated version?

No, not now. I will try to attach one tomorrow.
If you 're in a hurry, just edit Makefile.unix. Change the wx lib's name, the LIB_WXSTC name and remove all references "-l$(LIB_WXXRC)".

Yiannis: Please updload the Makefile.unix.2.6 to the /downloads page on the website. When you're done, tell me so I can update the website.
No need Rick. We 'll release soon an update with all these minor issues solved.

Yiannis.
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: Funto on July 28, 2005, 12:02:55 am
Yeaaah, everything compiles with your Makefile mandrav :) (sorry knue I haven't tried yours...).

I could use the "update" script without having to convert it with dos2unix...
Simply made chmod +x update && ./update

The Code::Blocks IDE seems to work, however when I start it it says in a wxMessageBox "Deleted stale lock file '/home/funto/Code::Blocks-funto'.", and when I close it it says in the console :
Quote
funto@home:~/installations/codeblocks-1.0-RC1/src/devel $ ./codeblocks.exe

(codeblocks.exe:15411): Gtk-CRITICAL **: gtk_widget_ref: assertion `GTK_IS_WIDGET (widget)' failed

(codeblocks.exe:15411): Gtk-CRITICAL **: gtk_widget_unrealize: assertion `GTK_IS_WIDGET (widget)' failed

(codeblocks.exe:15411): Gtk-CRITICAL **: gtk_widget_unparent: assertion `GTK_IS_WIDGET (widget)' failed
Erreur de segmentation

:(
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: Funto on July 28, 2005, 12:13:55 am
NB : these errors appear when we close the window with Alt-F4, not when we use File->Quit.
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: Funto on July 28, 2005, 12:39:18 am
Pfiou, the IDE isn't stable yet...
The Qt and wxWidgets templates didn't work, but I managed to creating a simple console project. However, if I let the code completion plug-in activated, when I write "std::" the IDE crashes :'(

I decided to remove this plug-in, but now the caret is not visible anymore (in fact it is visible only at some moments...)
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: Cray-Z on July 28, 2005, 12:53:44 am
I know somebody else who is trying to compile with Mandriva/wxGTK 2.4 ANSi and he gets the same errors ^^

This confirms that the Makefile.unix is not up to date in my opinion ^^

Hi there!

First off, congratz for such a good C++ IDE ^^ Code::Blocks could become my main IDE if i succeed in compiling it under Linux. As Funto already mentioned, i use wxGtk 2.4 and Mandriva 2005.

Till now, i've never been able to log in CB's forum (i never received any activation email, even by explicitly asking it again). But for some reason, i am able to log in now ^^

However, both revised makefiles proposed here (knue's and mandrav's one) still dont work for me :(

The errors i get are:

Code
Linking executable devel/codeblocks.exe...
/usr/local/lib/libwx_gtk2-2.4.so: undefined reference to `_gtk_accel_group_detach'
/usr/local/lib/libwx_gtk2-2.4.so: undefined reference to `_gtk_accel_group_attach'
/usr/local/lib/libwx_gtk2-2.4.so: undefined reference to `_gtk_rc_context_get_default_font_name'
collect2: ld returned 1 exit status
make: *** [devel/codeblocks.exe] Erreur 1

Maybe it's a minor problem, but i'm afraid i can't find what the problem is by myself :(

Hopefully, someone already encountered it. Thx in advance :)
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: knue on July 28, 2005, 04:53:53 am
There is a problem with GTK because some names changed.
Some distros build wx with an old GTK version.
see
http://wiki.codeblocks.org/index.php/Compiling_Code::Blocks_in_Linux_(applies_to_all_distros)

for more details

You will also find some infos for patching this

Edit:
However: Codeblocks for linux is -- in my opinion -- pretty unstable and not worth using (too many probls, too many crashes, too many bugs). I had same probls as Funtu (and many more). I am looking forward towards a stable version.
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: Cray-Z on July 28, 2005, 10:41:14 am
Quote
Patching wxGTK

Most newer distros provide gtk2.4.x. Although wxGTK will compile using this gtk version, applications using this wxGTK will not compile succesfully.

I had read the tutorial before trying to install CB so I checked my GTK version (which is 2.6.4). As a consequence, I didn't apply this patch. However, it seems that _gtk_accel_group_detach and _gtk_rc_context_get_default_font_name are concerned by the patch. Is using Mandriva the reason that gtk 2.6.4 has to be patched ? (while tut only mentioned 2.4.x)

Thx for the help Knue ^^ i guess i have to wait to have CB works on Linux :(
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: Funto on July 28, 2005, 12:24:24 pm
knue >> not "Funtu", "Funto" ^^

I use the default GTK+ 2.6.4 in Ubuntu and compile well...
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: Ceniza on July 29, 2005, 10:20:55 am
Ok, now it's my turn trying to compile Code::Blocks under Linux.

Right now I'm trying to compile wxWidgets 2.6.1 with GTK+ 2.6.8. configure --help won't list --disable-unicode but it works. --enable-unicode=no is supposed to work too.

The difference is that I'm compiling it under Knoppix 3.2 (using unstable).

I hope I get this working so I can test the help plugin under Linux and work on it.
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: Ceniza on July 29, 2005, 03:53:10 pm
It compiled without any problems but in runtime wxDockIt is causing them. The IDE cannot even start because of Segmentation Faults.

If it was, at least, a bug in the IDE...

I would like to know if somebody got to run Code::Blocks CVS HEAD under Linux.

I checked wxDockIt CVS but they haven't really worked recently on it and the source file triggering the bug hasn't been touched for 2 months.

Just in case, the backtrace looks like this:

Code
0x4034d85b in wxWindowBase::AdjustForParentClientOrigin ()
   from /usr/local/lib/libwx_gtk2-2.6.so.0
(gdb) bt
#0  0x4034d85b in wxWindowBase::AdjustForParentClientOrigin ()
   from /usr/local/lib/libwx_gtk2-2.6.so.0
#1  0x40267114 in wxWindow::DoSetSize ()
   from /usr/local/lib/libwx_gtk2-2.6.so.0
#2  0x08075967 in wxWindowBase::SetSize (this=0x81e04e0, x=-20, y=-8,
    width=17, height=16, sizeFlags=3) at window.h:220
#3  0x0807e441 in wxPaneBase::UpdateLayout (this=0x81df540, cxWidth=0,
    cyHeight=0) at src/wxDockit/src/generic/pane.cpp:222
#4  0x0807ddd5 in wxPaneBase::UpdateSize (this=0x81df540)
    at src/wxDockit/src/generic/pane.cpp:131
#5  0x0807dcab in wxPaneBase::ShowHeader (this=0x81df540, state=false)
    at src/wxDockit/src/generic/pane.cpp:92
#6  0x0806503b in MainFrame::CreateIDE (this=0x81fb398) at src/main.cpp:426
#7  0x08064078 in MainFrame (this=0x81fb398, parent=0x0) at src/main.cpp:362
#8  0x0805ca6d in CodeBlocksApp::InitFrame (this=0x80b6698) at src/app.cpp:175
#9  0x0805cee5 in CodeBlocksApp::OnInit (this=0x80b6698) at src/app.cpp:248
#10 0x0805f41a in wxAppConsole::CallOnInit (this=0x80b6698) at app.h:87
#11 0x401bc957 in wxEntry () from /usr/local/lib/libwx_gtk2-2.6.so.0
#12 0x0805c167 in main (argc=1, argv=0xbffffc94) at src/app.cpp:297
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: Funto on July 29, 2005, 03:57:34 pm
On my Ubuntu system C::B works fine (well, always, there are crashes some times, when we open a Win32 C::B project for example, or Gtk-WARNINGs when we close the IDE), compiled from the source on the site and with wx 2.4.

I thinked since RC1 wxDockIt hasn't been used anymore...
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: Ceniza on July 29, 2005, 04:07:31 pm
Quote from: Funto
I thinked since RC1 wxDockIt hasn't been used anymore...

wxDockIt is being used in HEAD and isn't in VERSION_1_0, that's why it doesn't come in the source on this site.

This is what I used to build Code::Blocks:

* GTK+ 2.6.8 (debian package @ apt-get)
* GCC 3.4.5 20050706 prerelease (debian package @ apt-get)
* wxWidgets 2.6.1 (compiled with ../configure --with-gtk=2 --enable-monolithic --disable-unicode --enable-shared)
* Code::Blocks latest CVS from HEAD

It seems like I'll have to try with VERSION_1_0.
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: Funto on July 29, 2005, 06:12:46 pm
I don't understand...shouldn't HEAD be more recent than VERSION_1_0? Why is wxDockit still present in HEAD?
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: rickg22 on July 29, 2005, 06:37:20 pm
Version 1.0 is a branch based on wx2.4.2 and is the current stable.

HEAD is the unstable, development branch for use with wx2.6.
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: Ceniza on July 29, 2005, 06:39:37 pm
HEAD is more recent than VERSION_1_0 and it's the one using wxDockIt and it's present in HEAD because it's Code::Blocks's future! :wink:

wxDockIt was introduced to Code::Blocks when it was branched in CVS (well, I think that was the main reason to branch it), so HEAD is something like "testing" or "unstable" and VERSION_1_0 is "stable" :)

[edit]
Ok, about my compilation process: I finished compiling Code::Blocks CVS VERSION_1_0, but couldn't try it 'cause I had to turn off my 'puter and remove 512 of 768MB of RAM and 256MB aren't enough for XP (it's heavily using swap) even less to run both XP and an emulated Linux. I hope in a few hours arrive the 3x256MB so I'll have plenty of RAM (1GB!!! :wink:) to run it, test it and put my hands in the help plugin there.
[/edit]
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: Funto on July 29, 2005, 07:31:45 pm
Ok, I thought wxDockIt was the past and that the Code::Blocks project decided to give up it...

Quote
an emulated Linux
-> wouldn't it be better to install a real distrib? ;)

It seems that there are really more Windows C::B developers that Linux ones...
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: rickg22 on July 29, 2005, 07:34:38 pm
Ceniza, why don't you install CoLinux?
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: Ceniza on July 29, 2005, 08:06:05 pm
Quote from: Funto
wouldn't it be better to install a real distrib?

I have a real one installed, but in a 233MMX, a really bad choice to develop and work with heavy libraries such as wxWidgets.

Installing it in my P4 would be a waste of space and a waste of hardware too. I have nothing against Linux, it's nice, but it still needs more support, mainly for drivers, so I stick with Windows.

Actually, it runs pretty nice emulated, but just today ran out of RAM.

Quote from: rickg22
Ceniza, why don't you install CoLinux?

I've just checked the site, some links, the Wiki and looks nice, but I'm still low of RAM. I'll download it later and give it a try when I have the time.

BTW, thanks for it :)
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: Funto on July 29, 2005, 08:26:01 pm
You could install a small distrib which doesn't take a lot of place...

You know, Ubuntu fits in one CD, and if there are applications you don't want you can simply remove them with Synaptic...
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: Ceniza on July 30, 2005, 12:31:41 am
Ok, got the RAM, now I have plenty of memory, but even VERSION_1_0 is crashing.

It seems like Linux is refusing the help plugin...
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: subflood on July 30, 2005, 05:37:31 am
Hello I too am using Ubuntu and have compiled codeblocks successfully however, after compiling I try and run update: ./update but I get this: bad interpreter: No such file or directory

If I go to the devel directory and try to execute codeblocks I get: ./codeblocks.exe: error while loading shared libraries: libwx_gtk2-2.4.so: cannot open shared object file: No such file or directory
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: mandrav on July 30, 2005, 10:13:46 am
Hello I too am using Ubuntu and have compiled codeblocks successfully however, after compiling I try and run update: ./update but I get this: bad interpreter: No such file or directory

If I go to the devel directory and try to execute codeblocks I get: ./codeblocks.exe: error while loading shared libraries: libwx_gtk2-2.4.so: cannot open shared object file: No such file or directory

Try dos2unix on the update script (check the wiki for more info).
Update must be run before you can run C::B.

Yiannis.
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: Funto on July 30, 2005, 11:55:10 am
Quote
libwx_gtk2-2.4.so: cannot open shared object file: No such file or directory
When you installed wxWidgets, did it install itself in the /usr/local/lib directory? (it's the default setting, to override this you should add the --prefix=/your/directory).
If this is the case, you should edit /etc/ld.so.conf and add /usr/local/lib to this file, so that the .so will be found :)
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: mandrav on July 30, 2005, 12:01:56 pm
Quote
libwx_gtk2-2.4.so: cannot open shared object file: No such file or directory
When you installed wxWidgets, did it install itself in the /usr/local/lib directory? (it's the default setting, to override this you should add the --prefix=/your/directory).
If this is the case, you should edit /etc/ld.so.conf and add /usr/local/lib to this file, so that the .so will be found :)

After you edit /etc/ld.so.conf don't forget to run "sudo ldconfig" to update the linker's cache.

Yiannis.
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: subflood on July 30, 2005, 08:15:21 pm
Ok I did that but then when I tried to run it again I got something about it couldn't find libcodeblocks.so so, I copied libcodeblocks.so  to /usr/lib I think and It works now.
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: Ceniza on August 01, 2005, 04:38:41 am
Ok, I just compiled Code::Blocks with wxWidgets 2.4.2 under Linux and it seems to, finally, be working. Just a few Gtk-CRITICAL when I quit.

It's a shame I'm low of time right now 'cause I would like to try compiling HEAD (as I said, it compiled with wxWidgets 2.6.1 but crashes, same for VERSION_1_0) and tomorrow begins a new semester @ college so I should get in bed soon.

Anyway, I hope to get some time soon to make some tests for the help plugin.

BTW, now the emulated Linux isn't a problem: 1GB DDR3200 dual channel + P4 3.0GHz 800MHz FSB HT :)
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: Funto on August 01, 2005, 04:19:35 pm
I've got the Gtk-CRITICALs too, and they're even followed by a segfault :(
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: fiammy on August 03, 2005, 04:09:37 pm
What do you use as building command for configure? I get the errors that are associated with Unicode when I try to build it with wxWidgets 2.6.1

Thanks
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: Funto on August 03, 2005, 04:14:39 pm
Try adding "--disable-unicode" to your ./configure, but mandrav said C::B crashed when compiled with wx2.6 under Linux; I think you had better stay with wx2.4...
Title: Re: Code::Blocks doesn't compile on Ubuntu Linux with wx 2.5
Post by: fiammy on August 03, 2005, 04:57:32 pm
Thanks, but I'll try to get it to work also with wx2.6, as I want to use the current release to build an IDE for an adventure engine. So the newest technology seems to be the best bet IMHO.