User forums > Using Code::Blocks
Compiling C::B using Msys2
alle_meije:
For some reason the C::B binaries often crash on my Win7 laptop.
For development on this laptop I use a combination of C::B and Msys2
(https://sourceforge.net/p/msys2/wiki/MSYS2 installation)
I am now trying to compile C::B in the Msys2 envioronment.
The Linux installation instructions (http://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Linux) seem most suitable for building in Msys2.
Compiling wxwidgets was easy:
1. wget --no-check-certificate https://github.com/wxWidgets/wxWidgets/archive/master.zip && unzip master.zip && mv wxWidgets-master wxWidgets-dev
2. cd wxWidgets-dev
3. configure --prefix=/mingw64; make; make install ## prefix for the 64bit compiler environment
The wxWidgets tests described on the linux page all work (i.e. return useful info):
$ wx-config --prefix
/mingw64
$ wx-config --libs
-L/mingw64/lib -Wl,--subsystem,windows -mwindows -lwx_mswu_xrc-3.1 -lwx_mswu_html-3.1 -lwx_mswu_qa-3.1 -lwx_mswu_adv-3.1 -lwx_mswu_core-3.1 -lwx_baseu_xml-3.1 -lwx_baseu_net-3.1 -lwx_baseu-3.1
$ which wx-config
/mingw64/bin/wx-config
Then I continue with C::B:
a) svn checkout http://svn.code.sf.net/p/codeblocks/code/trunk codeblocks-dev
b) cd codeblocks-dev/
c) ./bootstrap
d) ./configure --with-wx-config=`which wx-config`; ## no errors/warnings, wxwidgets 3.1 found, advised to issue 'make'
e) make
follows with the output below.
The warnings and errors all seem to relate to DLLexport and DLLimport.
Is this something that should be set explicitly when (in Windows) it's not possible to use C::B to build C::B?
Thanks for the help, really hoping to use C::B also in Msys2 for Windows binaries!
`make` output:
--- Code: ---/bin/sh ../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I../../src/include -I/mingw64/lib/wx/include/msw-unicode-3.1 -I/mingw64/include/wx-3.1 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMSW__ -I../../src/include -I../../src/sdk/wxscintilla/include -I../../src/include/tinyxml -I../../src/include/scripting/include -I../../src/include/scripting/bindings -I../../src/include/scripting/sqplus -I../../src/include/mozilla_chardet -I../../src/include/mozilla_chardet/mfbt -I../../src/include/mozilla_chardet/nsprpub/pr/include -I../../src/include/mozilla_chardet/xpcom -I../../src/include/mozilla_chardet/xpcom/base -I../../src/include/mozilla_chardet/xpcom/glue -ansi -DTIXML_USE_STL -O2 -ffast-math -DCB_AUTOCONF -g -O2 -DCB_PRECOMP -Winvalid-pch -fPIC -DPIC -fexceptions -MT annoyingdialog.lo -MD -MP -MF $depbase.Tpo -c -o annoyingdialog.lo annoyingdialog.cpp &&\
mv -f $depbase.Tpo $depbase.Plo
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../../src/include -I/mingw64/lib/wx/include/msw-unicode-3.1 -I/mingw64/include/wx-3.1 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMSW__ -I../../src/include -I../../src/sdk/wxscintilla/include -I../../src/include/tinyxml -I../../src/include/scripting/include -I../../src/include/scripting/bindings -I../../src/include/scripting/sqplus -I../../src/include/mozilla_chardet -I../../src/include/mozilla_chardet/mfbt -I../../src/include/mozilla_chardet/nsprpub/pr/include -I../../src/include/mozilla_chardet/xpcom -I../../src/include/mozilla_chardet/xpcom/base -I../../src/include/mozilla_chardet/xpcom/glue -ansi -DTIXML_USE_STL -O2 -ffast-math -DCB_AUTOCONF -g -O2 -DCB_PRECOMP -Winvalid-pch -fPIC -DPIC -fexceptions -MT annoyingdialog.lo -MD -MP -MF .deps/annoyingdialog.Tpo -c annoyingdialog.cpp -DDLL_EXPORT -DPIC -o .libs/annoyingdialog.o
annoyingdialog.cpp:1:0: warning: -fPIC ignored for target (all code is position independent)
/*
^
annoyingdialog.cpp:10:25: warning: ../../src/include/sdk_precomp.h.gch: not used because `DLL_EXPORT' is defined [-Winvalid-pch]
In file included from C:/tools/msys2/mingw64/include/wx-3.1/wx/window.h:18:0,
from C:/tools/msys2/mingw64/include/wx-3.1/wx/msw/private.h:26,
from C:/tools/msys2/mingw64/include/wx-3.1/wx/wxprec.h:33,
from ../../src/include/sdk_common.h:37,
from ../../src/include/sdk_precomp.h:13,
from annoyingdialog.cpp:10:
C:/tools/msys2/mingw64/include/wx-3.1/wx/event.h:3983:34: warning: 'AnnoyingDialog::sm_eventTable' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
const wxEventTable theClass::sm_eventTable = \
^
C:/tools/msys2/mingw64/include/wx-3.1/wx/event.h:4397:56: note: in expansion of macro 'wxBEGIN_EVENT_TABLE'
#define BEGIN_EVENT_TABLE(a,b) wxBEGIN_EVENT_TABLE(a,b)
^
annoyingdialog.cpp:26:1: note: in expansion of macro 'BEGIN_EVENT_TABLE'
BEGIN_EVENT_TABLE(AnnoyingDialog, wxScrollingDialog)
^
annoyingdialog.cpp:26:19: warning: 'virtual const wxEventTable* AnnoyingDialog::GetEventTable() const' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
BEGIN_EVENT_TABLE(AnnoyingDialog, wxScrollingDialog)
^
<< >>
<< loads of warnings about deprecated virtual void functions >>
<< >>
^
In file included from C:/tools/msys2/mingw64/include/wx-3.1/wx/window.h:18:0,
from C:/tools/msys2/mingw64/include/wx-3.1/wx/msw/private.h:26,
from C:/tools/msys2/mingw64/include/wx-3.1/wx/wxprec.h:33,
from ../../src/include/sdk_common.h:37,
from ../../src/include/sdk_precomp.h:13,
from annoyingdialog.cpp:10:
annoyingdialog.cpp: In member function 'virtual const wxEventTable* AnnoyingDialog::GetEventTable() const':
annoyingdialog.cpp:26:19: error: definition of static data member 'AnnoyingDialog::sm_eventTable' of dllimport'd class
BEGIN_EVENT_TABLE(AnnoyingDialog, wxScrollingDialog)
^
C:/tools/msys2/mingw64/include/wx-3.1/wx/event.h:3983:24: note: in definition of macro 'wxBEGIN_EVENT_TABLE'
const wxEventTable theClass::sm_eventTable = \
^
annoyingdialog.cpp:26:1: note: in expansion of macro 'BEGIN_EVENT_TABLE'
BEGIN_EVENT_TABLE(AnnoyingDialog, wxScrollingDialog)
^
annoyingdialog.cpp: In member function 'virtual wxEventHashTable& AnnoyingDialog::GetEventHashTable() const':
annoyingdialog.cpp:26:19: error: definition of static data member 'AnnoyingDialog::sm_eventHashTable' of dllimport'd class
BEGIN_EVENT_TABLE(AnnoyingDialog, wxScrollingDialog)
^
C:/tools/msys2/mingw64/include/wx-3.1/wx/event.h:3987:22: note: in definition of macro 'wxBEGIN_EVENT_TABLE'
wxEventHashTable theClass::sm_eventHashTable(theClass::sm_eventTable); \
^
annoyingdialog.cpp:26:1: note: in expansion of macro 'BEGIN_EVENT_TABLE'
BEGIN_EVENT_TABLE(AnnoyingDialog, wxScrollingDialog)
^
Makefile:948: recipe for target 'annoyingdialog.lo' failed
make[3]: *** [annoyingdialog.lo] Error 1
make[3]: Leaving directory '/home/amwink/codeblocks-dev/src/sdk'
Makefile:969: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/home/amwink/codeblocks-dev/src/sdk'
Makefile:455: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/amwink/codeblocks-dev/src'
Makefile:495: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1
--- End code ---
stahta01:
I know you need to build wxWidgets 3.1.x using configure option "--enable-compat28" for Code::Blocks to have a chance of compiling without error.
Tim S.
alle_meije:
Ah, I did not know that option, many thanks! re-compiling wxWidgets as we speak.
ollydbg:
@alle_meije
Please use the code tag or quote tag to wrap you log messages.
--- Quote from: alle_meije on August 19, 2015, 01:47:51 pm ---For some reason the C::B binaries often crash on my Win7 laptop.
For development on this laptop I use a combination of C::B and Msys2
(https://sourceforge.net/p/msys2/wiki/MSYS2 installation)
...
--- End quote ---
I don't think build C::B under msys2 can solve your issue. Why not directly build c::b under mingw, and use gdb to debug the crash issue?
alle_meije:
That's basically what I'm doing in Msys2:
--- Code: ---$ gcc -v
Using built-in specs.
COLLECT_GCC=C:\tools\msys2\mingw64\bin\gcc.exe
COLLECT_LTO_WRAPPER=C:/tools/msys2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../gcc-5.2.0/configure --prefix=/mingw64 --with-local-prefix=/mingw64/local --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --with-native-system-header-dir=/mingw64/x86_64-w64-mingw32/include --libexecdir=/mingw64/lib --with-gxx-include-dir=/mingw64/include/c++/5.2.0 --enable-bootstrap --with-arch=x86-64 --with-tune=generic --enable-languages=c,lto,c++,objc,obj-c++,fortran,ada --enable-shared --enable-static --enable-libatomic --enable-threads=posix --enable-graphite --enable-fully-dynamic-string --enable-libstdcxx-time=yes --disable-libstdcxx-pch --disable-libstdcxx-debug --enable-version-specific-runtime-libs --disable-isl-version-check --enable-lto --enable-libgomp --disable-multilib --enable-checking=release --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-libiconv --with-system-zlib --with-gmp=/mingw64 --with-mpfr=/mingw64 --with-mpc=/mingw64 --with-isl=/mingw64 --with-pkgversion='Rev3, Built by MSYS2 project' --with-bugurl=http://sourceforge.net/projects/msys2 --with-gnu-as --with-gnu-ld
Thread model: posix
gcc version 5.2.0 (Rev3, Built by MSYS2 project)
$ gdb -v
GNU gdb (GDB) 7.9.1
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-w64-mingw32".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
--- End code ---
Navigation
[0] Message Index
[#] Next page
Go to full version