Author Topic: Compiling C::B using Msys2  (Read 14186 times)

Offline alle_meije

  • Multiple posting newcomer
  • *
  • Posts: 29
Compiling C::B using Msys2
« 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)

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
« Last Edit: August 19, 2015, 04:46:35 pm by alle_meije »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Compiling C::B using Msys2
« Reply #1 on: August 19, 2015, 02:50:22 pm »
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.
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 alle_meije

  • Multiple posting newcomer
  • *
  • Posts: 29
Re: Compiling C::B using Msys2
« Reply #2 on: August 19, 2015, 03:44:10 pm »
Ah, I did not know that option, many thanks! re-compiling wxWidgets as we speak.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Compiling C::B using Msys2
« Reply #3 on: August 19, 2015, 04:13:47 pm »
@alle_meije
Please use the code tag or quote tag to wrap you log messages.
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 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?
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline alle_meije

  • Multiple posting newcomer
  • *
  • Posts: 29
Re: Compiling C::B using Msys2
« Reply #4 on: August 19, 2015, 04:44:41 pm »
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".

Offline alle_meije

  • Multiple posting newcomer
  • *
  • Posts: 29
Re: Compiling C::B using Msys2
« Reply #5 on: August 19, 2015, 04:51:59 pm »
Just to report, configuring wxWidgets with
Code
 --prefix=/mingw64 --enable-compat28
before building did not solve the issue. The build of C::B stops with the same error at the same line.

I'm not sure if the problem is with how wxWidgets was coded / built or C::B?
« Last Edit: August 19, 2015, 04:55:58 pm by alle_meije »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Compiling C::B using Msys2
« Reply #6 on: August 19, 2015, 05:30:49 pm »
Just to report, configuring wxWidgets with
Code
 --prefix=/mingw64 --enable-compat28
before building did not solve the issue. The build of C::B stops with the same error at the same line.

I'm not sure if the problem is with how wxWidgets was coded / built or C::B?

I will try doing this in a week or so.
If in two weeks, I have NOT posted please reply to this post to remind me.

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 alle_meije

  • Multiple posting newcomer
  • *
  • Posts: 29
Re: Compiling C::B using Msys2
« Reply #7 on: August 19, 2015, 05:38:08 pm »
Many thanks for that!

In the meantime I am compiling wxWidgets with more options for 'configure':
Code
--enable-shared --enable-unicode --enable-opengl --enable-monolithic
Options that are set via a Makefile.gcc in the Windows compilation guide of C::B -- I only have 'configure' though.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Compiling C::B using Msys2
« Reply #8 on: August 19, 2015, 05:44:04 pm »
Many thanks for that!

In the meantime I am compiling wxWidgets with more options for 'configure':
Code
--enable-shared --enable-unicode --enable-opengl --enable-monolithic
Options that are set via a Makefile.gcc in the Windows compilation guide of C::B -- I only have 'configure' though.

These options are almost positively required
Code
--enable-shared --enable-unicode
Note: wxWidgets should default to having "--enable-unicode" as if it was on.

The option "--enable-opengl" is NOT required; but, a very good idea.

No idea on whether "--enable-monolithic" is required; but, I would guess it is NOT required and wxWidgets master tends to be broken from time to time on using that option.

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 stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Compiling C::B using Msys2
« Reply #9 on: August 19, 2015, 07:43:10 pm »
FYI:

I would guess wxWidgets master is less stable than wxWidgets 3.0.2

But, WX_3_0_BRANCH is likely to be more stable than wxWidgets 3.0.2.

https://github.com/wxWidgets/wxWidgets/archive/WX_3_0_BRANCH.zip

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 alle_meije

  • Multiple posting newcomer
  • *
  • Posts: 29
Re: Compiling C::B using Msys2
« Reply #10 on: August 20, 2015, 10:36:23 am »
I use the '--enable-monolithic' option because on the install-from-source-in-windows page http://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows it suggests that you set MONOLITHIC=1 in the file Makefile.gcc --which does not seem to be in the distribution any more.

All to no avail... Still exits with the static data member error.

In the meantime I'm using http://downloads.sourceforge.net/project/codeblocks/Binaries/Nightlies/2015/CB_20150604_rev10320_win32_setup.zip and save often (-:

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Compiling C::B using Msys2
« Reply #11 on: August 22, 2015, 04:10:54 am »

Is this something that should be set explicitly when (in Windows) it's not possible to use C::B to build C::B?


Yes, you can use CB to build CB in both Windows and Linux.

Edit: The only thing I remember that needs set is the CB Global variable of "cb_release_type" needs set to "-g" or " " (single space) without the double quotes.

Tim S.
« Last Edit: August 23, 2015, 03:43:58 pm by stahta01 »
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 stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Compiling C::B using Msys2
« Reply #12 on: August 23, 2015, 03:39:00 pm »
I was able to duplicate the error using wxWidgets 3.0 branch and MSys2.

