Page 1 of 1

Cannot get wxWidgets to compile

Posted: Tue Oct 03, 2017 4:27 am
by rgarnett
Hi,

I can't get C++ app working with wxWidgets

I am running:

Codelite 10.0.7, Not self compiler; (Prebuilt windows installer version download: codelite-amd64-10.0.7)
OS: Windows 10 Professional 64 bit
Compiler Version: tdm64-gcc-5.1.0-2
GDB 7.9 Series

Please see readme files from the C:\TDM-GCC-64 directory.

wxWidgets installed using download wxMSW-3.1.0-Setup.exe into directory C:\MyProgramFiles\wxWidgets.

Set the environment variables thus:

CodeLiteDir=C:\Program Files\CodeLite
WXWIN=C:\MyProgramFiles\wxWidgets
WXCFG=gcc_dll\mswu


Compiled program and got the following output:

C:\WINDOWS\system32\cmd.exe /C C:/TDM-GCC-64/bin/mingw32-make.exe -j16 SHELL=cmd.exe -e -f Makefile
"----------Building project:[ testGetNextMinutes - Debug ]----------"

Please use the --wxcfg flag (as in wx-config --wxcfg=gcc_dll/mswud)
or set the environment variable WXCFG (as in WXCFG=gcc_dll/mswud)
to specify which configuration exactly you want to use.

Please use the --wxcfg flag (as in wx-config --wxcfg=gcc_dll/mswud)
or set the environment variable WXCFG (as in WXCFG=gcc_dll/mswud)
to specify which configuration exactly you want to use.

