Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: spflanze on May 02, 2019, 06:34:27 am

Title: wxWidgets 2.8.12 Compile Error
Post by: spflanze on May 02, 2019, 06:34:27 am
Following the directions at:
http://wiki.codeblocks.org/index.php/Installing_Code::Blocks_from_source_on_Windows

I removed the C:\TDM-GCC-64\bin; path from Windows 7 PATH variable. I added the paths C:\MinGW\bin;C:\MinGW\mingw32\bin;
I attempted to compile wxWidgets 2.8.12 so that I could compile the latest SVN version of Code::Blocks.

I executed this command sequence in Windows 7's cmd.exe terminal emulator:
Code
cd C:\wxMSW-2.8.12\build\msw
mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1  clean
mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1

The compilation ended with this error:
Code
process_begin: CreateProcess(NULL, g++ -c -o gcc_mswudll\monodll_dummy.o -O2 -mt
hreads -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -I..\..\lib\gcc_dll\mswu
-I..\..\include -W -Wall -DWXBUILDING -I..\..\src\tiff -I..\..\src\jpeg -I..\..\
src\png -I..\..\src\zlib -I..\..\src\regex -I..\..\src\expat\lib -DwxUSE_BASE=1
-DWXMAKINGDLL -Wno-ctor-dtor-privacy -MTgcc_mswudll\monodll_dummy.o -MFgcc_mswud
ll\monodll_dummy.o.d -MD -MP ../../src/common/dummy.cpp, ...) failed.
make (e=2): The system cannot find the file specified.
makefile.gcc:4717: recipe for target 'gcc_mswudll\monodll_dummy.o' failed
mingw32-make: *** [gcc_mswudll\monodll_dummy.o] Error 2

Where did this go wrong?
Title: Re: wxWidgets 2.8.12 Compile Error
Post by: Miguel Gimenez on May 02, 2019, 01:57:12 pm
This happened to me some years ago. IIRC this CreateProcess issue occurs only when you are mixing MSYS and CMD environments. Also recheck your path (you can remove C:\MinGW\mingw32\bin). When changing the path (in the desktop) you must close and reopen the CMD window for the change to take effect.
Title: Re: wxWidgets 2.8.12 Compile Error
Post by: spflanze on May 03, 2019, 03:51:08 am
I was using CMD aka Window 7's terminal emulator. So I tried it in MSYS. In the MSYS terminal emulator I did this command sequences:
Code
export PATH=$PATH:/c/MinGW/bin;
export PATH=$PATH:/c/MinGW/mingw32/bin;
cd C:/wxMSW-2.8.12/build/msw
mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1  clean
mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1

Compilation terminated with the same error.
Title: Re: wxWidgets 2.8.12 Compile Error
Post by: stahta01 on May 03, 2019, 04:42:17 am
Have you verified the "g++" command exists?

Tim S.
Title: Re: wxWidgets 2.8.12 Compile Error
Post by: spflanze on May 03, 2019, 05:36:53 am
The command:
Code
g++ --help
gets the expected response. The error it terminates on appears after many successful executions of the g++ command. So for sure it does exist.

From what I can interpret of the error message there is a file it seems to expect named  dummy.cpp that it cannot find.
Title: Re: wxWidgets 2.8.12 Compile Error
Post by: sodev on May 03, 2019, 05:57:39 am
The Makefiles have a long outstanding bug that they cant create the required directory structure in the output directory, you have to create it yourself. Out of memory it should be something like mswu[d]\wx\msw in the lib and dll output directory.

Also is there any specific reason why you compile that ancient wxWidgets version?
Title: Re: wxWidgets 2.8.12 Compile Error
Post by: spflanze on May 04, 2019, 02:31:11 am
I want to compile the ancient wxWidgets version so I can compile a 64 bit Code::Blocks. I decided I should compile a 32 bit version before the additional complication 64 bits.
Title: Re: wxWidgets 2.8.12 Compile Error
Post by: stahta01 on May 04, 2019, 03:55:55 am
I want to compile the ancient wxWidgets version so I can compile a 64 bit Code::Blocks. I decided I should compile a 32 bit version before the additional complication 64 bits.

So, you are wasting your time. Note: wxWidgets 2.8.12 is only 32 bit under Windows OS.

NOTE: It is easier to build 64 bit apps than it is to build 32 bit apps.

Tim S.
Title: Re: wxWidgets 2.8.12 Compile Error
Post by: spflanze on May 04, 2019, 05:21:05 am
I chose wxWidgets 2.8.12 because that is what Code::Blocks 17.12 (the current stable release) was built with.

Can Code::Blocks be built with a more recent version of wxWidgets, and one with which a 64 bit version of Code::Blocks can be built?

