[wxpython-dev] Windows build problems

wxPython developer mailing list, post #721
Author:
Date:
Subject:
 Jamie Redmond
 2008-06-23 12:58:29
 [wxpython-dev] Windows build problems
I would like to integrate wxPython support into my application that is built with C++ and wxWidgets. I got the 2.8.6.0 source distribution of wxPython and set about getting it built, but unfortunately I can't get it to build. I've followed the Windows build instructions exactly, and just to be extra sure I tried a clean build using the version of wxWidgets contained in the wxPython source distribution. wxWidgets builds fine, but when running setup.py to build wxPython I get linker errors from MSVC complaining about wxString::Cmp(), wxString::Printf() et. al. It appears that when building wxPython, it thinks that wxChar is an unsigned short rather than wchar_t - even though I build wxWidgets with Unicode support and passed the appropriate Unicode flags when trying to build wxPython.

Do any of these problems sound familiar? Am I missing something simple here?

Thanks,
- Jamie <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content=text/html;charset=iso-8859-1>
<META content="MSHTML 6.00.6000.16674" name=GENERATOR></HEAD>
<BODY id=MailContainerBody
style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-TOP: 15px"
bgColor=#ffffff leftMargin=0 topMargin=0 CanvasTabStop="true"
name="Compose message area">
<DIV><FONT face=Arial size=2>I would like to integrate wxPython support into my
application that is built with C++ and wxWidgets. I got the 2.8.6.0 source
distribution of wxPython and set about getting it built, but unfortunately I
can't get it to build. I've followed the Windows build instructions exactly, and
just to be extra sure I tried a clean build using the version of wxWidgets
contained in the wxPython source distribution. wxWidgets builds fine, but when
running setup.py to build wxPython I get linker errors from MSVC complaining
about wxString::Cmp(), wxString::Printf()&nbsp;et. al. It appears that when
building wxPython, it thinks that&nbsp;wxChar is an unsigned short rather than
wchar_t - even though I build wxWidgets with Unicode support and passed the
appropriate&nbsp;Unicode flags when trying to build wxPython.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Do any of these problems sound familiar? Am I
missing something simple here?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Thanks,</FONT></DIV>
<DIV><FONT face=Arial size=2>- Jamie</FONT>&nbsp;</DIV></BODY></HTML>
_______________________________________________
wxpython-dev mailing list
[email protected]
http://lists.wxwidgets.org/mailman/listinfo/wxpython-dev
Author:
Date:
Subject:
 Robin Dunn
 2008-06-23 10:39:26
 Re: [wxpython-dev] Windows build problems
Jamie Redmond wrote:
> I would like to integrate wxPython support into my application that is
> built with C++ and wxWidgets. I got the 2.8.6.0 source distribution of
> wxPython and set about getting it built, but unfortunately I can't get
> it to build. I've followed the Windows build instructions exactly, and
> just to be extra sure I tried a clean build using the version of
> wxWidgets contained in the wxPython source distribution. wxWidgets
> builds fine, but when running setup.py to build wxPython I get linker
> errors from MSVC complaining about wxString::Cmp(),
> wxString::Printf() et. al.

What are the actual errors?

> It appears that when building wxPython, it
> thinks that wxChar is an unsigned short rather than wchar_t - even
> though I build wxWidgets with Unicode support and passed the
> appropriate Unicode flags when trying to build wxPython.

Depending on the compiler wchar_t may just be a typedef for unsigned short.


--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

_______________________________________________
wxpython-dev mailing list
[email protected]
http://lists.wxwidgets.org/mailman/listinfo/wxpython-dev
Author:
Date:
Subject:
 Jamie Redmond
 2008-06-23 14:17:24
 Re: [wxpython-dev] Windows build problems
> What are the actual errors?

I'm trying to do everything the default out-of-the-box way, so I'm following
the instructions in build.txt exactly with a fresh distribution zip. I
copied setup0.h to setup.h and changed all of the settings as described (I'm
using Unicode). I built wxWidgets with the following command and it build
just fine:

nmake -f makefile.vc OFFICIAL_BUILD=1 SHARED=1 MONOLITHIC=0 USE_OPENGL=1
USE_GDIPLUS=1 UNICODE=1 MSLU=1 DEBUG_FLAG=1 CXXFLAGS=/D__NO_VC_CRTDBG__
WXDEBUGFLAG=h BUILD=release

Next I attempt to build wxPython like so:

python setup.py build_ext --inplace MONOLITHIC=0 UNICODE=1

So far I've followed the instructions in build.txt exactly, but the build
fails on _core_wrap.cpp (sorry for the formatting):

