User forums > General (but related to Code::Blocks)
Cross Linking of a Linux Project in Windows
apaeffgen:
Hi all,
i am new to Codeblocks /wxWidgets. So maybe the problem is trivial.
On a samba share i have set up a linux CodeBlocks project on Centos, tested some gui-features and build the project for Linux. No Problems so far.
When i open the same project with codeblocks on Windows i get some linker errors.
I use Codeblocks with the mingw included, wxpack and the same project-settings as in the windows example project, that builds without errors.
The build-errors in the error log:
auto-import)
Info: resolving wxAppConsole::ms_appInitFn by linking to __imp___ZN12wxAppConsole12ms_appInitFnE (auto-import)
C:\Programme\CodeBlocks\MinGW\bin\ld.exe: warning: auto-importing has been activated without --enable-auto-import specified on the command line.
This should work unless it involves constant data structures referencing symbols from auto-imported DLLs.obj\Debug\Windows2Main.o: In function `_ZNK12wxWindowBase10GetMinSizeEv':
C:/wxWidgetsPack/include/wx/window.h:(.text$_ZN12wxStringBase10ConcatSelfEjPKc[wxStringBase::ConcatSelf(unsigned int, char const*)]+0x22): undefined reference to `wxStringBase::ConcatSelf(unsigned int, char const*, unsigned int)'
C:/wxWidgetsPack/include/wx/window.h:(.text$_ZN12wxStringBaseC2EPKc[wxStringBase::wxStringBase(char const*)]+0x25): undefined reference to `wxStringBase::InitWith(char const*, unsigned int, unsigned int)'
C:/wxWidgetsPack/include/wx/window.h:(.text$_ZN12wxStringBaseC2ERKS_[wxStringBase::wxStringBase(wxStringBase const&)]+0x47): undefined reference to `wxOnAssert(char const*, int, char const*, char const*, char const*)'
obj\Debug\Windows2App.o: In function `_ZN12wxEvtHandler12TryValidatorER7wxEvent':
C:/wxWidgetsPack/include/wx/app.h:(.rdata$_ZTV11Windows2App[vtable for Windows2App]+0x44): undefined reference to `wxApp::Initialize(int&, char**)'
C:/wxWidgetsPack/include/wx/app.h:(.rdata$_ZTV11Windows2App[vtable for Windows2App]+0x90): undefined reference to `wxAppConsole::OnAssertFailure(char const*, int, char const*, char const*, char const*)'
C:/wxWidgetsPack/include/wx/app.h:(.rdata$_ZTV11Windows2App[vtable for Windows2App]+0x94): undefined reference to `wxAppConsole::OnAssert(char const*, int, char const*, char const*)'
collect2: ld returned 1 exit status
Only the linker has some problems.
The System Specs:
WinXP Home SP3
Codeblocks 8.02 with bundled mingw
wxpack for wxWidgets 2.8.8
On Linux Codeblocks 8.02
wxWidgets 2.8.8
P.S. if i forgot relevant info, please excuse me as a newbie.
Thanks in advance for the help
Andreas
TDragon:
Are you trying to link object files compiled without wxUNICODE #defined with a Unicode build of wxWidgets?
apaeffgen:
Hi TDragon,
i forgot that. Sorry.
The log now says:
Info: resolving vtable for wxwxMenuItemListNodeby linking to __imp___ZTV20wxwxMenuItemListNode (auto-import)
Info: resolving wxAppConsole::ms_appInstance by linking to __imp___ZN12wxAppConsole14ms_appInstanceE (auto-import)
Info: resolving wxAppConsole::ms_appInitFn by linking to __imp___ZN12wxAppConsole12ms_appInitFnE (auto-import)
C:\Programme\CodeBlocks\MinGW\bin\ld.exe: warning: auto-importing has been activated without --enable-auto-import specified on the command line.
This should work unless it involves constant data structures referencing symbols from auto-imported DLLs.obj\Debug\Windows2Main.o: In function `_ZNK12wxWindowBase10GetMaxSizeEv':
C:/wxWidgetsPack/include/wx/window.h:(.text$_ZN12wxStringBase10ConcatSelfEjPKc[wxStringBase::ConcatSelf(unsigned int, char const*)]+0x22): undefined reference to `wxStringBase::ConcatSelf(unsigned int, char const*, unsigned int)'
C:/wxWidgetsPack/include/wx/window.h:(.text$_ZN12wxStringBaseC2EPKc[wxStringBase::wxStringBase(char const*)]+0x25): undefined reference to `wxStringBase::InitWith(char const*, unsigned int, unsigned int)'
obj\Debug\Windows2App.o: In function `_ZN12wxEvtHandler12TryValidatorER7wxEvent':
C:/wxWidgetsPack/include/wx/app.h:(.rdata$_ZTV11Windows2App[vtable for Windows2App]+0x44): undefined reference to `wxApp::Initialize(int&, char**)'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 11 seconds)
3 errors, 1 warnings
Any other hints?
And thanks for the usefull tipp.
Best regards
Andreas
TDragon:
Actually, I should've said "wxUSE_UNICODE" (note the USE_).
Jenna:
Did you clean the project tree before compiling, or do you use another target for building on win ?
I don't know what happens if you try to link object-files built on linux with the MinGW linker
Navigation
[0] Message Index
[#] Next page
Go to full version