Where to put the -static switch?

General questions regarding the usage of CodeLite
DarkBug
CodeLite Enthusiast
Posts: 18
Joined: Tue Mar 27, 2012 5:00 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Where to put the -static switch?

Post by DarkBug »

eranif wrote:
DarkBug wrote:Another question: Where does CodeLite search for static libraries if i don't insert a library path into Project Settings->Common Settings->Linker->Library Path, but insert libraries into Project Settings->Common Settings->Linker->Libraries?
codelite is not a complier nor linker, it does not search for them, it simply activate the compiler to do this.
I know, CodeLite is a ide. But Code::Blocks is a ide, too. I have to install MinGW and wxWidgets as well as configure it for Code::Blocks, too. But i only have to add the -static switch, not the --static switch. But that should not be a problem. To use CodeLite i will just add the --static switch too and it will work.
eranif wrote: Even without knowing the configuration you can see in the build line where does ld is looking for the libraries (and from your link lines, I dont see any -static flag that is being passed to ld)
Sorry, i don't posted the new Output:

Code: Select all

----------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_lib\mswu -IC:\wxWidgets2.8\include -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.   -static -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 
mingw32-make.exe[1]: Leaving directory `C:/Users/DarkBug/Desktop/Test'
----------Build Ended----------
0 errors, 0 warnings
eranif wrote:
DarkBug wrote:but why do i in Code::Blocks just have to add the -static switch to Settings->Compiler and debugger...->Linker settings->Other linker options and it works?
Now that Jarod42 mentioned it, you need to add it to "project settings -> linker -> options"

so it will look something similar to:

Code: Select all

-s;$(shell wx-config --debug=no --unicode=yes --libs );-static
note that the -static is placed outside of the $(shell ..) expression

Eran
Thanks, but i have that already:

Compiler:

Code: Select all

-O2;-Wall;$(shell wx-config --static --cxxflags --unicode=yes --debug=no)
Linker:

Code: Select all

-static -mwindows;-s;$(shell wx-config --static --debug=no --libs --unicode=yes)
Can i configure CodeLite to use this project settings for every new project?
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Where to put the -static switch?

Post by eranif »

DarkBug wrote:Can i configure CodeLite to use this project settings for every new project?
Right click on the project and select 'Save as template'

Eran
Make sure you have read the HOW TO POST thread
DarkBug
CodeLite Enthusiast
Posts: 18
Joined: Tue Mar 27, 2012 5:00 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Where to put the -static switch?

Post by DarkBug »

Thank you. A template can only be erased again, if you delete it under C:\Program Files (x86)\CodeLite\templates\projects, or can you do that in CodeLite, too?
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Where to put the -static switch?

Post by eranif »

To erase a template you need to manually delete it from the disk

Eran
Make sure you have read the HOW TO POST thread
Post Reply