Please use the --wxcfg flag (as in wx-config --wxcfg=gcc_dll/mswud)
or set the environment variable WXCFG (as in WXCFG=gcc_dll/mswud)
to specify which configuration exactly you want to use.
mingw32-make.exe[1]: Entering directory 'G:/UserRJG/DocsRJG/rjgWrkSpace/testGetNextMinutes'
g++.exe: error: wx-config: No such file or directory
g++.exe: error: Error:: Invalid argument
g++.exe: error: No: No such file or directory
g++.exe: error: valid: No such file or directory
g++.exe: error: setup.h: No such file or directory
g++.exe: error: of: No such file or directory
g++.exe: error: wxWidgets: No such file or directory
g++.exe: error: has: No such file or directory
g++.exe: error: been: No such file or directory
g++.exe: error: found: No such file or directory
g++.exe: error: at: No such file or directory
g++.exe: error: location:: Invalid argument
g++.exe: error: C:/MyProgramFiles/wxWidgets/lib/gcc_dll\mswu/wx/setup.h: No such file or directory
g++.exe: error: wx-config: No such file or directory
g++.exe: error: Error:: Invalid argument
g++.exe: error: No: No such file or directory
g++.exe: error: valid: No such file or directory
g++.exe: error: setup.h: No such file or directory
g++.exe: error: of: No such file or directory
g++.exe: error: wxWidgets: No such file or directory
g++.exe: error: has: No such file or directory
g++.exe: error: been: No such file or directory
g++.exe: error: found: No such file or directory
g++.exe: error: at: No such file or directory
g++.exe: error: location:: Invalid argument
g++.exe: error: C:/MyProgramFiles/wxWidgets/lib/gcc_dll\mswu/wx/setup.h: No such file or directory
g++.exe: error: wx-config: No such file or directory
g++.exe: error: Error:: Invalid argument
g++.exe: error: No: No such file or directory
g++.exe: error: valid: No such file or directory
g++.exe: error: setup.h: No such file or directory
g++.exe: error: of: No such file or directory
g++.exe: error: wxWidgets: No such file or directory
g++.exe: error: has: No such file or directory
g++.exe: error: been: No such file or directory
g++.exe: error: found: No such file or directory
g++.exe: error: at: No such file or directory
g++.exe: error: location:: Invalid argument
g++.exe: error: C:/MyProgramFiles/wxWidgets/lib/gcc_dll\mswu/wx/setup.h: No such file or directory
g++.exe: error: wx-config: No such file or directory
mingw32-make.exe[1]: *** [Debug/main.cpp.o.d] Error 1
g++.exe: error: Error:: Invalid argument
g++.exe: error: No: No such file or directory
g++.exe: error: valid: No such file or directory
g++.exe: error: setup.h: No such file or directory
mingw32-make.exe[1]: *** Waiting for unfinished jobs....
g++.exe: error: of: No such file or directory
g++.exe: error: wxWidgets: No such file or directory
g++.exe: error: has: No such file or directory
g++.exe: error: been: No such file or directory
g++.exe: error: found: No such file or directory
g++.exe: error: at: No such file or directory
g++.exe: error: location:: Invalid argument
mingw32-make.exe[1]: *** [Debug/wxcrafter.cpp.o.d] Error 1
g++.exe: error: C:/MyProgramFiles/wxWidgets/lib/gcc_dll\mswu/wx/setup.h: No such file or directory
C:/TDM-GCC-64/bin/windres.exe -i "G:/UserRJG/DocsRJG/rjgWrkSpace/testGetNextMinutes/win_resources.rc" wx-config Error: No valid setup.h of wxWidgets has been found at location: C:/MyProgramFiles/wxWidgets/lib/gcc_dll\mswu/wx/setup.h -o ./Debug/win_resources.rc.o
testGetNextMinutes.mk:101: recipe for target 'Debug/main.cpp.o.d' failed
testGetNextMinutes.mk:109: recipe for target 'Debug/wxcrafter.cpp.o.d' failed
mingw32-make.exe[1]: *** [Debug/wxcrafter_bitmaps.cpp.o.d] Error 1
mingw32-make.exe[1]: *** [Debug/MainDialog.cpp.o.d] Error 1
testGetNextMinutes.mk:117: recipe for target 'Debug/wxcrafter_bitmaps.cpp.o.d' failed
testGetNextMinutes.mk:125: recipe for target 'Debug/MainDialog.cpp.o.d' failed
Usage: C:/TDM-GCC-64/bin/windres.exe [option(s)] [input-file] [output-file]
The options are:
-i --input=<file> Name input file
-o --output=<file> Name output file
-J --input-format=<format> Specify input format
-O --output-format=<format> Specify output format
-F --target=<target> Specify COFF target
--preprocessor=<program> Program to use to preprocess rc file
--preprocessor-arg=<arg> Additional preprocessor argument
-I --include-dir=<dir> Include directory when preprocessing rc file
-D --define <sym>[=<val>] Define SYM when preprocessing rc file
-U --undefine <sym> Undefine SYM when preprocessing rc file
-v --verbose Verbose - tells you what it's doing
-c --codepage=<codepage> Specify default codepage
-l --language=<val> Set language when reading rc file
--use-temp-file Use a temporary file instead of popen to read
the preprocessor output
--no-use-temp-file Use popen (default)
-r Ignored for compatibility with rc
@<file> Read options from <file>
-h --help Print this help message
-V --version Print version information
FORMAT is one of rc, res, or coff, and is deduced from the file name
extension if not specified. A single file name is an input file.
No input-file is stdin, default rc. No output-file is stdout, default rc.
C:/TDM-GCC-64/bin/windres.exe: supported targets: pe-x86-64 pei-x86-64 pe-bigobj-x86-64 elf64-x86-64 elf64-l1om elf64-k1om pe-i386 pei-i386 elf32-i386 elf64-little elf64-big elf32-little elf32-big plugin srec symbolsrec verilog tekhex binary ihex
mingw32-make.exe[1]: *** [Debug/win_resources.rc.o] Error 1
testGetNextMinutes.mk:131: recipe for target 'Debug/win_resources.rc.o' failed
mingw32-make.exe[1]: Leaving directory 'G:/UserRJG/DocsRJG/rjgWrkSpace/testGetNextMinutes'
mingw32-make.exe: *** [All] Error 2
Makefile:4: recipe for target 'All' failed
====1 errors, 0 warnings====


