Configure codelite to use msvc toolchain

Discussion about CodeLite development process and patches
smartmobili
CodeLite Enthusiast
Posts: 30
Joined: Wed May 20, 2009 1:54 am
Contact:

Configure codelite to use msvc toolchain

Post by smartmobili »

Hi,

me again ;-)
Now cegcc is configured I have some source code that can only be compiled with msvc targetting Windows Mobile.
I have started from VC++ compiler template and I am trying to compile my project.
First issue I have is with preprocessor because I am supposed to use the following defines :

/D_WIN32_WCE=0x420 /DUNDER_CE /DWIN32_PLATFORM_PSPC /DWINCE /D_WINDOWS /DARM /D_ARM_ /D_UNICODE
/DUNICODE

So I have added them in Compiler Switches but then when I build my solution I cannot see them :

cl.exe /nologo /c "C:/cygwin-1.7/home/Vincent/projects/gynoid/trunk/src/gynoid/src/GDAddrBook.cpp" -g /Fo./Debug/GDAddrBook.obj "/IC:/Program Files/Microsoft Visual Studio 9.0/VC/ce/include" "/IC:/Program Files/Windows Mobile 5.0 SDK R2/PocketPC/Include/Armv4i" "/I." "/I." "/I../../include"

What am I doing wrong ?
User avatar
eranif
CodeLite Plugin
Posts: 6367
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Configure codelite to use msvc toolchain

Post by eranif »

smartmobili wrote:So I have added them in Compiler Switches but then when I build my solution I cannot see them :
Wrong place :D

You should add them into the project settings (pretty similar to the visual studio).
right click on the project -> settings -> compiler -> preprocessor

and add them as semi-colon list like this:

Code: Select all

_WIN32_WCE=0x420;UNDER_CE;WIN32_PLATFORM_PSPC
etc..

In general, codelite's project settings is modeled after VS settings (mainly)
Eran
Make sure you have read the HOW TO POST thread
smartmobili
CodeLite Enthusiast
Posts: 30
Joined: Wed May 20, 2009 1:54 am
Contact:

Re: Configure codelite to use msvc toolchain

Post by smartmobili »

Ok I have also added the following flags in preprocessor /FD /EHsc /Gm /MTd /GS- /fp:fast /GR- /W3 /c /Zi /TP
event if I find it weird to put it here.
Anyway I can see there are added as shown below :

cl.exe /nologo /c "C:/cygwin-1.7/home/Vincent/projects/gynoid/trunk/src/gynoid/src/wince/OS_GDImaging.cpp" /D_DEBUG /D_WIN32_WCE=0x502/DUNDER_CE /DWIN32_PLATFORM_PSPC /DWINCE /D_WINDOWS /DARM /D_ARM_ /D_UNICODE /DGYNOID_EXPORTS /FD /EHsc /Gm /MTd /GS- /fp:fast /GR- /W3 /c /Zi /TP /Fo./Debug/OS_GDImaging.obj "/I." "/IC:/Program Files/Microsoft Visual Studio 9.0/VC/ce/ATLMFC/INCLUDE" "/IC:/Program Files/Microsoft Visual Studio 9.0/VC/ce/INCLUDE" "/IC:/Program Files/Windows Mobile 5.0 SDK R2/PocketPC/Include/Armv4i" "/I." "/I../../include"

I think you should have a database for compiler settings where people could store common toolchain for codelite.
for instance I could provide the following :

msvc-ce-wm5
msvc-ce-wm6
arm-mingw32ce

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

Re: Configure codelite to use msvc toolchain

Post by eranif »

smartmobili wrote:Ok I have also added the following flags in preprocessor /FD /EHsc /Gm /MTd /GS- /fp:fast /GR- /W3 /c /Zi /TP
These should be in the 'Compiler Options' text field, like this:
/FD;/EHs;/Gm etc.

Eran
Make sure you have read the HOW TO POST thread
smartmobili
CodeLite Enthusiast
Posts: 30
Joined: Wed May 20, 2009 1:54 am
Contact:

Re: Configure codelite to use msvc toolchain

Post by smartmobili »

eranif wrote:
smartmobili wrote:Ok I have also added the following flags in preprocessor /FD /EHsc /Gm /MTd /GS- /fp:fast /GR- /W3 /c /Zi /TP
These should be in the 'Compiler Options' text field, like this:
/FD;/EHs;/Gm etc.

Eran
Arghhh actually I did it but stilll doesn't work!
Now make is calling the wrong compiler g++ instead of msvc cl.
make[1]: warning: -jN forced in submake: disabling jobserver mode.