_core_wrap.cpp
src\msw\_core_wrap.cpp(4419) : warning C4996: 'wxSizer::Remove' was declared
deprecated
..\include\wx\sizer.h(499) : see declaration of 'wxSizer::Remove'
src\msw\_core_wrap.cpp(32984) : warning C4996: 'wxGetAccelFromString' was
declared deprecated
..\include\wx\utils.h(573) : see declaration of
'wxGetAccelFromString'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\link.exe /DLL
/nologo /INCREMENTAL:NO /LIBPATH:..\lib\vc_dll /LIBPATH:C:\Python25\libs
/LIBPATH:C:\Py
thon25\PCBuild wxbase28uh.lib wxbase28uh_net.lib wxbase28uh_xml.lib
wxmsw28uh_core.lib wxmsw28uh_adv.lib wxmsw28uh_html.lib kernel32.lib
user32.lib gdi32.lib co
mdlg32.lib winspool.lib winmm.lib shell32.lib oldnames.lib comctl32.lib
odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib
wsock32.lib /EXPORT:i
nit_core_ build.unicode\temp.win32-2.5\Release\src/helpers.obj
build.unicode\temp.win32-2.5\Release\src/wxc.res
build.unicode\temp.win32-2.5\Release\src\msw\_co
re_wrap.obj /OUT:wx\_core_.pyd
/IMPLIB:build.unicode\temp.win32-2.5\Release\src\_core_.lib
Creating library build.unicode\temp.win32-2.5\Release\src\_core_.lib and
object build.unicode\temp.win32-2.5\Release\src\_core_.exp
helpers.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) void __cdecl wxOnAssert(unsigned short const
*,int,char const *,unsigned short co
nst *,unsigned short const *)" (__imp_?wxOnAssert@@YAXPBGHPBD00@Z)
referenced in function "public: void __thiscall
wxMemoryBuffer::SetDataLen(unsigned int)" (?S
etDataLen@wxMemoryBuffer@@QAEXI@Z)
_core_wrap.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) void __cdecl wxOnAssert(unsigned short const
*,int,char const *,unsigned short
const *,unsigned short const *)" (__imp_?wxOnAssert@@YAXPBGHPBD00@Z)
referenced in function _init_core_
helpers.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) public: int __thiscall wxString::Cmp(unsigned short
const *)const " (__imp_?Cmp@w
xString@@QBEHPBG@Z) referenced in function "bool __cdecl operator==(class
wxString const &,unsigned short const *)" (??8@YA_NABVwxString@@PBG@Z)
helpers.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) public: __thiscall wxString::wxString(unsigned short
const *)" (__imp_??0wxString
@@QAE@PBG@Z) referenced in function "public: static class wxString __cdecl
wxPyApp::GetMacHelpMenuTitleName(void)"
(?GetMacHelpMenuTitleName@wxPyApp@@SA?AVwxStr
ing@@XZ)
_core_wrap.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) public: __thiscall wxString::wxString(unsigned short
const *)" (__imp_??0wxStr
ing@@QAE@PBG@Z) referenced in function _init_core_
helpers.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) unsigned short const * const wxEmptyString"
(__imp_?wxEmptyString@@3PBGB) referen
ced in function "public: static class wxString __cdecl
wxPyApp::GetMacHelpMenuTitleName(void)"
(?GetMacHelpMenuTitleName@wxPyApp@@SA?AVwxString@@XZ)
_core_wrap.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) unsigned short const * const wxEmptyString"
(__imp_?wxEmptyString@@3PBGB) refe
renced in function _init_core_
helpers.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) public: unsigned short * __thiscall
wxString::GetWriteBuf(unsigned int)" (__imp_?
GetWriteBuf@wxString@@QAEPAGI@Z) referenced in function "class wxString *
__cdecl wxString_in_helper(struct _object *)"
(?wxString_in_helper@@YAPAVwxString@@PAU
_object@@@Z)
helpers.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) public: unsigned short __thiscall
wxString::GetChar(unsigned int)const " (__imp_?
GetChar@wxString@@QBEGI@Z) referenced in function "bool __cdecl
wxColour_helper(struct _object *,class wxColour * *)"
(?wxColour_helper@@YA_NPAU_object@@PAPAVwx
Colour@@@Z)
helpers.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) public: int __cdecl wxString::Printf(unsigned short
const *,...)" (__imp_?Printf@
wxString@@QAAHPBGZZ) referenced in function "bool __cdecl
wxPyTwoIntItem_helper<class wxSize>(struct _object *,class wxSize *
*,unsigned short const *)" (??$wxP
yTwoIntItem_helper@VwxSize@@@@YA_NPAU_object@@PAPAVwxSize@@PBG@Z)
_core_wrap.obj : error LNK2001: unresolved external symbol
"__declspec(dllimport) public: int __cdecl wxString::Printf(unsigned short
const *,...)" (__imp_?Prin
tf@wxString@@QAAHPBGZZ)
helpers.obj : error LNK2001: unresolved external symbol "public: virtual
void __thiscall wxAppConsole::OnAssert(unsigned short const *,int,unsigned
short const
*,unsigned short const *)" (?OnAssert@wxAppConsole@@UAEXPBGH00@Z)
helpers.obj : error LNK2001: unresolved external symbol "public: virtual
bool __thiscall wxApp::Initialize(int &,unsigned short * *)"
(?Initialize@wxApp@@UAE_NA
AHPAPAG@Z)
helpers.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) public: virtual void __thiscall
wxAppConsole::OnAssertFailure(unsigned short cons
t *,int,unsigned short const *,unsigned short const *,unsigned short const
*)" (__imp_?OnAssertFailure@wxAppConsole@@UAEXPBGH000@Z) referenced in
function "publ
ic: virtual void __thiscall wxPyApp::OnAssertFailure(unsigned short const
*,int,unsigned short const *,unsigned short const *,unsigned short const *)"
(?OnAsser
tFailure@wxPyApp@@UAEXPBGH000@Z)
helpers.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) void __cdecl wxLogDebug(unsigned short const *,...)"
(__imp_?wxLogDebug@@YAXPBGZZ
) referenced in function "public: virtual void __thiscall
wxPyApp::OnAssertFailure(unsigned short const *,int,unsigned short const
*,unsigned short const *,unsi
gned short const *)" (?OnAssertFailure@wxPyApp@@UAEXPBGH000@Z)
helpers.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) public: class wxString & __thiscall
wxString::operator<<(unsigned short const *)"
(__imp_??6wxString@@QAEAAV0@PBG@Z) referenced in function "public: virtual
void __thiscall wxPyApp::OnAssertFailure(unsigned short const *,int,unsigned
short c
onst *,unsigned short const *,unsigned short const *)"
(?OnAssertFailure@wxPyApp@@UAEXPBGH000@Z)
helpers.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) public: class wxString & __thiscall
wxString::operator+=(unsigned short const *)"
(__imp_??YwxString@@QAEAAV0@PBG@Z) referenced in function "struct _object *
__cdecl wxPyMake_wxObject(class wxObject *,bool,bool)"
(?wxPyMake_wxObject@@YAPAU_o
bject@@PAVwxObject@@_N1@Z)
helpers.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) public: class wxStringBase & __thiscall
wxStringBase::operator=(unsigned short co
nst *)" (__imp_??4wxStringBase@@QAEAAV0@PBG@Z) referenced in function
"struct _object * __cdecl wxPyMake_wxObject(class wxObject *,bool,bool)"
(?wxPyMake_wxObje
ct@@YAPAU_object@@PAVwxObject@@_N1@Z)
_core_wrap.obj : error LNK2001: unresolved external symbol
"__declspec(dllimport) public: class wxStringBase & __thiscall
wxStringBase::operator=(unsigned short
const *)" (__imp_??4wxStringBase@@QAEAAV0@PBG@Z)
_core_wrap.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) public: static unsigned long __cdecl
wxStringHash::wxCharStringHash(unsigned s
hort const *)" (__imp_?wxCharStringHash@wxStringHash@@SAKPBG@Z) referenced
in function "protected: static unsigned int __cdecl
wxPyTypeInfoHashMap_wxImplementat
ion_HashTable::GetBucketForNode(class
wxPyTypeInfoHashMap_wxImplementation_HashTable *,struct
wxPyTypeInfoHashMap_wxImplementation_HashTable::Node *)" (?GetBuck
etForNode@wxPyTypeInfoHashMap_wxImplementation_HashTable@@KAIPAV1@PAUNode@1@@Z)
_core_wrap.obj : error LNK2001: unresolved external symbol "protected:
virtual bool __thiscall wxColourBase::FromString(unsigned short const *)"
(?FromString@wx
ColourBase@@MAE_NPBG@Z)
_core_wrap.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) public: class wxString & __thiscall
wxString::Append(unsigned short const *)"
(__imp_?Append@wxString@@QAEAAV1@PBG@Z) referenced in function "struct
swig_type_info * __cdecl wxPyFindSwigType(unsigned short const *)"
(?wxPyFindSwigType@@YA
PAUswig_type_info@@PBG@Z)
_core_wrap.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) unsigned short const * const wxPanelNameStr"
(__imp_?wxPanelNameStr@@3QBGB) re
ferenced in function _$E54
_core_wrap.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) unsigned short const * const wxControlNameStr"
(__imp_?wxControlNameStr@@3QBGB
) referenced in function _$E60
wx\_core_.pyd : fatal error LNK1120: 19 unresolved externals
error: command '"c:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\bin\link.exe"' failed with exit status 1120

As an aside, in my actual project I turned off wx2.6 compatibility mode in
setup.h and wxPython didn't like that either - and I regenerated the rename
tables and re-ran swig. That's not a big deal because I can re-enable that
flag in my own application with no ill effects, but then I get stuck on
these same linker errors that I get with a stock distribution.

Thanks for the help.

- Jamie



_______________________________________________
wxpython-dev mailing list
[email protected]
http://lists.wxwidgets.org/mailman/listinfo/wxpython-dev