Author Topic: Build problems with wxW2.8.4  (Read 16711 times)

Offline patlecat

  • Multiple posting newcomer
  • *
  • Posts: 62
Build problems with wxW2.8.4
« on: May 20, 2007, 01:20:12 pm »
I discussed this over here already, but came to no solution: other thread

I use the newest nightly CB and GCC4.2 under WinXP. Building a wxW program with Dialogblocks works just fine, but when I try to use CB then I get a huge amount of errors. I included a lot of directories in the Compiler Settings, but nothing seems to help.

Code
mingw32-gcc-4.2.0.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -Winvalid-pch -include wx_pch.h -DWX_PRECOMP -Wall -O2 
-march=athlon-xp -O3 -W -pg -g UNICODE=1 -IH:\wxWidgets-2.8.4\include -IH:\wxWidgets-2.8.4\contrib\include
-IH:\wxWidgets-2.8.4\lib\gcc_lib\msw -Ih:\MinGW\include -IH:\wxWidgets-2.8.4\include -IH:\wxWidgets-2.8.4\include\wx\msw
-IH:\wxWidgets-2.8.4\contrib\include -IH:\wxWidgets-2.8.4\lib\gcc_lib\mswu -IH:\wxWidgets-2.8.4\lib\gcc_lib\mswud
-IH:\wxWidgets-2.8.4\include\wx -IH:\wxWidgets-2.8.4\lib\gcc_lib\mswu\wx -IH:\wxWidgets-2.8.4\lib\gcc_lib\mswud\wx -c
H:\myProjects2\wixTest\wx_pch.h -o wx_pch.h.gch\Release_wx_pch_h_gch

In file included from H:/wxWidgets-2.8.4/include/wx/wxprec.h:46,
from ./wx_pch.h:14,
from :0:
H:/wxWidgets-2.8.4/include/wx/msw/wrapcctl.h: In function 'wxSetCCUnicodeFormat':
H:/wxWidgets-2.8.4/include/wx/msw/wrapcctl.h:48: error: expected expression before ':' token
H:/wxWidgets-2.8.4/include/wx/msw/wrapcctl.h:45: warning: unused parameter 'hwnd'
H:/wxWidgets-2.8.4/include/wx/msw/wrapcctl.h: At top level:
H:/wxWidgets-2.8.4/include/wx/msw/wrapcctl.h:58: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'wxFont'
H:/wxWidgets-2.8.4/include/wx/msw/wrapcctl.h:59: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'wxGetCCDefaultFont'
...
and so on...

Anyone have a good idea?

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Build problems with wxW2.8.4
« Reply #1 on: May 20, 2007, 01:31:45 pm »
mingw32-gcc-4.2.0.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -Winvalid-pch -include wx_pch.h -DWX_PRECOMP -Wall -O2 -march=athlon-xp -O3 -W -pg -g UNICODE=1 -IH:\wxWidgets-2.8.4\include -IH:\wxWidgets-2.8.4\contrib\include
-IH:\wxWidgets-2.8.4\lib\gcc_lib\msw -Ih:\MinGW\include -IH:\wxWidgets-2.8.4\include -IH:\wxWidgets-2.8.4\include\wx\msw
-IH:\wxWidgets-2.8.4\contrib\include -IH:\wxWidgets-2.8.4\lib\gcc_lib\mswu -IH:\wxWidgets-2.8.4\lib\gcc_lib\mswud
-IH:\wxWidgets-2.8.4\include\wx -IH:\wxWidgets-2.8.4\lib\gcc_lib\mswu\wx -IH:\wxWidgets-2.8.4\lib\gcc_lib\mswud\wx -c
H:\myProjects2\wixTest\wx_pch.h -o wx_pch.h.gch\Release_wx_pch_h_gch

The above code should be:
Quote
mingw32-gcc-4.2.0.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -Winvalid-pch -include wx_pch.h -DWX_PRECOMP -Wall -O2 -march=athlon-xp -O3 -W -pg -g -D_UNICODE -IH:\wxWidgets-2.8.4\include -IH:\wxWidgets-2.8.4\contrib\include
-IH:\wxWidgets-2.8.4\lib\gcc_lib\msw -Ih:\MinGW\include -IH:\wxWidgets-2.8.4\include -IH:\wxWidgets-2.8.4\include\wx\msw
-IH:\wxWidgets-2.8.4\contrib\include -IH:\wxWidgets-2.8.4\lib\gcc_lib\mswu -IH:\wxWidgets-2.8.4\lib\gcc_lib\mswud
-IH:\wxWidgets-2.8.4\include\wx -IH:\wxWidgets-2.8.4\lib\gcc_lib\mswu\wx -IH:\wxWidgets-2.8.4\lib\gcc_lib\mswud\wx -c
H:\myProjects2\wixTest\wx_pch.h -o wx_pch.h.gch\Release_wx_pch_h_gch
Be a part of the solution, not a part of the problem.

