Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: rig0r on November 18, 2005, 04:39:27 pm

Title: CVS seems broken ?
Post by: rig0r on November 18, 2005, 04:39:27 pm
Current CVS doesnt seem to compile:

# ./configure --prefix=/usr/local/codeblocks-cvs --enable-contrib
# make

Code
 g++ -DHAVE_CONFIG_H -I. -I. -I../../../src/sdk -I/usr/lib/wx/include/gtk2-ansi-release-2.6 -I/usr/include/wx-2.6 -DGTK_NO_CHECK_CASTS -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D_LARGEFILE_SOURCE=1 -I../../../src/sdk/wxscintilla/include -I../../../src/sdk/tinyxml -I../../../src/sdk -I../../../src/sdk/as/include -I/usr/lib/wx/include/gtk2-ansi-release-2.6 -I/usr/include/wx-2.6 -DGTK_NO_CHECK_CASTS -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D_LARGEFILE_SOURCE=1 -g -O2 -O2 -ffast-math -I/usr/lib/wx/include/gtk2-ansi-release-2.6 -I/usr/include/wx-2.6 -DGTK_NO_CHECK_CASTS -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D_LARGEFILE_SOURCE=1 -MT scriptbindings.lo -MD -MP -MF .deps/scriptbindings.Tpo -c ./bindings/scriptbindings.cpp  -fPIC -DPIC -o .libs/scriptbindings.o
bindings/scriptbindings.cpp:15: error: `cbProject' was not declared in this
   scope
bindings/scriptbindings.cpp:15: error: `p' was not declared in this scope

Followed by a bunch of other compile errors.
Running Gentoo/Linux.