What version of wxWidgets are the Code::Blocks nightly builds being built with?
Title: Re: wxWidgets 2.8.12 Compile Error
Post by: stahta01 on May 04, 2019, 05:46:03 am
http://forums.codeblocks.org/index.php/topic,3299.0.html (http://forums.codeblocks.org/index.php/topic,3299.0.html)
Title: Re: wxWidgets 2.8.12 Compile Error
Post by: BlueHazzard on May 05, 2019, 01:53:55 pm
I compiled wxWidgets endless times on windows and never had a message like this...
Do you have a mix of compilers in your PATH? PATH hygiene is very difficult today, because every compiler puts itself into it...
I for myself remove all compiler paths and add them manualy per cmd if i need to compile something...
Title: Re: wxWidgets 2.8.12 Compile Error
Post by: spflanze on May 07, 2019, 05:21:54 am
http://forums.codeblocks.org/index.php/topic,3299.0.html (http://forums.codeblocks.org/index.php/topic,3299.0.html)

I downloaded mingw-w64-install.exe from:
https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/installer/mingw-w64-install.exe/download

This installation file gives me several options for Version, Architecture, Threads, Exception, and Build revison.

For Version I set the latest version I saw on the page you provided the link for, which is 8.1.0.

For Architecture I set x86_64 because I desire to build a 64 bit Code::Blocks.

Build revision gives me only one choice, which is 0, so that is an easy choice.

I do not know what to choose in the Threads, and Exception, selection boxes. Should these be left at default?

The choices for Threads are posix, and win32. The default is posix.

The choices for Exception is seh, and sjlj. The default is seh.

My OS is a 64 Bit Windows 7.
Title: Re: wxWidgets 2.8.12 Compile Error
Post by: stahta01 on May 07, 2019, 05:43:13 am
64 bit normally uses seh for Exception so that is correct; no idea on threading which answer is best for building C::B or wxWidgets.

Tim S.
Title: Re: wxWidgets 2.8.12 Compile Error
Post by: spflanze on May 14, 2019, 06:55:34 am
I proceeded to install with the default options. After the current version of the dlls were copied to the same directory the codeblocks.exe was in, as instructed here:
http://forums.codeblocks.org/index.php?topic=3232.0
I got svn build rev 11628 released on 2019-04-16 working.

I downloaded the version codeblocks-code-r11687-trunk version from svn. In the Code::Blocks File dialog I went to that version's src directory and found these project files:
Code
CodeBlocks.cbp
CodeBlocks_wx30.cbp
CodeBlocks_wx30_64.cbp
CodeBlocks_wx30-unix.cbp
CodeBlocks_wx31.cbp
CodeBlocks_wx31_64.cbp
CodeBlocks-unix.cbp
and their associated workspaces of similar names.

I have 64 bit Windows 7, and I want to develop applications using wxWidgets 3.1.2. So that narrows the choices to:
Code
CodeBlocks.cbp
CodeBlocks_wx31_64.cbp
My initial inclination is to use CodeBlocks_wx31_64.cbp. But what is CodeBlocks.cbp there for?
Title: Re: wxWidgets 2.8.12 Compile Error
Post by: sodev on May 14, 2019, 08:15:59 am
These workspaces and project files are for building CodeBlocks itself and dont limit you what applications you can build with CodeBlocks (except the issues with the debugger which requires a matching architecture).

Luckily these days CodeBlocks works stable with wxWidgets 3.1.x (with my 2 patches that rot on the issue tracker even with all compatibility options disabled) so pick one of these. The untagged variant should be the wxWidgets 2.8 variant.
Title: Re: wxWidgets 2.8.12 Compile Error
Post by: Miguel Gimenez on May 14, 2019, 08:29:13 am
The CodeBlocks.cbp project uses wx2.8.12.
If you want to compile C::B with wx3.1.x you must use CodeBlocks_31.cbp or CodeBlocks_31_64.cbp (or the matching workspaces if you want the plugins).
The simplest option is compiling C::B with the same wxWidgets version you will use for your programs.

Beware if using wx3.1.2, you will get crashes with Code Completion if you don't patch wxWidgets.
Title: Re: wxWidgets 2.8.12 Compile Error
Post by: BlueHazzard on May 15, 2019, 05:49:13 pm
Quote
with my 2 patches that rot on the issue tracker
Sry, can you point to this patches?
Title: Re: wxWidgets 2.8.12 Compile Error
Post by: sodev on May 15, 2019, 08:36:31 pm
To compile without unsafe string conversions enabled (plus possible crash fix): https://sourceforge.net/p/codeblocks/tickets/687/ (https://sourceforge.net/p/codeblocks/tickets/687/)
To compile without wx 3.0 compatibility enabled (or always in newer revisions, can't remember): https://sourceforge.net/p/codeblocks/tickets/704/ (https://sourceforge.net/p/codeblocks/tickets/704/)
Title: Re: wxWidgets 2.8.12 Compile Error
Post by: BlueHazzard on May 16, 2019, 08:44:42 am
To compile without unsafe string conversions enabled (plus possible crash fix): https://sourceforge.net/p/codeblocks/tickets/687/ (https://sourceforge.net/p/codeblocks/tickets/687/)
To compile without wx 3.0 compatibility enabled (or always in newer revisions, can't remember): https://sourceforge.net/p/codeblocks/tickets/704/ (https://sourceforge.net/p/codeblocks/tickets/704/)
Thank you... Will look into them as soon as my new compiler setup is ready