It then occured to me to see if there was a directory gcc_dll\mswu under c:\wxWidgets\lib. There was not.

So I downloaded wxMSW-3.1.0_gcc492TDM_Dev.7z which had a directory gcc492TDM_x64_dll\mswu which seemed like a reasonable candidate. I extracted this into the wxWidgets directory thus: C:\MyProgramFiles\wxWidgets\lib\gcc492TDM_x64_dll\. This provided, or so I thought, the neccessary C:\MyProgramFiles\wxWidgets\lib\gcc492TDM_x64_dll\mswu\wx\setup.h.

I changed the environment settings to:

CodeLiteDir=C:\Program Files\CodeLite
WXWIN=C:\MyProgramFiles\wxWidgets
WXCFG=gcc492TDM_x64_dll\mswud

Closed Codelite, reopened it and tried to compile. Again errors:

C:\WINDOWS\system32\cmd.exe /C C:/TDM-GCC-64/bin/mingw32-make.exe -j16 SHELL=cmd.exe -e -f Makefile
"----------Building project:[ testGetNextMinutes - Debug ]----------"

The specified wxcfg must start with a 'gcc_', 'dmc_' or 'vc_'
to be successfully detected.

The specified wxcfg must start with a 'gcc_', 'dmc_' or 'vc_'
to be successfully detected.

