User forums > Help
Compile CodeBlocks by Cygwin
Jenna:
You need to run C::B's configure script with --with-contrib-plugins=[the,plugins,you,want or all], see the --help parameter
PetrPetrov:
My steps to compile wxWidgets:
./configure --build=x86_64-pc-cygwin --without-msw --with-gtk --disable-universal --enable-tooltips --enable-dnd
--disable-universal is important key, it allows to enable tool tips by using --enable-tooltips
(if you will just specify --enable-tooltips then this option will be disabled, such as default configuration is --enable-universal)
--enable-dnd is also required I guess.
In fact here is no matter static\shared or monolithic\non-monolithic configuration.
Also I fixed small compilation error in /usr/src/wxWidgets-2.8.12/include/wx/string.h line 822:
/*wxChar& operator[](int n)
{ return wxStringBase::at(n); }*/
I have just commented-out these two strings.
Then make, make install.
My steps to compile C::B:
./configure --build=x86_64-pc-cygwin --enable-shared
Before typing 'make' in console please look at the following file /usr/src/codeblocks-12.11release8629/src/sdk/wxscintilla/include/wx/wxscintilla.h line 37-43.
Please comment this block:
/*#ifdef WXMAKINGDLL_SCI
#define WXDLLIMPEXP_SCI WXEXPORT
#elif defined(WXUSINGDLL_SCI) || defined(WXUSINGDLL)
#define WXDLLIMPEXP_SCI WXIMPORT
#else // not making nor using DLL
#define WXDLLIMPEXP_SCI
#endif*/
and add the following line a little:
#define WSDLLIMPEXP_SCI
then use Replace command (Ctrl+H) to replaces all entries of WXDLLIMPEXP_SCI word by WSDLLIMPEXP_SCI world for only this file (/usr/src/codeblocks-12.11release8629/src/sdk/wxscintilla/include/wx/wxscintilla.h)!
Now you can type 'make' in console.
However, a few compilation errors will occur.
1.
/usr/src/codeblocks-12.11release8629/src/sdk/macrosmanager.cpp lines 89-105:
my modifications are:
//#ifndef __WXMAC__
// wxRE_ADVANCED);
//#else
wxRE_EXTENDED);
//#endif
m_RE_To83Path.Compile(_T("\\$TO_83_PATH{([^}]*)}"),
//#ifndef __WXMAC__
// wxRE_ADVANCED);
//#else
wxRE_EXTENDED);
//#endif
m_RE_RemoveQuotes.Compile(_T("\\$REMOVE_QUOTES{([^}]*)}"),
//#ifndef __WXMAC__
// wxRE_ADVANCED);
//#else
wxRE_EXTENDED);
//#endif
2.
/usr/src/codeblocks-12.11release8629/src/plugins/debuggergdb/gdb_commands.h lines 204-223:
//#ifndef __WXMAC__
// wxRE_ADVANCED);
//#else
wxRE_EXTENDED);
//#endif
static wxRegEx reStepI2(_T("\\A(0x[A-Fa-f0-9]+)\\s+(\\d+)\\s+in (.*)"),
//#ifndef __WXMAC__
// wxRE_ADVANCED);
//#else
wxRE_EXTENDED);
//#endif
static wxRegEx reStepI3(_T("^(0x[A-Fa-f0-9]+) in (.*)? from (.*)"));
static wxRegEx reStepI4(_T("^(0x[A-Fa-f0-9]+) in (.*)? at (.*)"));
static wxRegEx reNextI(_T("\x1a\x1a(([a-zA-Z]:)?.*?):([0-9]*):([0-9]*):(middle|beg):(.*)"),
//#ifndef __WXMAC__
// wxRE_ADVANCED);
//#else
wxRE_EXTENDED);
//#endif
and also line 642 in this file:
m_regExp(wxT("^Catchpoint[ \\t]([0-9]+)[ \\t]\\(") + type + wxT("\\)$"), wxRE_EXTENDED/*wxRE_ADVANCED*/)
3.
/usr/src/codeblocks-12.11release8629/src/plugins/debuggergdb/parsewatchvalue.cpp lines 67-71:
//#ifndef __WXMAC__
// wxRE_ADVANCED);
//#else
wxRE_EXTENDED);
//#endif
and last compilation error:
/usr/src/codeblocks-12.11release8629/src/plugins/xpmanifest/windowsxplooknfeel.h line 11-13:
#ifndef __WXMSW__
#error This plugin is for use under Win32 only!
#endif
So, this plugin should be not compiled under GTK\Linux.
Just disable xpmanifest plugin compilation from generated Makefile:
/usr/src/codeblocks-12.11release8629/src/plugins/Makefile
strings like this:
MAYBE_ABBREVIATIONS = abbreviations
#MAYBE_MANIFEST = xpmanifest
SUBDIRS = $(MAYBE_ASTYLE) \
$(MAYBE_AUTOSAVE) \
$(MAYBE_CLASSWIZARD) \
$(MAYBE_CODECOMPLETION) \
$(MAYBE_COMPILER) \
$(MAYBE_DEBUGGER) \
$(MAYBE_MIMEHANDLER) \
$(MAYBE_SCRIPTEDWIZARD) \
$(MAYBE_PROJECTSIMPORTER) \
$(MAYBE_OPENFILESLIST) \
$(MAYBE_TODO) \
$(MAYBE_ABBREVIATIONS) \
#$(MAYBE_MANIFEST) \
contrib
then compilation goes fine......
You can 'make install' after conpilation and run C::B under Cygwin + remote X11 display, such as
export DISPLAY=localhost:0.0
(you should have local X11 server installed and running on Windows host, such as Xming - http://www.straightrunning.com/XmingNotes/)
however, I see problem: all plugins (I mean only standard plugins for C::B) are being built to static library configuration.
But we need to have them in shared library configuration. So, 0 plugins are loaded.
However, I specified --enable-shared during C::B configuration.
Could anyone help, or make an idea?
stahta01:
Found some of my old Cygwin Patches.
Not likely safe to apply to CB SVN; but, they might help someone build CB.
Edit: Removed patch I decided the patch would just make more work; will post my progress and commands used, later.
Edit: Step that checks for gtk version 2 installed, Correctly.
--- Code: ---pkg-config --cflags --libs gtk+-2.0
--- End code ---
Mine was NOT installed right; (I had prior non CygWin GTK installed)
I had to delete the Windows System Variables GTK_BASEPATH and PKG_CONFIG_PATH to get the Cygwin GTK to be seen.
(I also had to install CygWin pkg-config; it was using the one Installed by the old GTK Package, above.)
--- Code: ----D_REENTRANT -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng15 -I/usr/include/harfbuzz -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lpangocairo-1.0 -lXinerama -lXi -lXrandr -lXcursor -lXcomposite Xdamage -lgdk_pixbuf-2.0 -lpangoft2-1.0 -lgio-2.0 -lXfixes -lcairo -lpixman-1 -lxcb-shm -lxcb-render -lXrender -lXext -lX11 -lxcb -lXau -lXdmcp lpng15 -lharfbuzz -lpango-1.0 -lm -lfontconfig -lexpat -lfreetype -lz -lbz2 -lgmodule-2.0 -lgobject-2.0 -lffi -lglib-2.0 -lintl -liconv -lpcre
--- End code ---
Tim S.
PetrPetrov:
--- Quote from: stahta01 on November 07, 2013, 02:22:10 am ---Step that checks for gtk version 2 installed.
--- Code: ---pkg-config gtk+-2.0 --libs
--- End code ---
--- End quote ---
Thank you. My output is:
Petr@WS4 ~
$ pkg-config gtk+-2.0 --libs
-lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lpangocairo-1.0 -lXinerama -lXi -lXrandr -lXcursor -lXcomposite -lXdamage -lgdk_pixbuf-2.0 -lpangoft2-1.0 -lgio-2.0 -lXfi xes -lcairo -lpixman-1 -lxcb-shm -lxcb-render -lXrender -lXext -lX11 -lxcb -lXau -lXdmcp -lpng15 -lharfbuzz -lpango-1.0 -lm -lfontconfig -lexpat -lfreetype -lz -lbz2 -lgmodule-2.0 -lgobject-2.0 -lffi -lglib-2.0 -lintl -liconv -lpcre
PetrPetrov:
My C::B running on Cygwin showing About dialog:
I selected new project: all categories are empty - 0 plugins are loaded
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version