CodeLite statisch linken



  • Guten Tag,

    momentan teste ich die IDE CodeLite aus. Leider bekomme ich es nicht hin, mit der IDE, g++ und wxWidgets statisch zu linken. Sowohl wenn ich unter Build Settings...->gnu g++->Linker options->New..., als auch unter Workspace->Open Active Project Settings...->Global Settings->Linker->Options den Switch -static hinzugefügt habe, kann ich die exe so nicht öffnen. Es erscheint immer eine Meldung, das *.dll fehlt. Ich hoffe ihr könnt mir weiterhelfen.

    Mit freundlichen Grüßen,
    DarkBug



  • *push*



  • Welche Version des gcc/g++ hast du?

    MfG f.-th.



  • Da gibt es auch schon Beiträge dazu hier im Forum.

    Hier der Compiler/Linker Schalter: -static-libstdc++

    MfG f.-th.



  • Ich benutze CodeLite 3.5.5377, MinGW4.6.1 und wxWidgets 2.9.2.
    Ich habe diesen Schalter nun auch probiert, jedoch funktioniert es nicht. Wo muss ich diesen Schalter einfügen? Ich möchte, das der Schalter immer direkt für alle Projekte gilt.

    Muss ich eventuell Schalter entfernen?

    1. Settings->Build Settings...->gnu g++->Linker options->New...
    Standardwerte:
    Switch: -fopenmp Help: Enable OpenMP (linkage).
    Switch: -s Help: Remove all symbol table and relocation information from the executable.

    2. Settings->Build Settings...->gnu g++->Tools->Shared Object Linker
    Standardwerte: g++ -shared -fPIC

    3. Workspace->Open Active Project Settings...->Common Settings->Linker->Options
    Standardwerte: -mwindows;$(shell wx-config --debug=yes --libs --unicode=yes)

    Oder ganz woanders?

    P.S.: Ist der Schalter -static-libstdc++ nicht nur für die Standard Libraries? Ich möchte auch die wxWidgets Libraries statisch linken.



  • Kann es eventuell etwas damit zu tun haben, dass die Felder unter Settings->Build Settings...->gnu g++->Advanced->Global Paths (Include Path und Libraries Path) leer sind?



  • Ich bekomme es zum verrecken nicht hin ein statisches Build mit CodeLite zu erstellen!

    Benutzte Toolchain:
    IDE: CodeLite 3.5.5377
    Compiler: Unofficial TDM MinGW_v4.4.1
    wxWidgets: wxPack v2.8.12.01

    Ich erstelle ein neues wxWidgets HelloWorld Projekt. Kompiliere das Projekt mit -mwindows;(shell wx-config --debug=no --libs --unicode=yes) und es läuft. Dann möchte ich das Programm auf einem Nicht-Entwicklerrechner laufen lassen und bekomme die Fehlermeldung, das wxmsw28u_gcc.dll nicht gefunden werden kann. Daraufhin kompiliere ich das Programm mit: -mwindows;(shell wx-config --debug=no --libs --unicode=yes --static) und ich bekomme nur:

    ----------Build Started--------
    C:\Windows\system32\cmd.exe /c ""mingw32-make.exe"  -j 4 -f "Test_wsp.mk""
    ----------Building project:[ Test - Release ]----------
    mingw32-make.exe[1]: Entering directory `C:/Users/DarkBug/Desktop/Test'
    g++  -c  "C:/Users/DarkBug/Desktop/Test/main.cpp" -O2 -Wall -mthreads -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -IC:\wxWidgets2.8\lib\gcc_dll\mswu -IC:\wxWidgets2.8\include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0  -Wno-attributes   -o ./Release/main.o -I. 
    g++ -o ./Release/Test @"C:\Users\DarkBug\Desktop\Test\Test.txt" -L.   -mwindows -s  -mthreads -LC:\wxWidgets2.8\lib\gcc_lib -lwxmsw28u -lwxtiff -lwxjpeg -lwxpng -lwxzlib -lwxregexu -lwxexpat -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwxregexu -lwinspool -lwinmm -lshell32 -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32 -lodbc32 
    ./Release/main.o:main.cpp:(.text+0x4): undefined reference to `_imp___ZN12wxAppConsole14ms_appInstanceE'
    ./Release/main.o:main.cpp:(.text+0x10): undefined reference to `_imp___ZN12wxAppConsole12ms_appInitFnE'
    ./Release/main.o:main.cpp:(.text+0x3f): undefined reference to `_imp___Z7wxEntryP11HINSTANCE__S0_Pci'
    ./Release/main.o:main.cpp:(.text+0x60): undefined reference to `_imp___ZN12wxAppConsole17CheckBuildOptionsEPKcS1_'
    ./Release/main.o:main.cpp:(.text+0x77): undefined reference to `_imp___ZN5wxAppC2Ev'
    ./Release/main.o:main.cpp:(.text+0xad): undefined reference to `_imp___ZN12wxStringBase4nposE'
    ./Release/main.o:main.cpp:(.text+0xce): undefined reference to `_imp___ZN12wxStringBase8InitWithEPKwjj'
    ./Release/main.o:main.cpp:(.text+0xf2): undefined reference to `_imp__wxFrameNameStr'
    ./Release/main.o:main.cpp:(.text+0x112): undefined reference to `_imp__wxDefaultPosition'
    ./Release/main.o:main.cpp:(.text+0x11e): undefined reference to `_imp___ZN11wxFrameBaseC2Ev'
    ./Release/main.o:main.cpp:(.text+0x123): undefined reference to `_imp___ZTV7wxFrame'
    ./Release/main.o:main.cpp:(.text+0x131): undefined reference to `_imp___ZN7wxFrame4InitEv'
    ./Release/main.o:main.cpp:(.text+0x16e): undefined reference to `_imp___ZN7wxFrame6CreateEP8wxWindowiRK8wxStringRK7wxPointRK6wxSizelS4_'
    ./Release/main.o:main.cpp:(.text+0x1e1): undefined reference to `_imp__wxButtonNameStr'
    ./Release/main.o:main.cpp:(.text+0x205): undefined reference to `_imp___ZN12wxWindowBaseC2Ev'
    ./Release/main.o:main.cpp:(.text+0x20a): undefined reference to `_imp___ZTV8wxWindow'
    ./Release/main.o:main.cpp:(.text+0x240): undefined reference to `_imp___ZN8wxWindow4InitEv'
    ./Release/main.o:main.cpp:(.text+0x245): undefined reference to `_imp___ZTV9wxControl'
    ./Release/main.o:main.cpp:(.text+0x259): undefined reference to `_imp___ZN15wxBaseArrayLongC2Ev'
    ./Release/main.o:main.cpp:(.text+0x25e): undefined reference to `_imp___ZTV12wxButtonBase'
    ./Release/main.o:main.cpp:(.text+0x269): undefined reference to `_imp___ZTV8wxButton'
    ./Release/main.o:main.cpp:(.text+0x277): undefined reference to `_imp__wxDefaultValidator'
    ./Release/main.o:main.cpp:(.text+0x288): undefined reference to `_imp__wxDefaultSize'
    ./Release/main.o:main.cpp:(.text+0x2b2): undefined reference to `_imp___ZN8wxButton6CreateEP8wxWindowiRK8wxStringRK7wxPointRK6wxSizelRK11wxValidatorS4_'
    ./Release/main.o:main.cpp:(.text+0x2ef): undefined reference to `_imp__wxEVT_COMMAND_BUTTON_CLICKED'
    ./Release/main.o:main.cpp:(.text+0x32e): undefined reference to `_imp___ZN12wxEvtHandler7ConnectEiiiM8wxObjectFvR7wxEventEPS0_PS_'
    ./Release/main.o:main.cpp:(.text+0x3b6): undefined reference to `_imp___ZN9wxControlD2Ev'
    ./Release/main.o:main.cpp:(.text+0x3cb): undefined reference to `_imp___ZN13wxControlBaseD2Ev'
    ./Release/main.o:main.cpp:(.text+0x3d8): undefined reference to `_imp___ZN12wxWindowBaseD2Ev'
    ./Release/main.o:main.cpp:(.text+0x3e9): undefined reference to `_imp___ZN11wxFrameBaseD2Ev'
    ./Release/main.o:main.cpp:(.text$_ZNK12wxWindowBase7GetNameEv[wxWindowBase::GetName() const]+0x2a): undefined reference to `_imp__wxEmptyString'
    ./Release/main.o:main.cpp:(.text$_ZN9wxMiniAppD1Ev[wxMiniApp::~wxMiniApp()]+0x10): undefined reference to `_imp___ZN5wxAppD2Ev'
    ./Release/main.o:main.cpp:(.text$_ZN9wxMiniAppD0Ev[wxMiniApp::~wxMiniApp()]+0x15): undefined reference to `_imp___ZN5wxAppD2Ev'
    ./Release/main.o:main.cpp:(.text$_ZN9wxControl7CommandER14wxCommandEvent[wxControl::Command(wxCommandEvent&)]+0x7): undefined reference to `_imp___ZN9wxControl14ProcessCommandER14wxCommandEvent'
    ./Release/main.o:main.cpp:(.text$_ZN12wxWindowBase18SetInitialBestSizeERK6wxSize[wxWindowBase::SetInitialBestSize(wxSize const&)]+0x7): undefined reference to `_imp___ZN12wxWindowBase14SetInitialSizeERK6wxSize'
    ./Release/main.o:main.cpp:(.text$_ZNK9wxControl20GetDefaultAttributesEv[wxControl::GetDefaultAttributes() const]+0x1c): undefined reference to `_imp___ZN9wxControl25GetClassDefaultAttributesE15wxWindowVariant'
    ./Release/main.o:main.cpp:(.text$_ZNK12wxWindowBase10HasCaptureEv[wxWindowBase::HasCapture() const]+0x8): undefined reference to `_imp___ZN12wxWindowBase10GetCaptureEv'
    ./Release/main.o:main.cpp:(.text$_ZN12wxWindowBase19SetAcceleratorTableERK18wxAcceleratorTable[wxWindowBase::SetAcceleratorTable(wxAcceleratorTable const&)]+0x19): undefined reference to `_imp___ZN8wxObject3RefERKS_'
    ./Release/main.o:main.cpp:(.text$_ZN12wxWindowBase7SetNameERK8wxString[wxWindowBase::SetName(wxString const&)]+0x12): undefined reference to `_imp___ZN12wxStringBaseaSERKS_'
    ./Release/main.o:main.cpp:(.text$_ZN12wxButtonBaseD0Ev[wxButtonBase::~wxButtonBase()]+0xb): undefined reference to `_imp___ZTV12wxButtonBase'
    ./Release/main.o:main.cpp:(.text$_ZN12wxButtonBaseD0Ev[wxButtonBase::~wxButtonBase()]+0x19): undefined reference to `_imp___ZN9wxControlD2Ev'
    ./Release/main.o:main.cpp:(.text$_ZN12wxButtonBaseD1Ev[wxButtonBase::~wxButtonBase()]+0xb): undefined reference to `_imp___ZTV12wxButtonBase'
    ./Release/main.o:main.cpp:(.text$_ZN12wxButtonBaseD1Ev[wxButtonBase::~wxButtonBase()]+0x15): undefined reference to `_imp___ZN9wxControlD2Ev'
    ./Release/main.o:main.cpp:(.text$_ZN9wxMiniApp7OnClickER14wxCommandEvent[wxMiniApp::OnClick(wxCommandEvent&)]+0x1f): undefined reference to `_imp___ZN12wxWindowBase5CloseEb'
    collect2: ld returned 1 exit status
    mingw32-make.exe[1]: *** [Release/Test] Error 1
    mingw32-make.exe: *** [All] Error 2
    mingw32-make.exe[1]: Leaving directory `C:/Users/DarkBug/Desktop/Test'
    ----------Build Ended----------
    44 errors, 0 warnings
    

    Selbst wenn ich in meinen Projekt Optionen unter Linker->Library Paths C:/wxWidgets2.8/lib/gcc_lib und unter Linker->Libraries libwxmsw28u.a;libwxbase28u.a einfüge klappt es nicht. Das Ergebnis sind genau die gleichen Fehler.


Anmelden zum Antworten