Author Topic: Errors on Linux when compiling SVN 3795  (Read 4679 times)

Offline bughunter2

  • Multiple posting newcomer
  • *
  • Posts: 24
Errors on Linux when compiling SVN 3795
« on: March 29, 2007, 05:54:49 pm »
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
Code
#include <wx/wx.h>
after the following line:
Code
#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:

Code
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?
« Last Edit: March 29, 2007, 06:07:26 pm by bughunter2 »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7594
    • My Best Post
Re: Errors on Linux when compiling SVN 3795
« Reply #1 on: March 29, 2007, 11:23:58 pm »
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++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline bughunter2

  • Multiple posting newcomer
  • *
  • Posts: 24
Re: Errors on Linux when compiling SVN 3795
« Reply #2 on: April 23, 2007, 11:45:15 pm »
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.

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2781
Re: Errors on Linux when compiling SVN 3795
« Reply #3 on: April 24, 2007, 12:44:56 am »
In the Makefile.am for CodeSnippets make sure the following lines
are near the top

Code
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


Offline bughunter2

  • Multiple posting newcomer
  • *
  • Posts: 24
Re: Errors on Linux when compiling SVN 3795
« Reply #4 on: April 24, 2007, 01:33:43 am »
This part:

Code
 $(WX_GTK2_CFLAGS) \

between...

Code
INCLUDES = $(WX_CXXFLAGS) \

...and...

Code
-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.
« Last Edit: April 24, 2007, 01:38:22 am by bughunter2 »

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2781
Re: Errors on Linux when compiling SVN 3795
« Reply #5 on: April 24, 2007, 01:47:10 am »
Fix already commited. SVN 3883

Offline bughunter2

  • Multiple posting newcomer
  • *
  • Posts: 24
Re: Errors on Linux when compiling SVN 3795
« Reply #6 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?

Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: Errors on Linux when compiling SVN 3795
« Reply #7 on: April 24, 2007, 08:50:34 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.