User forums > Help
CB setup for wxWidgets / windows
robkai:
Tim,
I really appreciate you taking the time to help. Full compiler logging was a great tip. Tried playing around to see what setting change what options in the compiler but I think I'm getting more lost. Here is what the compiler logging shows, and here are my settings in CB. I was trying to make the settings global so they would take effect for any wxwidgets project, but maybe I am screwing things up. What am I missing?
(By the way, I was expecting to see paths listed on the 'search directories' show up as -I flags)
Here's the build log. (test12 is a minimal wxSmith project):
-------------- Build: Debug in test12 ---------------
mingw32-g++.exe -LC:\dev\wxMSW-2.9.1\lib\gcc_lib -LC:\dev\wxMSW-2.9.1\lib\gcc_lib -LC:\dev\wxMSW-2.9.1\lib\gcc_lib\mswd -o bin\Debug\test12.exe obj\Debug\test12App.o obj\Debug\test12Main.o obj\Debug\resource.res -mthreads -mthreads -lwxmsw29d "C:\Program Files\MySQL\MySQL Server 5.1\lib\opt\libmysqlclient.a" C:\dev\wxMSW-2.9.1\lib\gcc_lib\libwxmsw29d.a -mwindows
And here are my settings, starting with global CB settings, and followed by compiler settings:
CB environmental variables:
PATH = C:\dev\wxMSW-2.9.1\include;C:\dev\wxMSW-2.9.1\lib\gcc_lib;c:\dev\minGW\bin;c:\dev\minGW;c:\Program Files\CodeBlocks\share\codeblocks\plugins;C:\dev\MSys\local\lib\wx2.9\bin;%PATH%
wx variable:
C:\dev\wxMSW-2.9.1
***********************************
Global compiler setting:
Compiler settings - other options:
-pipe
[[if (PLATFORM == PLATFORM_MSW && (GetCompilerFactory().GetCompilerVersionString(_T("gcc")) >=
_T("4.0.0"))) print(_T("-Wno-attributes")]]
Compiler settings - #defines: (wxWidgets compiled monolithic, static, no unicode, debug)
__GNUWIN32__
__WXMSW__
__WXDEBUG__
Linker settings - link libraries:
C:\Program Files\MySQL\MySQL Server 5.1\lib\opt\libmysqlclient.a
C:\dev\wxMSW-2.9.1\lib\gcc_lib\libwxmsw29d.a
Linker settings - other linker options:
-mthreads
Search directories - compiler
C:\Program Files\MySQL\MySQL Server 5.1\include
$(#wx)\include
$(#wx)\lib\gcc_lib\mswd
$(#wx)\contrib\include
$(#wx)\lib\gcc_lib
Search directories - linker
$(#wx)\lib\gcc_lib
$(#wx)\include
$(#wx)\lib\gcc_lib\mswd
Search directories - compiler
$(#wx)\lib\gcc_lib
$(#wx)\lib\gcc_lib\mswd
Search directories - resource compile
C:\Program Files\MySQL\MySQL Server 5.1\include
$(#wx)\include
$(#wx)\lib\gcc_lib\mswd
$(#wx)\contrib\include
$(#wx)\lib\gcc_lib
Toolchain executables
installation directory: c:\dev\MinGW
***************************
Project build options (project name is test12):
Compiler settings - other options (under test12)
-pipe
-mthreads
[[if (PLATFORM == PLATFORM_MSW && (GetCompilerFactory().GetCompilerVersionString(_T("gcc")) >=_T("4.0.0"))) print(_T("-Wno-attributes"));]]
Compiler settings - other options (under debug)
<nothing>
Compiler settings - #defines (under test12)
__GNUWIN32__
__WXMSW__
Compiler settings - #defines (under Debug)
__WXDEBUG__
Linker settings - link libraries (under test12)
<nothing>
Linker settings - link libraries (under Debug)
libwxmsw29d.a
Linker settings - other linker options (under test12)
-mthreads
Linker settings - other linker options (under Debug)
<nothing>
Search directories - compiler (under test12)
$(#wx)\include
$(#wx)\contrib\include
Search directories - compiler (under Debug)
$(#wx)\lib\gcc_lib\mswd
Search directories - linker (under test12)
<nothing>
Search directories - linker (under Debug)
$(#wx)\lib\gcc_lib
Search directories - resource compiler (under test12)
$(#wx)\include
Search directories - resource compiler (under Debug)
$(#wx)\lib\gcc_lib\mswd
stahta01:
What options did you use with minGW32-make build of wxWidgets?
And, what type build of wxWidgets do you want to use?
Release/debug, ANSI/Unicode, Monolithic/MultiLib, SHARED(DLL)/static Library
Tim S.
stahta01:
Why are you linking to the below library?
--- Code: ---C:\Program Files\MySQL\MySQL Server 5.1\lib\opt\libmysqlclient.a
--- End code ---
Start a new Project using the CB wxWidgets wizard to get the right settings.
Or find someone else to help.
Tim S
Jenna:
It's in general not a good idea to use such special settings (mysq and wxwidgets) as global compiler settings, if you do not make a copy of the compiler (e.g. "GCC for wxWidgets"), because you apply settings to projects and files even if you do not need them.
We had several posts about compiler issue, just because the user has made global settings and forgot to remove them.
robkai:
Thanks. I've tried compiling wxWidgets multiple ways and different versions, but this one was
wxWidgets compiled monolithic, static, no unicode, debug
I had written a medical billing/records software 14 years ago using visual basic and SQLServer, and I am fed up with having to continually update Windows software every 3-4 years. It is prohibitively expensive for a small company to do so. So I decided to finally bite the bullet and re-write the whole project from scratch with C++ and open software, MySQL/Codeblocks/wxWidgets to start. (I had played with Netbeans/java as well, but the startup of the virtual machine seems to slow things down and C++ seemed cleaner).
I started with porting the data validation routines and basic database connection routines as a way to start learning the new language, so I just left the link in for MySQL library when I started working with wxWidgets.
I have one windows machine and one linux machine to get benefit of cross compiling.
Funny thing is, I had it working (now I realize was just dumb luck not any innate knowledge), but realized I needed the richtextctrl which didn't seem to be in the wxWidgets 2.8 library I built. When I compiled the 2.9 library I must have changed some settings.
You've been a big help, though. It sounds like I'm getting some conflicts between the global settings and project specific settings. I'm going to clear out everything and start from scratch and see if I can work it out.
Mahalo (live in hawaii) and have a good thanksgiving.
Rob.
Navigation
[0] Message Index
[*] Previous page
Go to full version