Page 1 of 1

Help: Cannot get wxWidgets to run with CodeLite

Posted: Tue May 24, 2016 8:03 am
by TrustSeg
Sitting the entire damn day, compiling and compiling and compiling... I'm trying to run CodeLite + MinGW + wxWidgets, but I can't compile the damn wxWidgets correctly to use them in CodeLite. Either lx.exe is crashing when compiling wxWidgets or the procedure entry point for something something could not be found in the DLL or if I manage to compile wxWidgets successfully, just nothing happens at all when the application is executed (it just exits).

There are some old step-by-step tutorials on the net, but all of them point to older versions of CodeLite on the page http://downloads.codelite.org/, which seems to have contained a bundled version with everything in it in the past. But now there is only the download for CodeLite.

Used:
- CodeLite 9.1.0 (Windows Installer 64-bit). Also tried 9.1.7. Direct link: http://downloads.codelite.org/downloads ... _weekly_64
- TDM GCC 5.1.0 (Windows Installer 64-bit). Direkt link: http://sourceforge.net/projects/tdm-gcc ... e/download
- wxWidgets 3.1.0 (Windows Installer) https://github.com/wxWidgets/wxWidgets/ ... -Setup.exe

My step-by-step procedure at Windows 10:
1. Installing CodeLite to "C:\CodeLight\"
2. Installing MinGW (TDM GCC) to "C:\TDM-GCC-64\"
3. Installing wxWidgets
..3.1. Path "C:\TDM-GCC-64\bin" is in "Path" environment variable
..3.2. Adding environment variables "WXCFG"="gcc_dll\mswu" and "WXWIN"="C:\wxWidgets-3.1.0"
..3.3. Installing wxWidgets to "C:\wxWidgets-3.1.0\"
..3.4. Building RELEASE version of wxWidgets
....3.4.1. CMD>cd C:\wxWidgets-3.1.0\build\msw
....3.4.2. CMD>mingw32-make -f makefile.gcc setup_h
....3.4.3. Open "C:\wxWidgets-3.1.0\lib\gcc_lib\mswud\wx\setup.h" and change line "# define wxUSE_GRAPHICS_CONTEXT 0" to "# define wxUSE_GRAPHICS_CONTEXT 1"
....3.4.4. CMD>mkdir ..\..\lib\gcc_dll\mswu\wx\ (not mentioned in Tutorial...)
....3.4.5. CMD>copy ..\..\include\wx\msw\setup.h ..\..\lib\gcc_dll\mswu\wx\setup.h (not mentioned in Tutorial...)
....3.4.6. Open "C:\wxWidgets-3.1.0\lib\gcc_dll\mswu\wx\setup.h" and change line "# define wxUSE_GRAPHICS_CONTEXT 0" to "# define wxUSE_GRAPHICS_CONTEXT 1"
....3.4.7. CMD>mingw32-make -j8 -f Makefile.gcc SHARED=1 UNICODE=1 BUILD=release VENDOR=cl CXXFLAGS="-fno-keep-inline-dllexport -std=c++11" MONOLITHIC=1
..3.5. Added "WXCFG"="gcc_dll\mswu" and "WXWIN"="C:\wxWidgets-3.1.0" in CodeLite in menu "Settings -> Environment Variables"

Two DLL files are created in the folder X: http://www.filedropper.com/gccdll
Here are the last lines of the build output (sorry, it seems to be cut off): http://filebin.ca/2iDHko0cOHrY/build_log.txt

Now I followed the tutorial for the Hello world example (link) - just as a test to build a wxWidgets app correctly.

Output is:

Code: Select all

Current working directory: C:\Users\Stan\Documents\CodeLite\MyProjects\Tests\test001\Debug
Running program: ./test001
Program exited with return code: -1073740940
Build log of test project: [see attached file].
Test project: [see attached file].

Problem: Nothing happens. I see no window. Program starts and exits after a couple of seconds. Can someone help me please?

Re: Help: Cannot get wxWidgets to run with CodeLite

Posted: Tue May 24, 2016 11:41 am
by eranif
Did you add the wxWidgets DLLs folder to the path environment variable?

Eran

Re: Help: Cannot get wxWidgets to run with CodeLite

Posted: Sat May 28, 2016 1:48 am
by TrustSeg
Yes, I did. Still the same problem. :(

Re: Help: Cannot get wxWidgets to run with CodeLite

Posted: Sat May 28, 2016 8:47 am
by eranif
Try running your executable from outside of CodeLite. This usually gives more information
Eran