The specified wxcfg must start with a 'gcc_', 'dmc_' or 'vc_'
to be successfully detected.
mingw32-make.exe[1]: Entering directory 'G:/UserRJG/DocsRJG/rjgWrkSpace/testGetNextMinutes'
g++.exe: error: wx-config: No such file or directory
g++.exe: error: Error:: Invalid argument
g++.exe: error: No: No such file or directory
g++.exe: error: supported: No such file or directory
g++.exe: error: compiler: No such file or directory
g++.exe: error: has: No such file or directory
g++.exe: error: been: No such file or directory
g++.exe: error: detected: No such file or directory
g++.exe: error: in: No such file or directory
g++.exe: error: the: No such file or directory
g++.exe: error: configuration: No such file or directory
g++.exe: error: gcc492TDM_x64_dll\mswud.: No such file or directory
g++.exe: error: wx-config: No such file or directory
g++.exe: error: Error:: Invalid argument
g++.exe: error: No: No such file or directory
g++.exe: error: supported: No such file or directory
g++.exe: error: compiler: No such file or directory
g++.exe: error: has: No such file or directory
g++.exe: error: been: No such file or directory
g++.exe: error: detected: No such file or directory
g++.exe: error: in: No such file or directory
g++.exe: error: the: No such file or directory
g++.exe: error: configuration: No such file or directory
g++.exe: error: gcc492TDM_x64_dll\mswud.: No such file or directory
g++.exe: error: wx-config: No such file or directory
g++.exe: error: Error:: Invalid argument
g++.exe: error: No: No such file or directory
g++.exe: error: supported: No such file or directory
g++.exe: error: compiler: No such file or directory
g++.exe: error: has: No such file or directory
g++.exe: error: been: No such file or directory
g++.exe: error: detected: No such file or directory
g++.exe: error: in: No such file or directory
g++.exe: error: the: No such file or directory
g++.exe: error: configuration: No such file or directory
g++.exe: error: gcc492TDM_x64_dll\mswud.: No such file or directory
C:/TDM-GCC-64/bin/windres.exe -i "G:/UserRJG/DocsRJG/rjgWrkSpace/testGetNextMinutes/win_resources.rc" wx-config Error: No supported compiler has been detected in the configuration 'gcc492TDM_x64_dll\mswud'. -o ./Debug/win_resources.rc.o
mingw32-make.exe[1]: *** [Debug/main.cpp.o.d] Error 1
mingw32-make.exe[1]: *** Waiting for unfinished jobs....
g++.exe: error: wx-config: No such file or directory
g++.exe: error: Error:: Invalid argument
mingw32-make.exe[1]: *** [Debug/wxcrafter.cpp.o.d] Error 1
g++.exe: error: No: No such file or directory
g++.exe: error: supported: No such file or directory
g++.exe: error: compiler: No such file or directory
g++.exe: error: has: No such file or directory
g++.exe: error: been: No such file or directory
g++.exe: error: detected: No such file or directory
g++.exe: error: in: No such file or directory
g++.exe: error: the: No such file or directory
g++.exe: error: configuration: No such file or directory
g++.exe: error: gcc492TDM_x64_dll\mswud.: No such file or directory
mingw32-make.exe[1]: *** [Debug/wxcrafter_bitmaps.cpp.o.d] Error 1
mingw32-make.exe[1]: *** [Debug/MainDialog.cpp.o.d] Error 1
testGetNextMinutes.mk:101: recipe for target 'Debug/main.cpp.o.d' failed
testGetNextMinutes.mk:109: recipe for target 'Debug/wxcrafter.cpp.o.d' failed
testGetNextMinutes.mk:117: recipe for target 'Debug/wxcrafter_bitmaps.cpp.o.d' failed
testGetNextMinutes.mk:125: recipe for target 'Debug/MainDialog.cpp.o.d' failed
Usage: C:/TDM-GCC-64/bin/windres.exe [option(s)] [input-file] [output-file]
The options are:
-i --input=<file> Name input file
-o --output=<file> Name output file
-J --input-format=<format> Specify input format
-O --output-format=<format> Specify output format
-F --target=<target> Specify COFF target
--preprocessor=<program> Program to use to preprocess rc file
--preprocessor-arg=<arg> Additional preprocessor argument
-I --include-dir=<dir> Include directory when preprocessing rc file
-D --define <sym>[=<val>] Define SYM when preprocessing rc file
-U --undefine <sym> Undefine SYM when preprocessing rc file
-v --verbose Verbose - tells you what it's doing
-c --codepage=<codepage> Specify default codepage
-l --language=<val> Set language when reading rc file
--use-temp-file Use a temporary file instead of popen to read
the preprocessor output
--no-use-temp-file Use popen (default)
-r Ignored for compatibility with rc
@<file> Read options from <file>
-h --help Print this help message
-V --version Print version information
FORMAT is one of rc, res, or coff, and is deduced from the file name
extension if not specified. A single file name is an input file.
No input-file is stdin, default rc. No output-file is stdout, default rc.
C:/TDM-GCC-64/bin/windres.exe: supported targets: pe-x86-64 pei-x86-64 pe-bigobj-x86-64 elf64-x86-64 elf64-l1om elf64-k1om pe-i386 pei-i386 elf32-i386 elf64-little elf64-big elf32-little elf32-big plugin srec symbolsrec verilog tekhex binary ihex
mingw32-make.exe[1]: *** [Debug/win_resources.rc.o] Error 1
testGetNextMinutes.mk:131: recipe for target 'Debug/win_resources.rc.o' failed
mingw32-make.exe[1]: Leaving directory 'G:/UserRJG/DocsRJG/rjgWrkSpace/testGetNextMinutes'
mingw32-make.exe: *** [All] Error 2
Makefile:4: recipe for target 'All' failed
====1 errors, 0 warnings====


I have spent two days on this trying to get it to work. I have had no trouble with console apps they work great, but I really need to get the GUI bizzo working.

The problem is there are no clear instructions on what wxWidgets downloads I should use, whether I need to compile wxWidgets myself and what really needs to go in the environment variables.

I have spent a lot of time googling to find the answer and have found a lot of references to the problem so I'm not alone in this, but I haven't found a solution.

I really like Codelite and want to use it as my standard C++ IDE, but without GUI development I will have to go back to Visual Studio which is horrible,