"C:/cygwin-1.7/bin/make.exe" -j 2 -f "static_libgynoid_wsp.mk"
----------Building project:[ static_libgynoid - Debug ]----------
make[1]: warning: -jN forced in submake: disabling jobserver mode.
g++ -c "C:/cygwin-1.7/home/Vincent/projects/gynoid/trunk/src/gynoid/src/GDAddrBook.cpp" /FD /EHsc /Gm /MTd /GS- /fp:fast /GR- /W3 /c /Zi /TP -D/D_DEBUG -D/D_WIN32_WCE=0x502 -D/DUNDER_CE -D/DWIN32_PLATFORM_PSPC -D/DWINCE -D/D_WINDOWS -D/DARM -D/D_ARM_ -D/DUNICODE -D/D_UNICODE -D/DGYNOID_EXPORTS -o ./Debug/GDAddrBook.o "-I." "-I." "-I../../include"
/bin/sh: g++: command not found
Project_Settings.png
Build_Systems.png
Build_Settings.png
When looking at makefile I have this :

## Debug
ConfigurationName :=Debug
IntermediateDirectory :=./Debug
OutDir := $(IntermediateDirectory)
LinkerName:=g++
ArchiveTool :=ar rcu
SharedObjectLinkerName :=g++ -shared -fPIC
...

Why do I have g++ instead of cl ? I tried to replace it by cl but codelite is replacing it evrytime I launch a build.
Could it be because I have renamed directly in the xml file the default VC++ into MSVCWM5 Professional ?
I am going to reinstall it completely.
You do not have the required permissions to view the files attached to this post.
smartmobili
CodeLite Enthusiast
Posts: 30
Joined: Wed May 20, 2009 1:54 am
Contact:

Re: Configure codelite to use msvc toolchain

Post by smartmobili »

I have reinstalled and now it works again ...
Another thing when pasting a path in Build Settings->Build Systems I always forget to use POSIX paths and I already
report you this problem but you told me it was already handled but that 's not the case!
When I copy/paste from explorer path for make I have C:\cygwin-1.7\bin\make.exe but it doesn't work even if
I declare the nodoswaring.
Why don't you replace \ by / because since you are using a posix shell to call command it will work with cygwin and
mingw ?

UPDATE: So I managed to compile my project one time and just to be sure I tried to compile it once again and I had an issue
about missing headers. When looking at global settings, include and lib path have disappeared....
It seems codelite is following quantum mechanics, you never know if it will compile.
I will try to see if it happen again and will try to find what I did.

Last remark, in a source file when I click on an include and I want to open it in editor the following dialog appears :
Open file.png
As you can see path are truncated and I need to resize dialog to show the full path, couldn't be possible to automatically calculate the largest width and
display the dialog with the right size ? I know that's a detail but that'sthe kinf of things that make differences between ide or editors.

Thanks
You do not have the required permissions to view the files attached to this post.
User avatar
eranif
CodeLite Plugin
Posts: 6367
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Configure codelite to use msvc toolchain

Post by eranif »

smartmobili wrote:Another thing when pasting a path in Build Settings->Build Systems I always forget to use POSIX paths and I already
report you this problem but you told me it was already handled but that 's not the case!
Can u paste a build log where it happens to you?
smartmobili wrote:It seems codelite is following quantum mechanics, you never know if it will compile.
Maybe it has something to do with the fact that its author has a a major physics? could be...
smartmobili wrote:As you can see path are truncated and I need to resize dialog to show the full path, couldn't be possible to automatically calculate the largest width and
display the dialog with the right size ? I know that's a detail but that'sthe kinf of things that make differences between ide or editors.
Or simply make the dialog resize-able (and remembers its size/pos)

Eran
Make sure you have read the HOW TO POST thread
smartmobili
CodeLite Enthusiast
Posts: 30
Joined: Wed May 20, 2009 1:54 am
Contact:

Re: Configure codelite to use msvc toolchain

Post by smartmobili »

eranif wrote: Can u paste a build log where it happens to you?
I will in my next post but I have a question, here is one build log :

