Author Topic: compiling wxWidgets in a MSYS/minGW environment  (Read 6207 times)

Offline blue orb

  • Multiple posting newcomer
  • *
  • Posts: 25
compiling wxWidgets in a MSYS/minGW environment
« on: November 05, 2011, 11:16:12 am »
ok, i have compiled wxWidgets 2.8.10 using MSYS = cd $WXWIN and /c/wxWidgets-2.8.10 etc.

but, it doesn't work properly.  bah!!

what can i do about this MSYS/minGW environment problem?

yes :)

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: compiling wxWidgets in a MSYS/minGW environment
« Reply #1 on: November 05, 2011, 11:54:59 am »
what can i do about this MSYS/minGW environment problem?
You don't need this environment to compile wxWidgets. Instead, do the following:

1.) Make sure the PATH environment variable is clean and does not point to any GCC / MSYS / MINGW installation folders!
2.) Install the TDM GCC compiler
3.) Go into the wxWidgets source file folder root (the one, where e.g. configure.in is in)
4.) Open a command prompt there and do:
Code
set PATH=[PATH_TO_TDM_GCC_BIN_(!)_FOLDER];%PATH%
cd build\msw
mingw32-make -f makefile.gcc CXXFLAGS="-fno-keep-inline-dllexport" BUILD=release SHARED=1 MONOLITHIC=1 USE_XRC=1 USE_OPENGL=1 UNICODE=1 clean
mingw32-make -f makefile.gcc CXXFLAGS="-fno-keep-inline-dllexport" BUILD=release SHARED=1 MONOLITHIC=1 USE_XRC=1 USE_OPENGL=1 UNICODE=1
Do it exactly like this (of course adapt the path to the TDM GCC bin folder) and it will work.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline blue orb

  • Multiple posting newcomer
  • *
  • Posts: 25
Re: compiling wxWidgets in a MSYS/minGW environment
« Reply #2 on: November 05, 2011, 02:23:35 pm »
thanks for the help!

i have learnt some good things from your post. :)

i think that wxWidgets 2.8.10 has actually compiled ok.

but, i still get debug configuration warnings when i try to set up a new wxWidgets project.

could it be > project > build options/properties?

it feels like nothing else can be done... wxPack it is then!

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: compiling wxWidgets in a MSYS/minGW environment
« Reply #3 on: November 05, 2011, 02:44:17 pm »
but, i still get debug configuration warnings when i try to set up a new wxWidgets project.
To build the debug version of wxWidgets, do the same as I said before, simply removing this line:
Code
mingw32-make -f makefile.gcc CXXFLAGS="-fno-keep-inline-dllexport" BUILD=release SHARED=1 MONOLITHIC=1 USE_XRC=1 USE_OPENGL=1 UNICODE=1 clean
...and changing this line:
Code
mingw32-make -f makefile.gcc CXXFLAGS="-fno-keep-inline-dllexport" BUILD=release SHARED=1 MONOLITHIC=1 USE_XRC=1 USE_OPENGL=1 UNICODE=1
...into:
Code
mingw32-make -f makefile.gcc CXXFLAGS="-fno-keep-inline-dllexport" BUILD=debug SHARED=1 MONOLITHIC=1 USE_XRC=1 USE_OPENGL=1 UNICODE=1
However, you might not need this until you want to debug into wxWidgets code, too (which you normally don't). Instead, you could also simply use the same wx (!) flags for the debug target as for the release target, namely #defines and libs.

EDIT: ...for the record: All this information and even more you will also find in our Wiki.
« Last Edit: November 05, 2011, 02:47:00 pm by MortenMacFly »
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline blue orb

  • Multiple posting newcomer
  • *
  • Posts: 25
Re: compiling wxWidgets in a MSYS/minGW environment
« Reply #4 on: November 05, 2011, 03:07:53 pm »
do i need to re-install wxWidgets 2.8.10, first?

if not, should i just redo the process again?

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: compiling wxWidgets in a MSYS/minGW environment
« Reply #5 on: November 05, 2011, 04:51:46 pm »
The debug build is created in a different directory, so all you have to do is run the new command (the two builds do not conflict).

Offline blue orb

  • Multiple posting newcomer
  • *
  • Posts: 25
Re: compiling wxWidgets in a MSYS/minGW environment
« Reply #6 on: November 05, 2011, 07:12:17 pm »
finally, i have got it working...

but do i need to execute this line of code:

Code
mingw32-make -f makefile.gcc CXXFLAGS="-fno-keep-inline-dllexport" BUILD=debug SHARED=1 MONOLITHIC=1 USE_XRC=1 USE_OPENGL=1 UNICODE=1 clean

yes :)

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: compiling wxWidgets in a MSYS/minGW environment
« Reply #7 on: November 05, 2011, 11:08:31 pm »
Code
mingw32-make -f makefile.gcc CXXFLAGS="-fno-keep-inline-dllexport" BUILD=debug SHARED=1 MONOLITHIC=1 USE_XRC=1 USE_OPENGL=1 UNICODE=1 clean
This command cleans (deletes) all files related to the specific build; it is good practice to use it before compiling to ensure nothing will interfere, however running afterwards would just delete everything you spent time to compile.