wxWidgets / wxWidgets

Cross-Platform C++ GUI Library
https://www.wxwidgets.org/
6.17k stars 1.77k forks source link

Build Windows 32bit application by TDM-GCC-64 & option "-m32" that always generates error 0xc000007b #16917

Open wxtrac opened 9 years ago

wxtrac commented 9 years ago

Issue migrated from trac ticket # 16917

component: build | priority: low

2015-03-20 13:13:24: chunjiu (Chun Jiu) created the issue


Windows 7 64bit Pro (Chinese) CPU Intel : T9800 & Xeon E5440 respectively on two computers.

The compilation process was successful, but using this dynamic link library connected applications at runtime always report an error: 0xc000007b. Even these samples in wxWidgets source package also have this runtime error.

If the application is placed to run under Windows 32bit, will produce the following error:

"The application has failed to start because its side-by-side configuration is in correct. Please see the application event log or use the command-line sxstrace.exe tool for more detail."


Tried to compile:

  1. mingw32-make -f makefile.gcc CFG=_m32 CFLAGS="-m32" CXXFLAGS="-m32 -std=gnu++11" LDFLAGS="-m32" WINDRES="windres --target=pe-i386 --use-temp-file" MONOLITHIC=1 SHARED=1 UNICODE=1 BUILD=release USE_OPENGL=1 USE_QA=1 VENDOR=m32

  2. mingw32-make -f makefile.gcc CFG=_m32 BUILD=release UNICODE=1 SHARED=1 MONOLITHIC=1 CXXFLAGS="-m32 -std=gnu++11 -fno-keep-inline-dllexport" CPP="gcc -E -D_M_IX86" LDFLAGS="-m32" CPPFLAGS="-m32" WINDRES="windres --use-temp-file -F pe-i386"


The resulting file for compile 1:

rcdefs.h

1 "..\..\include\wx\msw\genrcdefs.h"

1 ""

1 ""

1 "..\..\include\wx\msw\genrcdefs.h"

11 "..\..\include\wx\msw\genrcdefs.h"

ifndef _WX_RCDEFS_H

define _WX_RCDEFS_H

define wxUSE_RC_MANIFEST 1

35 "..\..\include\wx\msw\genrcdefs.h"

define WX_CPU_X86

46 "..\..\include\wx\msw\genrcdefs.h"

endif


The resulting file for compile 2:

1 "..\..\include\wx\msw\genrcdefs.h"

1 ""

1 ""

1 "..\..\include\wx\msw\genrcdefs.h"

11 "..\..\include\wx\msw\genrcdefs.h"

ifndef _WX_RCDEFS_H

define _WX_RCDEFS_H

define wxUSE_RC_MANIFEST 1

define WX_CPU_AMD64

35 "..\..\include\wx\msw\genrcdefs.h"

define WX_CPU_X86

46 "..\..\include\wx\msw\genrcdefs.h"

endif

wxtrac commented 9 years ago

2015-03-20 13:20:35: @vadz changed priority from normal to low

2015-03-20 13:20:35: @vadz changed status from new to infoneeded_new

2015-03-20 13:20:35: @vadz commented

I don't understand at all what are you trying to do here, why use -m32 option instead of just using the 32 bit TDM compiler which works perfectly well?

Anyhow, did you check that this actually produced 32 bit DLLs? Perhaps 64 bit DLLs were built in spite of -m32?

And if not, i.e. if it's a real SxS problem, then you need to use sxstrace (quick web search will find many articles explaining in more details how to do it). Please do it and find out what the problem is exactly.

wxtrac commented 9 years ago

2015-03-23 05:38:37: chunjiu (Chun Jiu) changed status from infoneeded_new to new

2015-03-23 05:38:37: chunjiu (Chun Jiu) commented

I think under Windows64 simultaneously with a single compiler to build Win32 and Win64 applications.The compiler is TDM-GCC-64.

When using wxWidgets 3.0.2 encountered a problem, this problem does not exist inside wxWidgets 2.8.12.

After attempts to find solutions and to seek help, the problem is under 64bit compiler can not resolve.

Now the only solution is to install two sets of compiler. So I reported the problem, because it feels very convenient.

I do not know for SxS problem,will try, but do not necessarily solve the problem.

wxtrac commented 9 years ago

2015-03-23 17:32:40: @vadz commented


I agree that it is nice to use the single compiler to build both 32 and 64 bit binaries and would like to support it. I don't have time to debug this myself however, so at the very least please answer the questions from the comment:1, i.e. check that the binaries are of correct bitness and whether sxstrace gives any clues.

TIA!