cl.exe /nologo /c -c "C:/cygwin-1.7/home/Vincent/projects/gynoid/trunk/src/gynoid/src/GDAddrBook.cpp" /FD /EHsc /Gm /MTd /GS- /fp:fast /GR- /W3 /c /Zi /TP -D_DEBUG -D_WIN32_WCE=0x502 -DUNDER_CE -DWIN32_PLATFORM_PSPC -DWINCE -D_WINDOWS -DARM -D_ARM_ -DUNICODE -D_UNICODE -DGYNOID_EXPORTS -o ./Debug/GDAddrBook.o "-IC:/Program Files/Microsoft Visual Studio 9.0/VC/ce/ATLMFC/INCLUDE" "-IC:/Program Files/Microsoft Visual Studio 9.0/VC/ce/INCLUDE" "-IC:/Program Files/Windows Mobile 5.0 SDK R2/PocketPC/Include/Armv4i" "-I." "-I." "-I../../include"
cl.exe /nologo /c -c "C:/cygwin-1.7/home/Vincent/projects/gynoid/trunk/src/gynoid/src/GDContainers.cpp" /FD /EHsc /Gm /MTd /GS- /fp:fast /GR- /W3 /c /Zi /TP -D_DEBUG -D_WIN32_WCE=0x502 -DUNDER_CE -DWIN32_PLATFORM_PSPC -DWINCE -D_WINDOWS -DARM -D_ARM_ -DUNICODE -D_UNICODE -DGYNOID_EXPORTS -o ./Debug/GDContainers.o "-IC:/Program Files/Microsoft Visual Studio 9.0/VC/ce/ATLMFC/INCLUDE" "-IC:/Program Files/Microsoft Visual Studio 9.0/VC/ce/INCLUDE" "-IC:/Program Files/Windows Mobile 5.0 SDK R2/PocketPC/Include/Armv4i" "-I." "-I." "-I../../include"
cl : Command line warning D9035 : option 'o' has been deprecated and will be removed in a future release
cl : Command line warning D9035 : option 'o' has been deprecated and will be removed in a future release


Preprocessor options are appended a minus sign -D_DEBUG -D_WIN32_WCE=0x502 but when I look at Visual studio I think it uses / :
/D "UNDER_CE" /D "WIN32_PLATFORM_PSPC" /D "WINCE".
But maybe Visual studio handles both syntax ?


And about the deprecated option 'o' what can I do to fix it ?
Last edited by smartmobili on Mon Jun 01, 2009 1:10 pm, edited 1 time in total.
smartmobili
CodeLite Enthusiast
Posts: 30
Joined: Wed May 20, 2009 1:54 am
Contact:

Re: Configure codelite to use msvc toolchain

Post by smartmobili »

Here is the build log about issues with non posix paths :

C:\cygwin-1.7\bin\make.exe" -j 2 -f "static_libgynoid_wsp.mk"
----------Building project:[ static_libgynoid - Debug ]----------
/bin/sh: C:\cygwin-1.7\bin\make.exe: command not found

then if I replace \ by / in Build Systems it works fine :
"C:/cygwin-1.7/bin/make.exe" -j 2 -f "static_libgynoid_wsp.mk"
----------Building project:[ static_libgynoid - Debug ]----------
make[1]: warning: -jN forced in submake: disabling jobserver mode.
cl.exe /nologo /c -c "C:/cygwin-1.7/home/Vincent/projects/gynoid/trunk/src/gynoid/src/GDAddrBook.cpp" /FD /EHsc /Gm /MTd /GS- /fp:fast /GR- /W3 /c /Zi /TP -D_DEBUG -D_WIN32_WCE=0x502 -DUNDER_CE -DWIN32_PLATFORM_PSPC -DWINCE -D_WINDOWS -DARM -D_ARM_ -DUNICODE -D_UNICODE -DGYNOID_EXPORTS -o ./Debug/GDAddrBook.o "-IC:/Program Files/Microsoft Visual Studio 9.0/VC/ce/ATLMFC/INCLUDE" "-IC:/Program Files/Microsoft Visual Studio 9.0/VC/ce/INCLUDE" "-IC:/Program Files/Windows Mobile 5.0 SDK R2/PocketPC/Include/Armv4i" "-I." "-I." "-I../../include"
...
User avatar
eranif
CodeLite Plugin
Posts: 6367
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Configure codelite to use msvc toolchain

Post by eranif »

smartmobili wrote:Preprocessor options are appended a minus sign -D_DEBUG -D_WIN32_WCE=0x502 but when I look at Visual studio I think it uses / :
This can be configurable as well. Select your compiler from 'settings -> build settings -> <compiler name> -> Switches'
Here double click on an entry to update it:
Preprocessor: -D -> /D
Output : -o -> /OUT:
etc.

You better copy the settings from the 'VC++' compiler which I provide.

Also, I can see that you are using .o extension, this can also be configured from
'settings -> build settings -> <compiler name> -> Advance', at the bottom, change it from .o to .obj (AFAIR VC insists on .obj)
smartmobili wrote:C:\cygwin-1.7\bin\make.exe" -j 2 -f "static_libgynoid_wsp.mk"
----------Building project:[ static_libgynoid - Debug ]----------
/bin/sh: C:\cygwin-1.7\bin\make.exe: command not found
Now I understand which path you are talking about: the make path, and this was never fixed, I thought you were talking about the file paths - I will fix this on in the SVN trunk

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