Current CVS doesnt seem to compile:
# ./configure --prefix=/usr/local/codeblocks-cvs --enable-contrib
# make
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 :)
I don't really understand what the problem is here...
You 're talking about linux, so this should be enough:
./configure --enable-contrib --prefix=/usr
make
sudo make install
Why the confusion?
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:
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.
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).
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:
./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.
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:
./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:
~ $ /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?