Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
wxWidgets app only compile with SHARED=1
mosfet:
Hi,
I have developped a wxWidget(2.6.2) app on Windows XP but I can only link with the shared version.
However I would like to use the static one, how can I do, everything I tried failed.
I have compiled wxWidget both as shared and static and when in linker and compiler option I put
Directories
$(WX_DIR)\lib\gcc_dll\msw
$(WX_DIR)\include
$(WX_DIR)\contrib\include
.\wxdockit\include
linker:
$(WX_DIR)\lib\gcc_dll
.\wxdockit\lib\gcc_dll
it works.
When I replace all the gcc_dll by gcc_lib it failed during linking while gcc_lib exists and holds my static libs.
I don't get it ...
Switching to target: default
Linking executable: SmartTester.exe
.objs\MsgDockBar.o:MsgDockBar.cpp:(.text+0x99): undefined reference to `_imp__wxNotebookNameStr'
.objs\MsgDockBar.o:MsgDockBar.cpp:(.text+0xe1): undefined reference to `_imp__wxDefaultSize'
.objs\MsgDockBar.o:MsgDockBar.cpp:(.text+0xea): undefined reference to `_imp__wxDefaultPosition'
.objs\MsgDockBar.o:MsgDockBar.cpp:(.text+0x108): undefined reference to `_imp___ZN10wxNotebookC1EP8wxWindowiRK7wxPointRK6wxSizelRK8wxString'
.objs\MsgDockBar.o:MsgDockBar.cpp:(.text+0x1a9): undefined reference to `_imp___ZN16wxDockWindowBase9SetClientEP8wxWindowb'
.objs\MsgDockBar.o:MsgDockBar.cpp:(.text+0x297): undefined reference to `_imp__wxNotebookNameStr'
.objs\MsgDockBar.o:MsgDockBar.cpp:(.text+0x2df): undefined reference to `_imp__wxDefaultSize'
.objs\MsgDockBar.o:MsgDockBar.cpp:(.text+0x2e8): undefined reference to `_imp__wxDefaultPosition'
.objs\MsgDockBar.o:MsgDockBar.cpp:(.text+0x306): undefined reference to `_imp___ZN10wxNotebookC1EP8wxWindowiRK7wxPointRK6wxSizelRK8wxString'
.objs\MsgDockBar.o:MsgDockBar.cpp:(.text+0x3a7): undefined reference to `_imp___ZN16wxDockWindowBase9SetClientEP8wxWindowb'
.objs\MsgDockBar.o:MsgDockBar.cpp:(.text$_ZN12wxDockWindowD2Ev[wxDockWindow::~wxDockWindow()]+0xa): undefined reference to `_imp___ZTV12wxDockWindow'
.objs\MsgDockBar.o:MsgDockBar.cpp:(.text$_ZN16wxDockWindowBaseD2Ev[wxDockWindowBase::~wxDockWindowBase()]+0x39): undefined reference to `_imp___ZTV16wxDockWindowBase'
.objs\MsgDockBar.o:MsgDockBar.cpp:(.text$_ZN11wxMiniFrameD2Ev[wxMiniFrame::~wxMiniFrame()]+0xa): undefined reference to `_imp___ZTV11wxMiniFrame'
.objs\MsgDockBar.o:MsgDockBar.cpp:(.text$_ZN11wxMiniFrameD2Ev[wxMiniFrame::~wxMiniFrame()]+0x1a): undefined reference to `_imp___ZN7wxFrameD2Ev'
.objs\MsgDockBar.o:MsgDockBar.cpp:(.text$_ZN12wxMouseEventD1Ev[wxMouseEvent::~wxMouseEvent()]+0xa): undefined reference to `_imp___ZTV12wxMouseEvent'
.objs\MsgDockBar.o:MsgDockBar.cpp:(.text$_ZN7wxEventD2Ev[wxEvent::~wxEvent()]+0xa): undefined reference to `_imp___ZTV7wxEvent'
.objs\MsgDockBar.o:MsgDockBar.cpp:(.text$_ZN8wxObjectD2Ev[wxObject::~wxObject()]+0xa): undefined reference to `_imp___ZTV8wxObject'
.objs\MsgDockBar.o:MsgDockBar.cpp:(.text$_ZN8wxObjectD2Ev[wxObject::~wxObject()]+0x1a): undefined reference to `_imp___ZN8wxObject5UnRefEv'
.objs\MsgDockBar.o:MsgDockBar.cpp:(.text$_ZN12wxStringBaseC2EPKc[wxStringBase::wxStringBase(char const*)]+0x7): undefined reference to `_imp___ZN12wxStringBase4nposE'
.objs\MsgDockBar.o:MsgDockBar.cpp:(.text$_ZN12wxStringBaseC2EPKc[wxStringBase::wxStringBase(char const*)]+0x27): undefined reference to `_imp___ZN12wxStringBase8InitWithEPKcjj'
.objs\MsgDockBar.o:MsgDockBar.cpp:(.text$_ZN12wxDockWindowC2EP8wxWindowiRK8wxStringRK7wxPointRK6wxSizeS4_j[wxDockWindow::wxDockWindow(wxWindow*, int, wxString const&, wxPoint const&, wxSize const&, wxString const&, unsigned int)]+0x4b): undefined reference to `_imp___ZTV12wxDockWindow'
...
Is there a mean under windows to see exactly with what parameters gcc is called ?
Urxae:
--- Quote from: mosfet on December 14, 2005, 04:58:49 pm ---Is there a mean under windows to see exactly with what parameters gcc is called ?
--- End quote ---
Settings -> Compiler -> Other -> set "Compiler logging" to "Full command line"
tiwag:
which version of codeblocks are you using ? ( a recent SVN build or 1.0RC2 )
if you have a recent SVN build of CB, you can use the following project file, which builds static wx-apps fine
you just have to edit the global variable WX (add Base directory)
--- Code: ---<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="2" />
<Project>
<Option title="wx static" />
<Option pch_mode="0" />
<Option compiler="0" />
<Build>
<Target title="default">
<Option output="wxwidgets_static.exe" />
<Option type="0" />
<Option compiler="0" />
<Option includeInTargetAll="1" />
<Option projectResourceIncludeDirsRelation="0" />
</Target>
<Environment>
<Variable name="WX_CFG" value="" />
</Environment>
</Build>
<Compiler>
<Add option="-pipe" />
<Add option="-mthreads" />
<Add option="-Winvalid-pch" />
<Add option='-include "wx_pch.h"' />
<Add option="-D__GNUWIN32__" />
<Add option="-D__WXMSW__" />
<Add option="-DUSE_PCH" />
<Add directory="$(#WX.include)" />
<Add directory="$(#WX.lib)\gcc_lib$(WX_CFG)\msw" />
<Add directory="$(#WX)\contrib\include" />
</Compiler>
<ResourceCompiler>
<Add directory="$(#WX.include)" />
</ResourceCompiler>
<Linker>
<Add library="wxmsw26" />
<Add library="winspool" />
<Add library="winmm" />
<Add library="shell32" />
<Add library="comctl32" />
<Add library="ctl3d32" />
<Add library="odbc32" />
<Add library="advapi32" />
<Add library="wsock32" />
<Add library="opengl32" />
<Add library="glu32" />
<Add library="ole32" />
<Add library="oleaut32" />
<Add library="uuid" />
<Add directory="$(#WX.lib)\gcc_lib$(WX_CFG)" />
<Add directory="$(#WX.lib)" />
</Linker>
<Unit filename="main.cpp">
<Option compilerVar="CPP" />
<Option target="default" />
</Unit>
<Unit filename="main.h">
<Option compilerVar="" />
<Option compile="0" />
<Option link="0" />
<Option target="default" />
</Unit>
<Unit filename="wx_pch.h">
<Option compilerVar="" />
<Option compile="0" />
<Option link="0" />
<Option target="default" />
</Unit>
<Unit filename="wx_pch.h">
<Option compilerVar="CPP" />
<Option link="0" />
<Option weight="0" />
<Option target="default" />
</Unit>
</Project>
</CodeBlocks_project_file>
--- End code ---
mosfet:
I have Codeblocks 1.0RC2 because I never managed to compiled a SVN version.
But I didin't see in Cb 1.0RC2 that I could specify wxWidgets as a static lib.
However it assumes that wxWidget has been compiled as a monolithic lib and it's not always the case.
Developers should ask user to indicate how was compiled wxwidgets (shared | monolithic).
Maybe they should add in Project Options :
Using wxWidgets DLL NoMonolithic
Using wxWidgets DLL Monolithic
Using wxWidgets static NoMonoLithic
Using wxWidgets static MonoLithic
--- Quote from: tiwag on December 14, 2005, 06:17:17 pm ---which version of codeblocks are you using ? ( a recent SVN build or 1.0RC2 )
if you have a recent SVN build of CB, you can use the following project file, which builds static wx-apps fine
you just have to edit the global variable WX (add Base directory)
--- Code: ---<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="2" />
<Project>
<Option title="wx static" />
<Option pch_mode="0" />
<Option compiler="0" />
<Build>
<Target title="default">
<Option output="wxwidgets_static.exe" />
<Option type="0" />
<Option compiler="0" />
<Option includeInTargetAll="1" />
<Option projectResourceIncludeDirsRelation="0" />
</Target>
<Environment>
<Variable name="WX_CFG" value="" />
</Environment>
</Build>
<Compiler>
<Add option="-pipe" />
<Add option="-mthreads" />
<Add option="-Winvalid-pch" />
<Add option='-include "wx_pch.h"' />
<Add option="-D__GNUWIN32__" />
<Add option="-D__WXMSW__" />
<Add option="-DUSE_PCH" />
<Add directory="$(#WX.include)" />
<Add directory="$(#WX.lib)\gcc_lib$(WX_CFG)\msw" />
<Add directory="$(#WX)\contrib\include" />
</Compiler>
<ResourceCompiler>
<Add directory="$(#WX.include)" />
</ResourceCompiler>
<Linker>
<Add library="wxmsw26" />
<Add library="winspool" />
<Add library="winmm" />
<Add library="shell32" />
<Add library="comctl32" />
<Add library="ctl3d32" />
<Add library="odbc32" />
<Add library="advapi32" />
<Add library="wsock32" />
<Add library="opengl32" />
<Add library="glu32" />
<Add library="ole32" />
<Add library="oleaut32" />
<Add library="uuid" />
<Add directory="$(#WX.lib)\gcc_lib$(WX_CFG)" />
<Add directory="$(#WX.lib)" />
</Linker>
<Unit filename="main.cpp">
<Option compilerVar="CPP" />
<Option target="default" />
</Unit>
<Unit filename="main.h">
<Option compilerVar="" />
<Option compile="0" />
<Option link="0" />
<Option target="default" />
</Unit>
<Unit filename="wx_pch.h">
<Option compilerVar="" />
<Option compile="0" />
<Option link="0" />
<Option target="default" />
</Unit>
<Unit filename="wx_pch.h">
<Option compilerVar="CPP" />
<Option link="0" />
<Option weight="0" />
<Option target="default" />
</Unit>
</Project>
</CodeBlocks_project_file>
--- End code ---
--- End quote ---
Michael:
--- Quote from: mosfet on December 14, 2005, 06:50:38 pm ---I have Codeblocks 1.0RC2 because I never managed to compiled a SVN version.
--- End quote ---
You can get an already SVN compiled version from Therion.
--- Quote from: mosfet on December 14, 2005, 06:50:38 pm ---But I didin't see in Cb 1.0RC2 that I could specify wxWidgets as a static lib.
--- End quote ---
AFAIK, you should add the needed libraries to the linker. I do not think that there is a special option for that.
Michael
Navigation
[0] Message Index
[#] Next page
Go to full version