Offline patlecat

  • Multiple posting newcomer
  • *
  • Posts: 62
Re: Build problems with wxW2.8.4
« Reply #2 on: May 20, 2007, 01:34:22 pm »
Ok thanks, I added this just before posting the new thread. But the errors remain the same.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Build problems with wxW2.8.4
« Reply #3 on: May 20, 2007, 03:09:08 pm »
Did you compile the debug version of wxWidgets?
The code you posted above is trying to use the debug version of wxWidgets.

The folder name "mswud" means wxMSW Unicode Debug

Tim S
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Build problems with wxW2.8.4
« Reply #4 on: May 20, 2007, 03:39:24 pm »
My suggested settings are as follows:
Settings - Global Variables (variable: wx) :
base:      H:\wxWidgets-2.8.4
include:
lib:

The include and lib defaults to
H:\wxWidgets-2.8.4\include
and
H:\wxWidgets-2.8.4\lib
with no value specified.

plus in the project "Build Options" Settings:
Search directories:
++ Compiler
$(#WX.include)
$(#WX.lib)\gcc_dll\mswu
$(#WX)\contrib\include

++ Linker
$(#WX.lib)\gcc_dll

++ Resource compiler
$(#WX.include)


Note replace "$(#WX.lib)\gcc_dll\mswu" with "$(#WX.lib)\gcc_dll\mswud" if doing debug.

Note, I just saw your setting where in the compiler section they need removed.
Repeating, wxWidgets setting should not be under compiler setting. They should be under Project -> "Build options" Settings.


Tim S
« Last Edit: May 20, 2007, 03:50:56 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline patlecat

  • Multiple posting newcomer
  • *
  • Posts: 62
Re: Build problems with wxW2.8.4
« Reply #5 on: May 20, 2007, 04:26:05 pm »
okay Tim, I made all the changes (except for the dll path) like u suggested and still get the exact same errors. And yes I've compiled wxW in Debug too. I find it strange though that I should be adding the wxW directories manually each time I make a new project. They should be stored globally, like in MSVC. But right now, no wxW path is under the global compiler settings only in the projects Search-Directories.


Code
-------------- Build: Release in wixTest ---------------
mingw32-gcc-4.2.0.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -Winvalid-pch -include wx_pch.h -DWX_PRECOMP -Wall -O2
-march=athlon-xp -O3 -W -pg -g -D_UNICODE -IH:\wxWidgets-2.8.4\include -IH:\wxWidgets-2.8.4\contrib\include -IH:\wxWidgets-2.8.4\include
-IH:\wxWidgets-2.8.4\contrib\include -IH:\wxWidgets-2.8.4\lib\gcc_lib\mswu -Ih:\MinGW\include -c H:\myProjects2\wixTest\wx_pch.h -o
wx_pch.h.gch\Release_wx_pch_h_gch
In file included from H:/wxWidgets-2.8.4/include/wx/wxprec.h:46,
from ./wx_pch.h:14,
from :0:
H:/wxWidgets-2.8.4/include/wx/msw/wrapcctl.h: In function 'wxSetCCUnicodeFormat':
H:/wxWidgets-2.8.4/include/wx/msw/wrapcctl.h:48: error: expected expression before ':' token
H:/wxWidgets-2.8.4/include/wx/msw/wrapcctl.h:45: warning: unused parameter 'hwnd'
H:/wxWidgets-2.8.4/include/wx/msw/wrapcctl.h: At top level:
H:/wxWidgets-2.8.4/include/wx/msw/wrapcctl.h:58: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'wxFont'
H:/wxWidgets-2.8.4/include/wx/msw/wrapcctl.h:59: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'wxGetCCDefaultFont'
In file included from H:/wxWidgets-2.8.4/include/wx/string.h:55,
from H:/wxWidgets-2.8.4/include/wx/log.h:47,
from H:/wxWidgets-2.8.4/include/wx/msw/private.h:24,
from H:/wxWidgets-2.8.4/include/wx/msw/wrapcdlg.h:18,
from H:/wxWidgets-2.8.4/include/wx/wxprec.h:47,
from ./wx_pch.h:14,
from :0:
H:/wxWidgets-2.8.4/include/wx/buffer.h:127: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'wxCharBuffer'
H:/wxWidgets-2.8.4/include/wx/buffer.h:129: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'wxWritableCharBuffer'
« Last Edit: May 20, 2007, 04:31:28 pm by patlecat »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Build problems with wxW2.8.4
« Reply #6 on: May 20, 2007, 05:06:17 pm »
Please post the code in
H:\myProjects2\wixTest\wx_pch.h

I am trying to run your command on my computer to duplicate the issue.

Tim S
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline patlecat

  • Multiple posting newcomer
  • *
  • Posts: 62
Re: Build problems with wxW2.8.4
« Reply #7 on: May 20, 2007, 05:22:08 pm »
ok here it is:

Code
/***************************************************************
 * Name:      wx_pch.h
 * Purpose:   Header to create Pre-Compiled Header (PCH)
 * Author:    Pat Le Cat (patlecat@gmx.net)
 * Created:   2007-05-20
 * Copyright: Pat Le Cat (winterthur.grunliberale.ch)
 * License:   
 **************************************************************/

#ifndef WX_PCH_H_INCLUDED
#define WX_PCH_H_INCLUDED

// basic wxWidgets headers
#include <wx/wxprec.h>

#ifdef __BORLANDC__
#pragma hdrstop
#endif

#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif

#ifdef WX_PRECOMP
// put here all your rarely-changing header files
#endif // WX_PRECOMP

#endif // WX_PCH_H_INCLUDED

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Build problems with wxW2.8.4
« Reply #8 on: May 20, 2007, 05:32:03 pm »
This may be wrong "-IH:\wxWidgets-2.8.4\lib\gcc_lib\mswu"

replace "gcc_lib" with "gcc_dll" unless you mean to use static wxWidgets.

What wxWidgets are you trying to use?
static or DLL
Unicode or ANSI
Monolithic or Multilib
Debug or Release.

Note, I duplicated the error you are getting, looking for cause.
Tim S

C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline patlecat

  • Multiple posting newcomer
  • *
  • Posts: 62
Re: Build problems with wxW2.8.4
« Reply #9 on: May 20, 2007, 05:34:40 pm »
yes i use static built wxW, no DLLs, I multilib and release (but debug doesnt work either).

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Build problems with wxW2.8.4
« Reply #10 on: May 20, 2007, 05:59:16 pm »
Please check compiler settings.

Under Tool Chain Executables
Program files Tab.

I have
Code
C-Compiler                   mingw32-gcc.exe
C++ Compiler                 mingw32-g++.exe

Resource Compiler            windres.exe
Note, I omitted the other values since, I think they are not related to compiler errors.

Please verify the value for C++ Compiler.

You are using mingw32-gcc-4.2.0.exe (in your command posted above) which errors out, I changed it to "mingw32-g++.exe" which does not at the same place.

Please post an updated "Build Log" for me to check after you verify the "Program files" Tab.
I just need the command plus 6 to 12 lines of errors.

Tim S
« Last Edit: May 20, 2007, 06:29:15 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline patlecat

  • Multiple posting newcomer
  • *
  • Posts: 62
Re: Build problems with wxW2.8.4
« Reply #11 on: May 20, 2007, 06:20:13 pm »
I have changed so many settings in the last weeks, also the gcc executables. But this time the settings mix gives some progress, thanks man :P

Now this link error (which I had also in the beginning) remains:
Code
-------------- Build: Release in wixTest ---------------
mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -Winvalid-pch -include wx_pch.h -DWX_PRECOMP -Wall -O2 -march=athlon-xp
-O3 -W -pg -g -D_UNICODE -IH:\wxWidgets-2.8.4\include -IH:\wxWidgets-2.8.4\contrib\include -IH:\wxWidgets-2.8.4\include
-IH:\wxWidgets-2.8.4\contrib\include -IH:\wxWidgets-2.8.4\lib\gcc_lib\mswu -Ih:\MinGW\include -c H:\myProjects2\wixTest\wx_pch.h -o
wx_pch.h.gch\Release_wx_pch_h_gch
In file included from H:/wxWidgets-2.8.4/include/wx/gdicmn.h:23,
from H:/wxWidgets-2.8.4/include/wx/msw/private.h:213,
from H:/wxWidgets-2.8.4/include/wx/msw/wrapcdlg.h:18,
from H:/wxWidgets-2.8.4/include/wx/wxprec.h:47,
from ./wx_pch.h:14,
...
windres.exe -i H:\MYPROJ~1\wixTest\resource.rc -J rc -o obj\Release\resource.res -O coff -IH:\wxWidgets-2.8.4\include -IH:\wxWidgets-2.8.4\include -Ih:\MinGW\include
mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -Winvalid-pch -include wx_pch.h -DWX_PRECOMP -Wall -O2 -march=athlon-xp -O3 -W -pg -g -D_UNICODE -IH:\wxWidgets-2.8.4\include -IH:\wxWidgets-2.8.4\contrib\include -IH:\wxWidgets-2.8.4\include -IH:\wxWidgets-2.8.4\contrib\include -IH:\wxWidgets-2.8.4\lib\gcc_lib\mswu -Ih:\MinGW\include -c H:\myProjects2\wixTest\GUIDialog.cpp -o obj\Release\GUIDialog.o
mingw32-g++.exe -LH:\wxWidgets-2.8.4\lib\gcc_lib -Lh:\MinGW\lib -o bin\Release\wixTest.exe obj\Release\wixTestApp.o obj\Release\wixTestMain.o
 obj\Release\GUIDialog.o obj\Release\resource.res -s -s -pg -lgmon -lwxmsw28 -lwxpng -lwxjpeg -lwxtiff -lwxzlib -lkernel32 -luser32 -lgdi32
-lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lcomctl32 -lwsock32 -lodbc32 -mwindows
h:/mingw/bin/../lib/gcc/mingw32/4.2.0/../../../../mingw32/bin/ld.exe: cannot find -lwxmsw28
collect2: ld returned 1 exit status

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Build problems with wxW2.8.4
« Reply #12 on: May 20, 2007, 06:32:39 pm »

Code
mingw32-g++.exe -LH:\wxWidgets-2.8.4\lib\gcc_lib -Lh:\MinGW\lib -o bin\Release\wixTest.exe obj\Release\wixTestApp.o obj\Release\wixTestMain.o
 obj\Release\GUIDialog.o obj\Release\resource.res -s -s -pg -lgmon -lwxmsw28 -lwxpng -lwxjpeg -lwxtiff -lwxzlib -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lcomctl32 -lwsock32 -lodbc32 -mwindows
h:/mingw/bin/../lib/gcc/mingw32/4.2.0/../../../../mingw32/bin/ld.exe: cannot find -lwxmsw28
collect2: ld returned 1 exit status

The above code looks like monolithic build code, you said you were doing multilib right?

For Multi, Change wxmsw28 to wxmsw28_core and add wxbase28
Note, more libs may need to be added based on each project requirement.

Are you doing an Unicode build or not?

Tim S
« Last Edit: May 20, 2007, 06:41:16 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline patlecat

  • Multiple posting newcomer
  • *
  • Posts: 62
Re: Build problems with wxW2.8.4
« Reply #13 on: May 20, 2007, 06:40:55 pm »
My Config.gcc has MONOLITHIC = 0 in it. Or is there another option that overrides this?

And where can I change the libs?
« Last Edit: May 20, 2007, 06:44:56 pm by patlecat »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Build problems with wxW2.8.4
« Reply #14 on: May 20, 2007, 06:44:22 pm »
My Config.gcc has MONOLITHIC = 0 in it. Or is there another option that overrides this?

Yes, when building wxWidgets.

No inside codeblocks, but the wizard is normally only tested with MONOLITHIC builds, note it should asked you when running it if mono or multilib build. I have not used the wizard in months not sure if it asks you, but the forum implied it did after last redesign.

Edit added stuff I added late above

For Multi, Change wxmsw28 to wxmsw28_core and add wxbase28
Note, more libs may need to be added based on each project requirement.

Are you doing an Unicode build or not?

To change libs look at
Project -> Build Options
Change "Compiler Settings" to "Linker Settings"
The libraries should be under "Link Libraries" add them one per row.

Tim S

« Last Edit: May 20, 2007, 06:51:27 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org