Thanks :)
Title: Re: CVS seems broken ?
Post by: Der Meister on November 18, 2005, 07:55:29 pm
In this thread (http://forums.codeblocks.org/index.php/topic,1396.0.html) mandrav says that currently only CodeBlocks-NewBuild.cbp is up-to-date, thus even the Makefile seems to be outdated. Anyway I got the same errors when trying to build the current CVS-version on Gentoo but using the project file at least these errors don't appear. But I'm still struggling with some problems about <wx/setup.h>  :?
Title: Re: CVS seems broken ?
Post by: rig0r on November 19, 2005, 11:45:51 am
Ah. I see I need a post 1.0rc2 Linux CVS binary to be able to build the current CVS version using the new project file. Are there linux CVS binaries available ?
Title: Re: CVS seems broken ?
Post by: Der Meister on November 19, 2005, 07:32:34 pm
In fact 1.0RC2 is enough to build the new cvs-version. I have just finished compiling the current cvs-version using a modified CodeBlock-NewBuild.cbp. But I still can't test if it was successfull because it seems that I need an install script like the one the old Makefile provided. But the old one simply doesn't wok because it's quite outdated. Thus if I try to run the just compiled executable I just get an error message saying that libcodeblocks.so cannot be found.
Title: Re: CVS seems broken ?
Post by: mandrav on November 19, 2005, 08:08:01 pm
I don't really understand what the problem is here...
You 're talking about linux, so this should be enough:

Code
./configure --enable-contrib --prefix=/usr
make
sudo make install

Why the confusion?
Title: Re: CVS seems broken ?
Post by: Der Meister on November 19, 2005, 08:18:47 pm
Well, this was enough before the great changes in the last days. But doing so with the current cvs-version gives lots of errors... for example:
Code
 g++ -DHAVE_CONFIG_H -I. -I. -I../../../src/sdk -I/usr/lib/wx/include/gtk2-2.4 -DGTK_NO_CHECK_CASTS -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -I../../../src/sdk/wxscintilla/include -I../../../src/sdk/tinyxml -I../../../src/sdk -I../../../src/sdk/as/include -I/usr/lib/wx/include/gtk2-2.4 -DGTK_NO_CHECK_CASTS -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -g -O2 -O2 -ffast-math -MT sc_io.lo -MD -MP -MF .deps/sc_io.Tpo -c ./bindings/sc_io.cpp  -fPIC -DPIC -o .libs/sc_io.o
bindings/sc_io.cpp: In member function `bool IOLib::RemoveDir(const wxString&)':
bindings/sc_io.cpp:23: error: `rmdir' undeclared (first use this function)
bindings/sc_io.cpp:23: error: (Each undeclared identifier is reported only once for each function it appears in.)
Could it be possible that (in this case) only -DCB_PRECOMP and/or -DWX_PRECOMP are missing? I did not test it but these two macros are defined when compiling with the project file CodeBlocks-NewBuild.cpb.
Title: Re: CVS seems broken ?
Post by: mandrav on November 19, 2005, 08:24:04 pm
What gcc are you using?
(g++ --version)
Title: Re: CVS seems broken ?
Post by: Der Meister on November 19, 2005, 08:28:22 pm
Code
gcc (GCC) 3.3.6 (Gentoo 3.3.6, ssp-3.3.6-1.0, pie-8.7.8)
But I don't think that it is just a compiler problem because I can compile even the current cvs-version (just using a modified CodeBlocks-NewBuild.cbp, but these files are also compiled).
Title: Re: CVS seems broken ?
Post by: mandrav on November 19, 2005, 08:31:25 pm
No, the reason I asked is because your compiler doesn't use precompiled headers. Mine does that's why I didn't notice...
So the problem is about a missing include in sdk/as/bindings/sc_io.cpp.
Add #include <wx/filefn.h> in this file and try again...
Title: Re: CVS seems broken ?
Post by: Der Meister on November 19, 2005, 08:35:48 pm
I'm sorry but this did not change anything.
Title: Re: CVS seems broken ?
Post by: rickg22 on November 19, 2005, 11:33:47 pm
Have you tried installing GCC 3.4.2 or later? Just a thought (I'm a windoze user)
Title: Re: CVS seems broken ?
Post by: Der Meister on November 19, 2005, 11:46:40 pm
Well, I don't want to switch to gcc 3.4 because (as far as I know) there were some major changes from 3.3 to 3.4. And I don't want to break my system if something goes wrong. Maybe I will switch someday when I have more reasons or when I'm doing a reinstall - but not just for Code::Blocks.

By the way, does Code::Blocks need the gcc? Or could it be compiled with other compilers, for example like icc?

Edit:
Seems as if I got it working.
I used configure as normal but then changed the CXXFLAGS and CPPFLAGS wich the Makefile uses. I added the preprocessor macros CB_PRECOMP and WX_PRECOMP and changed the include-paths for wx to use my wxGTK-2.6 installation and added the include-path for angelscript.h. It is still compiling, I'm hoping that it will finish successfully.
Here's the commands I have used:
Code
./configure --enable-contrib --prefix=/opt/codeblocks-cvs
make CXXFLAGS="-g -O2 -O2 -ffast-math -DCB_PRECOMP -DWX_PRECOMP" CPPFLAGS="-I/usr/lib/wx/include/gtk2-ansi-release-2.6 -I/usr/include/wx-2.6 -I../sdk/as/include -DGTK_NO_CHECK_CASTS -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES"
This will be followed by a 'make install' if nothing goes wrong.
Title: Re: CVS seems broken ?
Post by: yop on November 20, 2005, 12:36:26 am
By the way, does Code::Blocks need the gcc? Or could it be compiled with other compilers, for example like icc?
 be followed by a 'make install' if nothing goes wrong.
Yes it can you just have to translate the flags (most of them are the same) to the compiler. I built codeblocks with icc as a part of my tests for the addition of icc in cb's supported compilers. But be warned you'll get tons of remarks (well you know the icc way ;))
Title: Re: CVS seems broken ?
Post by: Der Meister on November 20, 2005, 12:48:29 am
Nice...

Well, back to my last approach: It seems as if it compiles well but when it comes to the point where src/src is linked together I get tons of linker-errors, probably the same as anonuser mentioned here (http://forums.codeblocks.org/index.php/topic,1407.0.html).
Title: Re: CVS seems broken ?
Post by: rickg22 on November 20, 2005, 05:11:48 am
Der Meister:

I understand. However, notice that many packages today are built with GCC 3.4+. 4.0 on the other hand, is the one you should be wary of.
Title: Re: CVS seems broken ?
Post by: Der Meister on November 20, 2005, 10:56:12 am
Yes, indeed. But I am using a source based distribution (gentoo) and as long as all important packages compile well on gcc 3.3 (in fact, Code::Blocks is the first one which makes problems) I don't want to risk anything. I know that even in the gentoo stable tree gcc 3.4 or 4.0 will be the used compiler someday (gcc 3.4 is already used in the unstable tree), but I want to stay with the stable tree and not mix stable and unstable packages if possible.
Title: Re: CVS seems broken ?
Post by: Der Meister on November 20, 2005, 01:05:37 pm
Well, I finally got it. mandrav was right, the original error message was a compiler problem. I noticed that it is possible to install gcc 3.3 and 3.4 in parallel and to switch between them. This way I could compile and install Code::Blocks with following commands:
Code
./configure --enable-contrib --prefix=/opt/codeblocks-cvs --with-wx-config=wx-config-2.6
make CPPFLAGS="$(CPPFLAGS) -I../sdk/as/include"
make install
But one problem remains. When I try to start Code::Blocks I get this error message:
Code
 ~ $ /opt/codeblocks-cvs/bin/codeblocks 
Fatal Error: Mismatch between the program and library build versions detected.
The library used 2.6 (no debug,ANSI,compiler with C++ ABI 102,wx containers,compatible with 2.4),
and your program used 2.6 (no debug,ANSI,compiler with C++ ABI 1002,wx containers,compatible with 2.4).
Aborted
I believe that this comes from the fact that I compiled Code::Blocks with gcc 3.4 but wxGTK with gcc 3.3. I will try to re-compile it with gcc 3.4 and hope that it works...

Edit:
Recompiling wxGTK and then recompiling Code::Blocks did the trick. I can start Code::Blocks now but I still get an error message:

14:06:47: /opt/codeblocks-cvs/share/codeblocks/plugins/libcompiler.so: undefined symbol: _ZN14AnnoyingDialog9ShowModalEv

After clicking OK Code::Blocks starts just as normal and seems to work except for the compiler-plugin. But without this plugin Code::Blocks is quite unusable because it can do hardly anything. Has anyone an idea why this problem occurs?
Title: Re: CVS seems broken ?
Post by: mandrav on November 20, 2005, 06:19:26 pm
Quote
Edit:
Recompiling wxGTK and then recompiling Code::Blocks did the trick. I can start Code::Blocks now but I still get an error message:

14:06:47: /opt/codeblocks-cvs/share/codeblocks/plugins/libcompiler.so: undefined symbol: _ZN14AnnoyingDialog9ShowModalEv

After clicking OK Code::Blocks starts just as normal and seems to work except for the compiler-plugin. But without this plugin Code::Blocks is quite unusable because it can do hardly anything. Has anyone an idea why this problem occurs?

Yes, a couple of new files from yesterday weren't in the build system just yet.
I just added them but it 'll take a few hours until anonymous CVS syncs...
Title: Re: CVS seems broken ?
Post by: rig0r on November 20, 2005, 09:08:56 pm
It compiles and runs just fine now after upgrading to GCC 3.4.4 and the CVS update. Thanks  :D