I succeeded; I had a cut/paste error that I did NOT notice for about 2 hours.
Link to my draft instructions https://github.com/stahta01/cb_misc/blob/master/Notes/CB%20setup%20for%20MSys2%20wxWidgets.txt (https://github.com/stahta01/cb_misc/blob/master/Notes/CB%20setup%20for%20MSys2%20wxWidgets.txt)
Edit: I used "Compiler Custom Variables" for the two variables that needed to have forward slashes because I had issues when I tried either CB Global vars or Project Custom vars.
Edit2: Build log
-------------- Clean: Debug in wx30Msys2 (compiler: GNU GCC Compiler MSys2 MinGW64)---------------
Cleaned "wx30Msys2 - Debug"
-------------- Build: Debug in wx30Msys2 (compiler: GNU GCC Compiler MSys2 MinGW64)---------------
x86_64-w64-mingw32-g++.exe -Wall -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -g -IC:/Apps64/MSys2/mingw64/lib/wx/include/msw-unicode-3.0 -IC:/Apps64/MSys2/mingw64/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMSW__ -fpermissive -c C:/SourceCode/test/wx30Msys2/wx30Msys2App.cpp -o obj/Debug/wx30Msys2App.o
x86_64-w64-mingw32-g++.exe -Wall -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -g -IC:/Apps64/MSys2/mingw64/lib/wx/include/msw-unicode-3.0 -IC:/Apps64/MSys2/mingw64/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMSW__ -fpermissive -c C:/SourceCode/test/wx30Msys2/wx30Msys2Main.cpp -o obj/Debug/wx30Msys2Main.o
x86_64-w64-mingw32-g++.exe -o bin/Debug/wx30Msys2.exe obj/Debug/wx30Msys2App.o obj/Debug/wx30Msys2Main.o -LC:/Apps64/MSys2/mingw64/lib -pipe -Wl,--subsystem,windows -mwindows -lwx_mswu_xrc-3.0 -lwx_mswu_webview-3.0 -lwx_mswu_html-3.0 -lwx_mswu_qa-3.0 -lwx_mswu_adv-3.0 -lwx_mswu_core-3.0 -lwx_baseu_xml-3.0 -lwx_baseu_net-3.0 -lwx_baseu-3.0 -mthreads
Output file is bin\Debug\wx30Msys2.exe with size 866.95 KB
Process terminated with status 0 (0 minute(s), 8 second(s))
0 error(s), 0 warning(s) (0 minute(s), 8 second(s))
Tim S.
Deleted attachment because it is a waste of bandwidth to try to help this person we both speak English; but, we do NOT communicate.
This is a build log like I am hoping you post. I broke mine into two part the pre-build steps I added to determine the problem and the normal output of a build log.
Edit2: Added new zipped CB Project.
I ran into an issue that looked like your issue; exiting out of Code::Blocks fixed the cause of my issue.
Tim S.
Running target pre-build steps
i686-w64-mingw32-g++.exe --version
i686-w64-mingw32-g++.exe (Rev5, Built by MSYS2 project) 5.3.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
echo C:\Apps64\MSys2\mingw32\
C:\Apps64\MSys2\mingw32\
echo C:/Apps64/MSys2/mingw32
C:/Apps64/MSys2/mingw32
CMD /C where where
C:\Windows\System32\where.exe
CMD /C where sh.exe
C:\Apps64\MSys2\usr\bin\sh.exe
CMD /C "sh.exe -c 'which sed'"
/usr/bin/sed
CMD /C "sh.exe -c 'which wx-config'"
/mingw32/bin/wx-config
-------------- Build: Debug in wx30Msys2 (compiler: GNU GCC Compiler MSys2 MinGW64 32 bit)---------------
i686-w64-mingw32-g++.exe -Wall -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -g -IC:/Apps64/MSys2/mingw32/lib/wx/include/msw-unicode-3.0 -IC:/Apps64/MSys2/mingw32/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMSW__ -mthreads -fpermissive -c C:/SourceCode/OpenSourceCode/Apps/IDEs/CodeBlocks/cb_misc-git/Notes/MSys2/wx30Msys2/wx30Msys2App.cpp -o obj/Debug/wx30Msys2App.o
i686-w64-mingw32-g++.exe -Wall -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -g -IC:/Apps64/MSys2/mingw32/lib/wx/include/msw-unicode-3.0 -IC:/Apps64/MSys2/mingw32/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMSW__ -mthreads -fpermissive -c C:/SourceCode/OpenSourceCode/Apps/IDEs/CodeBlocks/cb_misc-git/Notes/MSys2/wx30Msys2/wx30Msys2Main.cpp -o obj/Debug/wx30Msys2Main.o
i686-w64-mingw32-g++.exe -o bin/Debug/wx30Msys2.exe obj/Debug/wx30Msys2App.o obj/Debug/wx30Msys2Main.o -LC:/Apps64/MSys2/mingw32/lib -pipe -Wl,--subsystem,windows -mwindows -lwx_mswu_xrc-3.0 -lwx_mswu_webview-3.0 -lwx_mswu_html-3.0 -lwx_mswu_qa-3.0 -lwx_mswu_adv-3.0 -lwx_mswu_core-3.0 -lwx_baseu_xml-3.0 -lwx_baseu_net-3.0 -lwx_baseu-3.0 -mthreads
Output file is bin\Debug\wx30Msys2.exe with size 796.98 KB
Process terminated with status 0 (0 minute(s), 9 second(s))
0 error(s), 0 warning(s) (0 minute(s), 9 second(s))
Deleted attachment because it is a waste of bandwidth to try to help this person we both speak English; but, we do NOT communicate.
If another person wants the code it is located here the OP never even tried this code; reason unknown, likely failure to communicate. https://github.com/stahta01/cb_misc/tree/master/Notes/MSys2/wx30Msys2 (https://github.com/stahta01/cb_misc/tree/master/Notes/MSys2/wx30Msys2)
Example of a Bad Build Log; I had to exit out of Code::Blocks
because some changes only take effect after restart of CB.
-------------- Build: Debug in wx30Msys2 (compiler: GNU GCC Compiler)---------------
i686-w64-mingw32-g++.exe -Wall -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -g -c C:\SourceCode\OpenSourceCode\VC_Repos\Apps\IDE\Codeblocks\cb_misc-git\Notes\MSys2\wx30Msys2\wx30Msys2App.cpp -o obj\Debug\wx30Msys2App.o
In file included from C:\SourceCode\OpenSourceCode\VC_Repos\Apps\IDE\Codeblocks\cb_misc-git\Notes\MSys2\wx30Msys2\wx30Msys2App.cpp:18:0:
C:\SourceCode\OpenSourceCode\VC_Repos\Apps\IDE\Codeblocks\cb_misc-git\Notes\MSys2\wx30Msys2\wx30Msys2App.h:13:20: fatal error: wx/app.h: No such file or directory
compilation terminated.
After restarting Code::Blocks; I have been told by CB Devs
that closing the project should be enough to fix this issue; but, it has never worked for me.
The issue is the the value between backticks is never updated in CB.
A Good build log.
-------------- Build: Debug in wx30Msys2 (compiler: GNU GCC Compiler)---------------
i686-w64-mingw32-g++.exe -Wall -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -g -IC:/Apps32/MSys2/mingw32/lib/wx/include/msw-unicode-3.0 -IC:/Apps32/MSys2/mingw32/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMSW__ -mthreads -fpermissive -c C:\SourceCode\OpenSourceCode\VC_Repos\Apps\IDE\Codeblocks\cb_misc-git\Notes\MSys2\wx30Msys2\wx30Msys2App.cpp -o obj\Debug\wx30Msys2App.o
i686-w64-mingw32-g++.exe -Wall -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -g -IC:/Apps32/MSys2/mingw32/lib/wx/include/msw-unicode-3.0 -IC:/Apps32/MSys2/mingw32/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMSW__ -mthreads -fpermissive -c C:\SourceCode\OpenSourceCode\VC_Repos\Apps\IDE\Codeblocks\cb_misc-git\Notes\MSys2\wx30Msys2\wx30Msys2Main.cpp -o obj\Debug\wx30Msys2Main.o
i686-w64-mingw32-g++.exe -o bin\Debug\wx30Msys2.exe obj\Debug\wx30Msys2App.o obj\Debug\wx30Msys2Main.o -LC:/Apps32/MSys2/mingw32/lib -pipe -Wl,--subsystem,windows -mwindows -lwx_mswu_xrc-3.0 -lwx_mswu_webview-3.0 -lwx_mswu_html-3.0 -lwx_mswu_qa-3.0 -lwx_mswu_adv-3.0 -lwx_mswu_core-3.0 -lwx_baseu_xml-3.0 -lwx_baseu_net-3.0 -lwx_baseu-3.0 -mthreads
Output file is bin\Debug\wx30Msys2.exe with size 796.98 KB
Process terminated with status 0 (1 minute(s), 39 second(s))
0 error(s), 0 warning(s) (1 minute(s), 39 second(s))
Tim S.
Please state the type of wxWidgets library you are wanting to use?
Shared or Static?
wxWidgets version?
Are you planning to use Code::Blocks wxSmith to create the GUI for your students?
Remember I still NEED the output of the CB Project pre-build commands.
If you know how to use the wx-config command; please post the output from MSys2 Mingw prompt.
My output
Default config is msw-unicode-3.0
Default config will be used for output
Alternate matches:
msw-unicode-static-3.0
Tim S.
So lets look if i can clear you up:
1) The wizard of c::b does NOT work with the current wx3.x installation without modifying. The reasons are because there are some highly complex naming conventions for wx libraries, and the current implementation of the script wizard is not build to handle this.
2) Don't try to modify the wizard script. My impression from your posts is that you are not experienced by compiling, because if you where, this thread would be finished after 3 posts... As stahta01 says here http://forums.codeblocks.org/index.php/topic,21094.0.html it will take some over thinking and probably some moths until the script is prepared for this and hopefully future wxWidgets versions
3) Sadly the wiki is not as up to date as it should be, so don't think that all instructions are cast in concrete. As i mentioned above wxWidgets uses a highly complex naming scheme so it is probably that the naming are different on your system.
Ok, if you want only to get a compilable project with wxWidgets, not really flexible, you only need some time to follow this steps:
Pre steps:
i have build wxWidgets with Msys. My configure command line was as follow:
../configure --enable-debug --prefix=../config_install
this command was executed in a newly created "build_config" sub folder of the wxWidgets source folder. Then:
and
After this the config_install folder will have this structure:
.
|-bin
|-include
|---wx-3.0
|-----wx
|-lib
|---wx
|-----config
|-----include
|-------msw-unicode-3.0
|---------wx
|-----------msw
|-share
NOTE: I don't copy or install this to the mingw base folder. I don't like to mix all kind of libraries, because this makes things a lot more difficult if something goes wrong (mixing versions, compiler ecc.)...
So lets create a project:
1) Start C::B
2) File->New Project->wxWidgets project
3) choose wx version 3.0.x
4) enter project title
5) select wxSmith and Dialog based
6) Let the wx location, it is not importand...
7) Finish the wizard.it does not really mater what you are using, we will overwrite it later
8) There will be warning messages, you can ignore them (answer with yes)
9) The wizard will now create a project and it will NOT COMPILE
We will now set up the project:
10) Project->Build options
11) Select the top most item in the left tree view
12) Search directories-> Compiler
a) Delete all entries
b) Add entry-> Browse to your "config_install\include\wx-3.0" folder NOTE: this folder can have a other name on your system, like "config_install\include\wx-3.1" or "config_install\include\wx-3.0u", but i hope you get the idea what folder i mean...
c) Add entry-> Browse to your "config_install\lib\wx\include\msw-unicode-3.0" folder
13) Search directories -> Linker
a) Add entry->Browse to your "config_install\lib" folder
NOTE: There will pop up many error messages "You have changed some settings. Do you want these settings to be saved?" Hit always "yes"
14) Linker Settings->Link libraries
a) remove all libraries
b) Add->Browse to your "config_install\lib\" folder, select your "libwx_mswu_core-3.0.dll.a" NOTE: This file can have a other name on your system!! You need to select the file with "core" in it. OK->Use absolute paths-> Remove the path to only have the library name
c) Add->Browse to your "config_install\lib\" folder, select your "libwx_baseu-3.0.dll.a" NOTE: This file can have a other name on your system!! You need to select the file with "base" in it. OK->Use absolute paths-> Remove the path to only have the library name
15) In the Tree view on the left select "Debug" target
a) Linker Settings->Link libraries-> remove all libraries
16) In the Tree view on the left select "Release" target
a) Linker Settings->Link libraries-> remove all libraries
17) Hit OK
18) Build->Build and Run
This should create the "Hello world" example and it will run...
This is the simplest project. If you use some more complex ui elements you have to add the libraries under "Linker Settings->Link libraries"
If you update wxWidgets this project won't compile any more, because the names will probably change.
If you want a more flexible way, and templates for your projects use stahta01's template project. He uses a more general way, but it will add some complexity
This is a general tutorial. If you compiled wxWidgets with Msys, mingw or cygwin should not matter... Just use the --prefix options on the configure step so you KNOW where the libraries and include directories are... If you don't use the configure step, but the general makefile the instructions are similar, you just have to know where the libraries are and modify the paths accordingly...
I hope this will clear things up. If you have some problems compiling post a "FULL REBUILD LOG"