Re: [wxVTK] Problem with wxVTK and _UNICODE wxwidgets.
Brought to you by:
malat
From: Mathieu M. <mat...@gm...> - 2008-04-13 22:22:38
|
Hi John, On Sat, Apr 12, 2008 at 2:10 AM, <joh...@ao...> wrote: > > Dear All, > > I am doing a project with wxwidgets, wxVTK and VTK under VISTA and VC9 > environment. > I have several question as follows: > > 1. Does wxVTK support _UNICODE built wxwidgets? I would think so. non-UNICODE was my default build at the time. > 2. How can I tell the compiler to use the "non-unicode" build? In my > project under the VISTA and VC9 environment, it seems that the "_UNICODE" > has been defined so it forces me to use unicode version of wxwidgets > otherwise it won't compiled. > > Using "unicode built" ver. of wxwidgets, everything works fine without > using wxVTK, but if I use wxVTK, the compiler generates error linking > messages as follows. > > 1>------ Build started: Project: wxTRY1, Configuration: Debug Win32 ------ > 1>Compiling... > 1>TRYWXMyFrameTRY1.cpp > 1>Compiling... > 1>TRYWxFrameMain.cpp > 1>Linking... > 1> Creating library C:\TRY1\wxTRY1.lib and object > C:\TRY1\Debug\wxTRY1.exp > 1>TRYWXMyFrameTRY1.obj : error LNK2019: unresolved external symbol "public: > __thiscall wxVTKRenderWindowInteractor::wxVTKRenderWindowInteractor(class > wxWindow *,int,class wxPoint const &,class wxSize const &,long,class > wxString const &)" > (??0wxVTKRenderWindowInteractor@@QAE@PAVwxWindow@@HABVwxPoint@@ABVwxSize@@JABVwxString@@@Z) > referenced in function "public: __thiscall > TRYWXMyFrameTRY1::TRYWXMyFrameTRY1(class wxWindow *)" > (??0TRYWXMyFrameTRY1@@QAE@PAVwxWindow@@@Z) > 1>C:\TRY1\Debug\wxTRY1.exe : fatal error LNK1120: 1 unresolved externals > 1>Build log was saved at "file://c:\TRY1\Debug\BuildLog.htm" > 1>wxTRY1 - 2 error(s), 0 warning(s) > ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== I am not a WIN32 expert, but it seems your linker cannot find the cstor symbol, which would make me think that wxVTKRWI cstor is not exported properly. Are you using wxVTK in your project, are you confident with your setting for the 'declspec( dllexport)' thingy ? If not please read Q2 in the README shipped with wxVTK. wxVTK is kindda tricky to build as it relies on two configiuration : the wx one and the VTK ones. Make sure that when you compare your wx-unicode and wx-non-unicode you are also confident there are no other differences (VTK version, compiler flags...). > > I have tried to build the whole wxVTK project and samples with "non-uncode" > ver. of wxwidgets, everything's fine, but if I use "unicode" version, the > compiler generates similar linking error like in my project. I do not like the word 'similar', but I'll assume you are correct, and did not mislead two different linker errors. Again see Q2 for my suspicion. > How should I solve this problem? > PS. I am sure that there's no "_UNICODE" in my IDE's pre-processor setting. > > Environment: vc9, vista 32, wxwidgets 2.8.7, wxVTK 1.2, vtk 5.1x and all > compiled under vc9 If anything else works, give CVS HEAD a shot: http://sourceforge.net/cvs/?group_id=114757 -> cvs -d:pserver:ano...@wx...:/cvsroot/wxvtk login -> cvs -z3 -d:pserver:ano...@wx...:/cvsroot/wxvtk co -P wxVTK HTH -- Mathieu |