Windows backslash in paths cause build failure

Discussion about CodeLite development process and patches
zeb
CodeLite Enthusiast
Posts: 11
Joined: Wed May 12, 2010 3:44 pm
Genuine User: Yes
IDE Question: C++
Contact:

Windows backslash in paths cause build failure

Post by zeb »

Eran,

I'm having trouble building on Windows 7. I'm following ref: http://codelite.org/Developers/Windows.

I did the "git clone..." and began running the Release build in codelite_utils/codelite_utils.workspce. Calls to g++ under mingw32-make can't seem to handle windows path names with '\' delimiters.

(I installed the 2.9.5 version of wxwidgets, but then realized that the Windows build for codelite remains wired for 2.9.4 wxwidgets. So, I installed wxwidget 2.9.4, too.)

It's odd. This line copied from the codelite build window:

g++ -c "C:/ref/codelitegit/codelite_clang/clang_utils.cpp" -O2 -Wall -mthreads -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -IC:\wxWidgets-2.9.4\lib\gcc_dll\mswu -IC:\wxWidgets-2.9.4\include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -fno-keep-inline-dllexport -o ./Release/clang_utils.o -I. -I../sdk/clang/include

- Fails when called within codelite_clang build project
- Fails when called within an Msys window
- Succeeds when called within a standard Windows cmd window

If I add compiler and linker directives to codelite_clang project settings:

-IC:/wxWidgets-2.9.4/lib/gcc_dll/mswu -IC:/wxWidgets-2.9.4/include
-LC:/wxWidgets-2.9.4/lib/gcc_dll

...everything works.

Is there something that I can reinstall to fix this rather than modifying codelite projects to work around this problem?

Thanks.
Ken
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Windows backslash in paths cause build failure

Post by eranif »

This is should be a FAQ in this forum...
The problem is with your GCC, it is set to work with MSYS _or_ Cygwin

Please use a native gcc (a gcc that accepts backslashes)
zeb wrote:(I installed the 2.9.5 version of wxwidgets, but then realized that the Windows build for codelite remains wired for 2.9.4 wxwidgets. So, I installed wxwidget 2.9.4, too.)
I am not sure what you mean by "wire", but in order to build git from head, you will need wxWidgets 2.9.5 and later

Which gcc are you using? I suggest that you use the one that I provide with the the Windows installer it will work. Also make sure that it is the first MinGW the WInodws will find in the PATH environment variable

Eran
Make sure you have read the HOW TO POST thread
zeb
CodeLite Enthusiast
Posts: 11
Joined: Wed May 12, 2010 3:44 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Windows backslash in paths cause build failure

Post by zeb »

Trying this again...

Your download page for v5.1 has: codelite-5.1.0-mingw4.7.1-wx2.9.4.exe
But your page for v5.2 does not seem to have a "codelite-5.1-mingw4.7.1-wx2.9.5.exe" or equivalent which has the 2.9.5 wxwidgets.

So, I downloaded and installed: wxwidgets-295-tdm-gcc-471-32-devel.exe

I changed my PATH to remove the reference to 2.9.4 wxwidgets so that it only points to thw new 2.9.5 version.

Then, I downloaded and installed: codelite-5.2-mingw4.7.1.exe

Completely cleaned git codelite source code folder:
git clean -df & git checkout -- .

Started-up codelite. Edited Settings > Environment Variables > Default to:
WXWIN=C:\wxWidgets-2.9.5

Opened codelite_utils.workspace. Selected project: codelite_clang
When building codelite_clang:

g++ -c "C:/ref/codelitegit/codelite_clang/clang.cpp" -O2 -Wall -mthreads -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -IC:\wxWidgets-2.9.5\lib\gcc_dll\mswu -IC:\wxWidgets-2.9.5\include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -fno-keep-inline-dllexport -o ./Release/clang.o -I. -I../sdk/clang/include

...I'm seeing the same problems as before:
- Fails when called within codelite_clang build project
- Fails when called within an Msys window
- Succeeds when called within a standard Windows cmd window

g++ --version returns: g++ (tdm-1) 4.7.1
That is true when running this on both MSYS and DOS prompt

From MSYS prompt:
$ echo $PATH
.:/usr/local/bin:/mingw/bin:/bin:/c/Windows/system32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/c/Program Files (x86)/Common Files/Roxio Shared/DLLShared/:/c/Program Files (x86)/Common Files/Roxio Shared/10.0/DLLShared/:/c/Program Files (x86)/Windows Imaging/:/c/Program Files/SlikSvn/bin:/c/Program Files/SourceGear/Common/DiffMerge/:/c/tools:/c/Program Files (x86)/Seapine/TestTrack:/c/Program Files (x86)/Pandoc/bin:/c/Program Files/Microsoft Network Monitor 3/:/c/MinGW-4.7.1/bin:/c/Program Files (x86)/Git/bin:/c/wxWidgets-2.9.5/lib/gcc_dll

$ ls -l /mingw/bin
ls: /mingw/bin: No such file or directory

$ command -v g++
/c/MinGW-4.7.1/bin/g++

Thanks.
Ken B.
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Windows backslash in paths cause build failure

Post by eranif »

codelite is best working with CMD.EXE and not MSYS/CYGWIN et al
zeb wrote:But your page for v5.2 does not seem to have a "codelite-5.1-mingw4.7.1-wx2.9.5.exe" or equivalent which has the 2.9.5 wxwidgets
Its explained in the "Announcement" forum: there are no longer 3 different installer for Windows, instead 1 installer with MinGW+codelite
I also provide a separate installer for wxWidgets 2.9.5 - as you can see here
zeb wrote:..I'm seeing the same problems as before:
- Fails when called within codelite_clang build project
- Fails when called within an Msys window
This is because your gcc from MSYS is used instead of the one that codelite installed. I wrote earlier:
eranif wrote:Also make sure that it is the first MinGW the WInodws will find in the PATH environment variable
So either edit your PATH environment variable (system wise) OR (better) update your environment variables within codelite:

Code: Select all

SHELL=cmd.exe
PATH=C:\MinGW-4.7.1\bin;$PATH
EDIT: here is another post with the same proble:
http://forums.codelite.org/viewtopic.php?f=3&t=2161

Eran
Make sure you have read the HOW TO POST thread
zeb
CodeLite Enthusiast
Posts: 11
Joined: Wed May 12, 2010 3:44 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Windows backslash in paths cause build failure

Post by zeb »

Eran,

The problem was not with PATH or multiple copies of g++.exe (there is only one copy of g++.exe on my hard drive).

The fix was just adding SHELL=cmd.exe to the codelite environment variables.

Thanks for the help!
Ken
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Windows backslash in paths cause build failure

Post by eranif »

zeb wrote:Eran,

The problem was not with PATH or multiple copies of g++.exe (there is only one copy of g++.exe on my hard drive).

The fix was just adding SHELL=cmd.exe to the codelite environment variables.

Thanks for the help!
Ken
Maybe its time that I will fix the wx-config to produce forward slashes output on Windows ( I often see this issues on the forum )

Eran
Make sure you have read the HOW TO POST thread
Gibbon1
CodeLite Expert
Posts: 167
Joined: Fri Jul 22, 2011 5:32 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: Windows backslash in paths cause build failure

Post by Gibbon1 »

BTW: For my setup I had to add SHELL=CMD.EXE to the command line for make to prevent it from finding SH,exe in my path. Adding it to the environment did not work.
Post Reply