This likely means that there is a problem using MSys2 and Code::Blocks configure/make method of building Code::Blocks.
I might try to find the cause of the problem in the future.

Future problems, I saw during attempt.
  The use of option "-ansi" will cause a windows build to fail once it gets far enough.

Note: I did see a patch in the past to patch the configure/make for Windows (it was before MSys2 likely existed)

The method of Building on Windows has always been using the CB Project file instead of configure/make.
Therefore, it is NOT worth reporting this as a official bug; but, is worth reporting a patch to fix the issue.
I do NOT know enough about the CB configure/make build system to attempt a patch at this time.

There was a CB thread on using Cygwin to build CB using configure/make.
I posted in it; it might have info useful for trying to build under MSys2.

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 alle_meije

  • Multiple posting newcomer
  • *
  • Posts: 29
Re: Compiling C::B using Msys2
« Reply #13 on: August 24, 2015, 03:04:46 pm »
Many thanks for the effort! I do much appreciate it.

If I can help in any way to make this work then I'm nore than happy to.

It did not seem to me like a (coding) bug -- most likely a difference in how to fit into the host system.
As mentioned before, Msys2 is a bit of both in that respect. Windows binaries in a Linux-style shell.

My secret hope was that if C::B can be built using regular make, aclocal etc then it can become an Msys2 package
(Msys2 uses the 'arch' linux package management system, which is easier than a windows installer or Chocolatey)

For developing C::B itself, using an already-existing existing copy seems logical, but in Msys2 there is no such copy.

I will read the cygwin thread, thanks!
That would be this one?
http://forums.codeblocks.org/index.php/topic,18525.0.html
The OP also has problems with importdll.
« Last Edit: August 25, 2015, 10:44:48 am by alle_meije »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Compiling C::B using Msys2
« Reply #14 on: August 24, 2015, 08:14:50 pm »
I will read the cygwin thread, thanks!
That would be this one?
http://forums.codeblocks.org/index.php/topic,18525.0.html
The OP also has problems with importdll.

Yes that was the thread.

I think a build under cygwin might be a way to boot-strap an CB that works under MSys2; but, this is just a guess.
The clearly better way for CB is for the configure make to work under MSys2.

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 alle_meije

  • Multiple posting newcomer
  • *
  • Posts: 29
Re: Compiling C::B using Msys2
« Reply #15 on: August 25, 2015, 05:13:56 pm »
Scouring all previous posts and manuals for options, I used this for building wxWidgets
Code
configure --prefix=/mingw64 \
          --enable-compat28 --enable-xrc       --enable-shared     --enable-monolithic --disable-debug \
          --enable-unicode  --enable-vendor=cb --disable-universal --enable-tooltips   --enable-dnd \
          --with-opengl \
          CFLAGS='-fno-keep-inline-dllexport' \
          CXXFLAGS='-fno-keep-inline-dllexport'

But the same DLL-related things are still causing problems even with all those options.

I have tried
Code
  cd ../wxWidgets-dev/
  make distclean
  configure --prefix=/mingw64 \
            --disable-shared --enable-static     --enable-compat28   --enable-xrc      --enable-monolithic --disable-debug \
            --enable-unicode --enable-vendor=cb  --disable-universal --enable-tooltips --enable-dnd \
            --with-opengl
  updatedb & make && make install
  cd ../codeblocks-dev/
  ./bootstrap
  ./configure --with-wx-config=`which wx-config`
  make

To see if it would work with wxWidgets compiled as a static library, but it still stops at the Annoying Dialog (same place) complaining about static members.

Out of ideas.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Compiling C::B using Msys2
« Reply #16 on: September 18, 2015, 11:59:59 pm »
I am trying to get Code::Blocks to build using MSys2 MinGW64.
It is now obvious that the exchndl DLL will need ported to MSys2; this is NOT something I plan to do.
I believe the exchndl DLL is made from drmingw sourcecode https://github.com/jrfonseca/drmingw
I plan to just fix the other items; and, then wait for someone else to port the exchndl DLL.
Or, at least wait till I learn enough of MSys2 to think it is possible for me to do it myself.

My Git location that I plan to upload the work in a few weeks
https://github.com/stahta01/msys2_codeblocks

My repo I am using to test changes; I am still learning how to use Git correctly.
I am doing a lot of forced pushes on this repo; to correct mistakes.
( I know configure/make even less than I know Git)
https://github.com/stahta01/codeblocks_windows

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 scarphin

  • Lives here!
  • ****
  • Posts: 644
Re: Compiling C::B using Msys2
« Reply #17 on: September 19, 2015, 10:42:49 am »
There is a 64-bit version of exchndl.dll in cb repo, doesn't that work for you? I use it for my 64-bit builds.

Btw, I've ported all the required project, workspace and update files to 64-bit wx2.8 for my own usage, I can pack them and upload them somewhere if that helps.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Compiling C::B using Msys2
« Reply #18 on: September 19, 2015, 01:09:31 pm »
There is a 64-bit version of exchndl.dll in cb repo, doesn't that work for you? I use it for my 64-bit builds.

