User forums > Help

Compiled wxWidgets executables will not run.

(1/3) > >>

jon4514:
All,


I successfully compiled wxWidgets and pointed Code::Blocks to the appropriate directories.  Using the wizard, I then created the simple example wxWidgets program.  The program compiles without error or warning using the default wizard settings.

When executing the program, windows says that the wxWdigets dll is a "invalid windows image."  Does anyone know what could be the cause of this?  I have tried recompiling everything but the error keeps occurring.

I may have done something stupid as this was my first time using wxWidgets with Code::Blocks in windows.

I am using:
-code::blocks nightly build revision 3803
-wxWidgets 2.8.5 with the following build command: mingw32-make.exe -f makefile.gcc USE_XRC=1    SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1
-wxWigets was compiled using:
GNU Make 3.81
gcc version 4.2.1-dw2 (mingw32-2)
-Operating system: Windows XP Pro Tablet Edition

Thanks in advance,
Jonathan

stahta01:
wxWidgets 2.8.5 has issues, so might wish to try 2.8.4 or if you wish to try the pre-released 2.8.6.

I have no idea if dw2 can cause issues, but I think you would need to compile both wxWidgets and your project using dw2 for it to have a chance to work right. If they are not the same issues WILL likely happen.

Tim S

My test results
Good with C::B SVN 3803, wxWidgets 2.8.6, compiled by MinGW 3.4.5 and Project compiled by MinGW 3.4.5
Good with C::B SVN 3803, wxWidgets 2.8.6, compiled by MinGW 3.4.5 and Project compiled by MinGW 4.2.1-sjlj
Good with C::B SVN 3803, wxWidgets 2.8.6, compiled by MinGW 3.4.5 and Project compiled by MinGW 4.2.1-dw2-2
Good with C::B SVN 3803, wxWidgets 2.8.5, compiled by MinGW 3.4.5 and Project compiled by MinGW 4.2.1-dw2-2

I do not see the problem with the default wxWidgets code, so done testing.

stahta01:
How sure are you that your minGW installation was done correctly?

My Bat to report on MinGW Installation "version-of-mingw.bat"

--- Code: ---@echo off
REM credit to Peter Ward work in ReactOS Build Environment RosBE.cmd it gave me a starting point that I edited.
::
:: Display the current version of GCC, ld, make and others.
::

REM %CD% works in Windows XP, not sure when it was added to Windows
REM set MINGWBASEDIR=C:\MinGW
set MINGWBASEDIR=%CD%
ECHO MINGWBASEDIR=%MINGWBASEDIR%
SET PATH=%MINGWBASEDIR%\bin;%SystemRoot%\system32
if exist %MINGWBASEDIR%\bin\gcc.exe (gcc -v 2>&1 | find "gcc version")
if exist %MINGWBASEDIR%\bin\gcc-dw2.exe (gcc-dw2.exe -v 2>&1 | find "gcc version")
if exist %MINGWBASEDIR%\bin\gcc-sjlj.exe (gcc-sjlj.exe -v 2>&1 | find "gcc version")
if exist %MINGWBASEDIR%\bin\nasm.exe (nasm -v)
if exist %MINGWBASEDIR%\bin\ld.exe (ld -v)
if exist %MINGWBASEDIR%\bin\windres.exe (windres --version | find "GNU windres")
if exist %MINGWBASEDIR%\bin\dlltool.exe (dlltool --version | find "GNU dlltool")
if exist %MINGWBASEDIR%\bin\pexports.exe (pexports | find "PExports" )
if exist %MINGWBASEDIR%\bin\mingw32-make.exe (mingw32-make -v | find "GNU Make")
if exist %MINGWBASEDIR%\bin\make.exe (ECHO It is not recommended to have make.exe in mingw/bin)
REM ECHO "The minGW runtime version is the same as __MINGW32_VERSION"
if exist "%MINGWBASEDIR%\include\_mingw.h" (type "%MINGWBASEDIR%\include\_mingw.h" | find "__MINGW32_VERSION" | find "#define")
if exist "%MINGWBASEDIR%\include\w32api.h" (type "%MINGWBASEDIR%\include\w32api.h" | find "__W32API_VERSION")

PAUSE

--- End code ---

My results


--- Code: ---MINGWBASEDIR=C:\Apps\MinGW_GCC4
gcc version 4.2.1-sjlj (mingw32-2)
gcc version 4.2.1-dw2 (mingw32-2)
gcc version 4.2.1-sjlj (mingw32-2)
GNU ld version 2.17.50 20060824
GNU windres 2.17.50 20060824
GNU dlltool 2.17.50 20060824
GNU Make 3.81
#define __MINGW32_VERSION 3.13
#define __W32API_VERSION 3.10
Press any key to continue . . .

--- End code ---

eckard_klotz:
Hello Jonathan.

I have also some problems to run a wxWidgets application build with code::blocks. I use the wxWidgets 2.8.4 devpak from here http://devpaks.org/. installed with the original devpak-tool. I also get no errors or warnings. But if I use wxTextCtrl, the program ends with an abnormal termination (on WinXP).

If I compile the same program with wxDevC++ (http://wxdsgn.sourceforge.net/) everything works fine. So may be this is a good opportunity to check if your problem is coursed by your source, the wxWidgets-library or by the IDE.

I think for my problem the course is a wrong setup of the project in C::B. But until now I didn't found out what it is.

Regards,
              Eckard Klotz.

Biplab:

--- Quote from: eckard_klotz on September 28, 2007, 08:43:53 am ---If I compile the same program with wxDevC++ (http://wxdsgn.sourceforge.net/) everything works fine. So may be this is a good opportunity to check if your problem is coursed by your source, the wxWidgets-library or by the IDE.

--- End quote ---

You should remember one point. Your IDE is not responsible for your good or bad program. IDEs are interface to the compilers and it solely depends on the users how they drive the compiler through IDE. So if you use garbage settings, you'll get a garbage output (exe file in this case).

If I remember correctly, wxDevC++ comes with GCC-3.4.2 (MinGW build). Your program works with it as this compiler is pretty old and people are already aware of it's shortcomings and problems; and they consider these problems while writing a library such as wx. Thus you don't face much problem with it.


--- Quote from: jon4514 on September 27, 2007, 08:31:08 pm ---I am using:
-code::blocks nightly build revision 3803
-wxWidgets 2.8.5 with the following build command: mingw32-make.exe -f makefile.gcc USE_XRC=1    SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1
-wxWigets was compiled using:
GNU Make 3.81
gcc version 4.2.1-dw2 (mingw32-2)
-Operating system: Windows XP Pro Tablet Edition

--- End quote ---

Downgrade your compiler to GCC-3.4.5 and then clean compile wx and your project. It should work then. Please note that GCC-4.2.1 is a technology preview release not a stable one and you may encounter many unknown problems with it.

Navigation

[0] Message Index

[#] Next page

Go to full version