Page 1 of 1

CodeLiteDir using \ and confusing gcc

Posted: Tue May 14, 2013 7:43 am
by ascholer
I've noticed CodeLite setes the CodeLiteDir variable using a backslash and that seems to confuse gcc when it is used to build up longer paths.
This is my Env Vars:

Code: Select all

CodeLiteDir=C:\CodeLite
WXWIN=$(CodeLiteDir)/wxWidgets-2.9.4
PATH=$(WXWIN)/lib/gcc_dll;$(CodeLiteDir);$(CodeLiteDir)/MinGW-4.4.1/bin;$(CodeLiteDir)/wxWidgets-2.9.4/lib/gcc_dll;$(PATH)
WXCFG=gcc_dll/mswu
UNIT_TEST_PP_SRC_DIR=$(CodeLiteDir)\UnitTest++-1.3
If I try to say build a UnitTest++ project, it produces this:
g++ -c "C:/Users/Andrew/Desktop/clut/main.cpp" -g -o Debug/main.o -I. -IC:\CodeLite\UnitTest++-1.3/src -I.
And g++ complains about a missing header.

If I force add:
-Ic:/CodeLite/UnitTest++-1.3/src
Everything builds OK (well linker dies because of the same issue...)

How do I get the built in vars to handle slashes appropriately?

Re: CodeLiteDir using \ and confusing gcc

Posted: Tue May 14, 2013 8:56 am
by eranif
You don't provide your codelite version, nor the build output as requested here:
HOW TO POST

In addition, why don't you change the value of CodeLiteDir environment variable to include slashes instead of backslashes?


Eran

Re: CodeLiteDir using \ and confusing gcc

Posted: Wed May 15, 2013 3:09 am
by ascholer
Sorry...
Version 5.1 (Downloaded the CodeLite/MinGW/wxWidgets bundle.

Using the basic UnitTest project, get this build output:

Code: Select all

C:\Windows\system32\cmd.exe /c "mingw32-make.exe -j 4 -e -f  "cltestwx_wsp.mk""
----------Building project:[ clut - Debug ]----------
mingw32-make[1]: Entering directory `c:/Users/Andrew/Desktop/clut'
codelitegcc g++  -c  "C:/Users/Andrew/Desktop/clut/main.cpp" -g  -o Debug/main.o -I. -IC:\CodeLite\UnitTest++-1.3/src -I.
C:/Users/Andrew/Desktop/clut/main.cpp:1:24: fatal error: UnitTest++.h: No such file or directory
compilation terminated.
mingw32-make[1]: *** [Debug/main.o] Error 1
mingw32-make.exe: *** [All] Error 2
clut.mk:96: recipe for target `Debug/main.o' failed
mingw32-make[1]: Leaving directory `c:/Users/Andrew/Desktop/clut'
cltestwx_wsp.mk:4: recipe for target `All' failed
1 errors, 0 warnings
If I change my slashes to this:

Code: Select all

CodeLiteDir=C:/CodeLite
MYDIR=C:/CodeLite
UNIT_TEST_PP_SRC_DIR=$(CodeLiteDir)/UnitTest++-1.3
Everything works great, but CodeLite helpfully changes the slashes back each time it starts up. I could hardcode it in as some other variable, but I like the autoset... trying to use it portably, I think I can live without the settings that get placed in AppData/Roaming, but would be nice if I could get the path it autofills to use slashes that gcc likes.