Btw, I've ported all the required project, workspace and update files to 64-bit wx2.8 for my own usage, I can pack them and upload them somewhere if that helps.

MSys2 does NOT use MINGW64 built in startup code for its internal built apps.
So, I am guessing the 64-bit version of exchndl.dll in cb repo will NOT work as a native MSys2 app.
My first idea was to just create a Windows 64 bit apps modified to work with MSys2 and that way the
64-bit version of exchndl.dll in cb repo should work.

I just wanted to get the configure/make method of building to work under MSys2 and in my view
that will require 64-bit version of exchndl.dll compiled to work as native MSys2 dll.
The work to do this correctly using the correct MSys2 packaging is way beyond the effort I wish to put in.

But, I now need to decide how to fix the Squirrel libs for DLL export issues.
(I am trying to build the CB SDK without using the linker export all option; I think its a bad design choice.)
FYI: I figured out how to export the Mgr Template in case that is wanted by someone.

Tim S.
« Last Edit: September 19, 2015, 01:11:09 pm by stahta01 »
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 scarphin

  • Lives here!
  • ****
  • Posts: 644
Re: Compiling C::B using Msys2
« Reply #19 on: September 19, 2015, 11:27:03 pm »
Ok, my bad.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Compiling C::B using Msys2
« Reply #20 on: September 20, 2015, 01:06:41 am »
Ok, my bad.

No it was a good idea, I am trying to compile it right now using that way.
But, it is a bad idea in that it is very likely the crash reporting routine will crash instead of reporting a error correctly.

Found out I will need to port the console runner to MSys2; and I think that is something within my knowledge and abilities.

I have an issue getting some core plugins to link because of tinyXML link errors; but, I decided to just ignore those plugins for now.
(The Compiler Plugin compiles without any errors; and, that is the most important plugin to me.)

I am hoping the starter of this thread will do the work of porting exchndl.dll to the MSys2 environment.
If not, I plan to try my changes under CygWin64 and see if they work there.

Edit: Found this package mingw-w64-x86_64-drmingw-0.7.4-2; so, I do NOT need to worry about porting drmingw to MSys2's mingw-w64-x86_64. Note: I am NOT certain if porting is the right word; might just be a minor recompile with linking to the correct object files.
But, I am a newbie on using MSys2 and did NOT wish to do something that might be risky.

Tim S.
« Last Edit: September 20, 2015, 10:11:23 pm by stahta01 »
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 alle_meije

  • Multiple posting newcomer
  • *
  • Posts: 29
Re: Compiling C::B using Msys2
« Reply #21 on: October 16, 2015, 11:49:31 am »
Sorry for letting this thread get old. Must admit these names mean nothing to me.
But still, I'll give it a go if it means being able to have C::B in Msys2!

It looks like a 64-bit version was compiled before?
http://forums.codeblocks.org/index.php/topic,18902.msg129510.html#msg129510
« Last Edit: October 16, 2015, 12:52:20 pm by alle_meije »

Offline alle_meije

  • Multiple posting newcomer
  • *
  • Posts: 29
Re: Compiling C::B using Msys2
« Reply #22 on: October 16, 2015, 02:01:49 pm »
I have compiled https://github.com/jrfonseca/drmingw in Msys2, which includes a exchndl DLL.

In Msys2 64-bit I did
Code
git clone https://github.com/jrfonseca/drmingw.git
cd drmingw/
mkdir build
cd build
cmake .. -G "MSYS Makefiles"
make

which produces a DLL file bin/exchndl.dll that I'm more than happy to share.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Compiling C::B using Msys2
« Reply #23 on: October 16, 2015, 03:30:26 pm »
@ alle_meije:
I am building CB Under MSys2 using the DrMinGW and wxWidgets Msys2's MinGW64 packages.

Still have NOT fixed all the bugs; but, I can build CB using Configure/Make method.
I have NOT spent enough time to see if the resulting Code::Blocks is useful for doing anything.

I have changed to trying to build CB using CB Projects for now; then, I plan to merge the two methods.
After, that I plan to test the resulting binaries for usefulness.

I have NO idea what would be the proper location in MSYS2 to store the CB config file; do you have a suggestion?

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 stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Compiling C::B using Msys2
« Reply #24 on: October 18, 2015, 01:41:24 am »
The combined changes I did to get Configure/Make method to work under MSys2
https://github.com/stahta01/cb_misc/blob/master/Patches/Git-am/MSys2/2015-10-16_MSys2_changes.patch

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 stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Compiling C::B using Msys2
« Reply #25 on: October 29, 2015, 03:20:41 am »
I have decided to stop work on trying to build Code::Blocks under MSys2 using configure/make decided it was NOT the real problem.

Decided the real problem is making the normal Windows built binary to work better with the Compiler and Libraries from an MSys2 installation.

Likely need to add use of the command "cygpath" in the compiler.

This means I would likely need to edit the Cygwin GCC Compiler code to use it.

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