Please help.

Regards

Rob

Re: Cannot get wxWidgets to compile

Posted: Tue Oct 03, 2017 8:09 am
by eranif
Did you read the error message? it says this:
"C:/MyProgramFiles/wxWidgets/lib/gcc_dll\mswu/wx/setup.h": No such file or directory
Do you have this file? When you installed wxWidgets you need to make sure you install the correct setup (DLL, debug and release) - because this is what you are telling wx-config to search for

Re: Cannot get wxWidgets to compile

Posted: Wed Oct 04, 2017 4:07 am
by rgarnett
With the extra little piece of the jigsaw I have worked it out.

To help others I will explain what I did:

OS = Windows 10 64 Bit
wxWidgets = Ver 3.1.0
Compiler = gcc Ver 5.1

1. Go to the wxWidgets download page https://github.com/wxWidgets/wxWidgets/ ... tag/v3.1.0
Scroll down to the list of downloads.

2. Download and install
wxMSW-3.1.0-Setup.exe
This is the main wxWidgets Program but it does not include the gcc_dll files

3. Download the files
wxMSW-3.1.0_gcc510TDM_x64_Dev.7z
and
wxMSW-3.1.0_gcc510TDM_x64_ReleaseDLL.7z

You need to pick the two that match the wxWidgets version and your compiler in my case I was using gcc 5.1 Of course you must download and install that compiler
if you want to use it.

4. Extract the gcc_ dll files from the
wxMSW-3.1.0_gcc510TDM_x64_Dev.7z
archive to
wxWidgets\lib
. This will create a subdirectory under lib called gcc510TDM_dll. Rename this directory to
gcc_dll
which is what codelite looks for. This will provide the developement system for debugging.

5. Extract the gcc dll files from the wxMSW-3.1.0_gcc510TDM_x64_ReleaseDLL.7z archive to the wxWidgets\lib directory and rename it to gcc510TDM_dll_release.

6. Set the environment variables in the Codelite IDE: Menu -> Settings->Environment Variables to:
CodeLiteDir=C:\Program Files\CodeLite
WXWIN=C:\wxWidgets-3.0.3
WXCFG=gcc_dll\mswud
7. Close and restart Codelite to load the environment variables.

8. Add the following paths to your system environment variables using Computer->Properties-Advanced-Environment Variables:
C:\TDM-GCC-64
C:\TDM-GCC-64\bin
C:\TDM-GCC-64\gdb64\bin
If you, like I experienced windows telling you your environment variable is too long append these paths then you can get out of trouble by creating nes variables and appending these viz
PATHGCC = C:\TDM-GCC-64;C:\TDM-GCC-64\bin;C:\TDM-GCC-64\gdb64\bin and append this to the the PATH variable using
%PATHGCC%
You may have to group a number of variables in this way. In may cases if you use python, python paths use up a lot of the available PATH characters so group them under a variable called
PATHPY27 or PATHPY30 or whatever.

I would recommend Rapid Environment Editor to take away the windows environment variable pain https://www.rapidee.com

9. Copy dll files from gcc_dll to the directory of the executable file

You may think you have finished, but no. Your program will compile, but it won't run as the gcc_dll files have not been registered. You will get an error dialog:

Debugger exited with the following error string: During Startup program exited with code 0xC0000135.

If you try and directly run your executable from explorer by double clicking you get the dialog: System Error: The program can't start because wxbase310ud_gcc510TDM_x64.dll is missing ...

That's what the first dialog was trying to tell you.

I tried registering the dll's using regsvr32, but I got the Microsoft finger. So in the end I threw in the towel and copied all of the DLL's into the executable directory.

I could then compile and run.

I am not sure how to use the release version of wzWidgets download. Of course if you want to use it you will need to name the gcc_dll directory to something like
gcc510TDM_dll_Dev
and rename the release directory to
gcc_dll
although I haven't tried this.

Hope this is useful.