News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Errors on Linux when compiling SVN 3795

Started by bughunter2, March 29, 2007, 05:54:49 PM

Previous topic - Next topic

bughunter2

The problem is that, when following all instructions given at the Wiki, the compilation of Code::Blocks failed. But on my Windows XP SP2 system, it did work (with the same SVN build - 3795).

I'm using a Slackware 11 system. I have followed all instructions from the Wiki to install wxGTK and it installed successfully. I had to use the '--disable-pch' option for './configure' otherwise the command 'make' failed at some file called 'scriptbindings.XXX' with the error 'had to relocate PCH'.

However, I fixed the PCH error, and continued compiling using 'make', then it failed. It failed compiling the file 'infowindow.cpp', line 165. It says 'wxStaticBitmap' was undeclared.

I fixed the error adding the following line
#include <wx/wx.h>
after the following line:
#ifndef CB_PRECOMP

I think it is reproducable. I'm using SVN build 3795. I actually haven't got any idea since which version this error occurred since I never before compiled Code::Blocks on a Linux system.

After adding the line I described above, the compilation got another error when compiling 'help_plugin.cpp', it got the following error:

help_plugin.cpp: In member function `void HelpPlugin::LaunchHelp(const wxString&, bool, const wxString&)':
help_plugin.cpp:373: error: invalid use of undefined type `struct MacrosManager'
../../../../src/include/manager.h:23: error: forward declaration of `struct MacrosManager'


EDIT: I configured Code::Blocks using './configure --enable-contrib --disable-pch', this might be needed to know, since the 'help_plugin' belongs to the plugins which are only build when '--enable-contrib' is specified (correct me if this isn't true).

Anyone has any idea why it's working on my Windows system but not on Linux?

stahta01

This is a common issue for stuff I do. I do NOT do Linux much.
Windows build does the opposite of --disable-pch ; Most Linux uses do --disable-pch this results in missing headers files that need to be added for Linux Build like you did.

Just report them to BerliOS or to the nightly build forum. Please mention how you are doing the Build and which SVN & Linux & wxWidgets Version.

Note, It will work best if you can create an Patch file to post or submit.

Tim S
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

bughunter2

I reinstalled GTK+ and followed the tutorial on the Wiki again to install Code::Blocks (from SVN).

The previous issue disappeared (maybe it was fixed in the SVN or I did something wrong previously?).




This time I have this error:
In file included from codesnippets.cpp:42:
/opt/wx/2.6/include/wx-2.6/wx/gtk/win_gtk.h:18:21: gdk/gdk.h: No such file or directory
/opt/wx/2.6/include/wx-2.6/wx/gtk/win_gtk.h:19:22: gdk/gdkx.h: No such file or directory
/opt/wx/2.6/include/wx-2.6/wx/gtk/win_gtk.h:20:30: gtk/gtkcontainer.h: No such file or directory
/opt/wx/2.6/include/wx-2.6/wx/gtk/win_gtk.h:21:31: gtk/gtkadjustment.h: No such file or directory
.......... more errors ..........

The build command that generated the error was:
g++ -DHAVE_CONFIG_H -I. -I. -I../../../../src/include -I/opt/wx/2.6/lib/wx/include/gtk2-unicode-release-2.6 -I/opt/wx/2.6/include/wx-2.6 -DGTK_NO_CHECK_CASTS -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D_LARGEFILE_SOURCE=1 -DNO_GCC_PRAGMA -I../../../../src/include -I../../../../src/include/wxscintilla/include -I../../../../src/include/wxFlatNotebook/include -Ulinux -Uunix -O2 -ffast-math -g -O2 -DCB_PRECOMP -Winvalid-pch -fPIC -DPIC -fexceptions -MT codesnippets.lo -MD -MP -MF .deps/codesnippets.Tpo -c codesnippets.cpp  -fPIC -DPIC -o .libs/codesnippets.o




I think it can't find the GTK+ installation. I have installed GTK+ to /opt/gtk and I have verified that the installation works by compiling other GTK+ applications.

Any help would be greatly appreciated.

Pecan

In the Makefile.am for CodeSnippets make sure the following lines
are near the top


INCLUDES = $(WX_CXXFLAGS) \
        $(WX_GTK2_CFLAGS) \
-I$(top_srcdir)/src/include \
-I$(top_srcdir)/src/include/wxscintilla/include \
        -I$(top_srcdir)/src/include/wxFlatNotebook/include


bughunter2

#4
This part:

$(WX_GTK2_CFLAGS) \

between...

INCLUDES = $(WX_CXXFLAGS) \

...and...

-I$(top_srcdir)/src/include \

...was missing, why is it needed for codesnippets and not for other plugins?

By the way is it okay if I create a patch and submit it?

EDIT: The only other Makefile.am I found using WX_GTK2_CFLAGS is debuggergdb's one.

Pecan


bughunter2

What is WX_GTK2_CFLAGS anyways? I've tried google but no results. Is WX_GTK2_CFLAGS a thing specific to Code::Blocks?

afb

Quote from: bughunter2 on April 24, 2007, 02:39:04 AM
What is WX_GTK2_CFLAGS anyways? I've tried google but no results. Is WX_GTK2_CFLAGS a thing specific to Code::Blocks?

WX_GTK2_CFLAGS is the same as GTK2_CFLAGS, but it is only set when actually using wxGTK.
(it's possible to have GTK+ installed, but preferring to use another toolkit like wxMSW/wxMac)

It is Code::Blocks specific. But the "GTK2_CFLAGS" comes from pkg-config gtk+-2.0 --cflags.