User forums > General (but related to Code::Blocks)

[Solved] Code::Blocks and makefile: unexpected behaviour

(1/2) > >>

simac:
Hello everybody !
I'm trying to compile a wxWidgets Windows app with MinGW. To do this I'm using the makefile.gcc provided with the minimal sample.
When I compile the minimal example with
--- Code: ---mingw32-make -f makefile.gcc BUILD=release SHARED=1 UNICODE=1
--- End code ---
all work perfectly. However if I use Code::Blocks and configure the project to use the makefile (Build project/target:
--- Code: ---$make -f $makefile BUILD=release SHARED=1 UNICODE=1
--- End code ---
) the compilation work properly, but the program crashes when starting.
Moreover the objects files and the executables are different between the two ways. I can't find out a reason why.
Could you help me?

Thank you in advance,
Simac

stahta01:
Please look at the CB build log and see what differs.
http://wiki.codeblocks.org/index.php/FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F

simac:
That's a part of the problem: nothing differs. The build log is exactly the same with CB and the makefile:

With the makefile:
--- Code: ---windres --use-temp-file -i../../samples/sample.rc -ogcc_mswudll\minimal_sample_rc.o    --define __WXMSW__   --define NDEBUG    --define _UNICODE  --include-dir .\..\..\lib\gcc_dll\mswu --include-dir ./../../include  --include-dir . --define WXUSINGDLL --include-dir ./../../samples --define NOPCH
g++ -c -o gcc_mswudll\minimal_minimal.o  -O2 -mthreads  -DHAVE_W32API_H -D__WXMSW__   -DNDEBUG    -D_UNICODE  -I.\..\..\lib\gcc_dll\mswu -I.\..\..\include  -W -Wall -I. -DWXUSINGDLL -I.\..\..\samples -DNOPCH   -Wno-ctor-dtor-privacy   -s -MTgcc_mswudll\minimal_minimal.o -MFgcc_mswudll\minimal_minimal.o.d -MD -MP minimal.cpp
g++ -o gcc_mswudll\minimal.exe gcc_mswudll\minimal_sample_rc.o gcc_mswudll\minimal_minimal.o   -mthreads -L.\..\..\lib\gcc_dll -Wl,--subsystem,windows -mwindows    -lwxmsw30u_core  -lwxbase30u    -lwxtiff -lwxjpeg -lwxpng   -lwxzlib -lwxregexu -lwxexpat    -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32 -lwininet -s

--- End code ---

With CB:
--- Code: (html5) ---<html>
<head>
<title>minimal build log</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head>
<body>
<tt>
Build started on: <u>03-06-2017 at 17:11.03</u><br />
Build ended on: <u>03-06-2017 at 17:11.07</u><p />
<b>-------------- Build: release in minimal (compiler: GNU GCC Compiler)---------------</b><br />
mingw32-make.exe -f makefile.gcc BUILD=release SHARED=1 UNICODE=1 <br />
windres --use-temp-file -i../../samples/sample.rc -ogcc_mswudll\minimal_sample_rc.o    --define __WXMSW__   --define NDEBUG    --define _UNICODE  --include-dir .\..\..\lib\gcc_dll\mswu --include-dir ./../../include  --include-dir . --define WXUSINGDLL --include-dir ./../../samples --define NOPCH<br />
g++ -c -o gcc_mswudll\minimal_minimal.o  -O2 -mthreads  -DHAVE_W32API_H -D__WXMSW__   -DNDEBUG    -D_UNICODE  -I.\..\..\lib\gcc_dll\mswu -I.\..\..\include  -W -Wall -I. -DWXUSINGDLL -I.\..\..\samples -DNOPCH   -Wno-ctor-dtor-privacy   -s -MTgcc_mswudll\minimal_minimal.o -MFgcc_mswudll\minimal_minimal.o.d -MD -MP minimal.cpp<br />
g++ -o gcc_mswudll\minimal.exe gcc_mswudll\minimal_sample_rc.o gcc_mswudll\minimal_minimal.o   -mthreads -L.\..\..\lib\gcc_dll -Wl,--subsystem,windows -mwindows    -lwxmsw30u_core  -lwxbase30u    -lwxtiff -lwxjpeg -lwxpng   -lwxzlib -lwxregexu -lwxexpat    -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32 -lwininet -s<br />
<font color="#0000ff">Process terminated with status 0 (0 minute(s), 4 second(s))</font><br />
<font color="#0000ff">0 error(s), 0 warning(s) (0 minute(s), 4 second(s))</font><br />
</tt>
</body>
</html>

--- End code ---

It is very strange !

stahta01:
Since you posted an HTML file; I really did NOT look for differences.

But, if there is no difference the first thing to check is that you are using the exact same GCC Compiler/toolchain.

Tim S.
 

simac:
I checked the version of the compiler and it's the same with CB and the command line. I tried with a nighty-build version of CB and I've still got the problem.

Navigation

[0] Message Index

[#] Next page

Go to full version