How to compile a Linux project under Windows

CodeLite installation/troubleshooting forum
matbru
CodeLite Curious
Posts: 4
Joined: Tue Nov 19, 2013 4:24 pm
Genuine User: Yes
IDE Question: C++
Contact:

How to compile a Linux project under Windows

Post by matbru »

Hello,

I have developped a GUI app (simple wxFrame) under Linux.

The Project directory is on a NTFS partition that is both read/writable under Linux and Windows 7 (my computer has a dual boot).

I have installed CodeLite 5.3 on both OS.

Under Linux, the application compiles and runs without problem.

Under Windows, I cannot compile the Project:
mingw32-make.exe[1]: *** No rule to make target `/data/codelite/GonflageGUI/gui.cpp', needed by `Debug/gui.o'. Stop.
I am puzzled that the make process uses the pathname of my Linux ('/data/codelite/GonflageGUI/') even though the .mk file has been automatically rewritten to adapt to Windows system (

Code: Select all

ProjectPath            := "D:\codelite\GonflageGUI"
)
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: How to compile a Linux project under Windows

Post by eranif »

Where does the .project and .workspace ? are they also on the same drive?

Eran
Make sure you have read the HOW TO POST thread
User avatar
Jarod42
CodeLite Expert
Posts: 240
Joined: Wed Sep 30, 2009 5:54 pm
Genuine User: Yes
IDE Question: C++
Location: France
Contact:

Re: How to compile a Linux project under Windows

Post by Jarod42 »

Do you use the same 'configuration' ? (or do you have DEBUG_UNIX, DEBUG_WINDOWS, ...)
Have you try to rebuild ?
I suspect that dependencies (.d files) still reference with unix path.
matbru
CodeLite Curious
Posts: 4
Joined: Tue Nov 19, 2013 4:24 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: How to compile a Linux project under Windows

Post by matbru »

eranif wrote:Where does the .project and .workspace ? are they also on the same drive?

Eran
Hi Eran,

The .project is on the same folder (on the common partition).

I have two .workspace files: one on my Linux ~/.codelite/ folder (in a Linux-only partition).

But when I use Codelite on Windows the .workspace that is used is on the same shared NTFS drive.
Is that wrong?
Jarod42 wrote:Do you use the same 'configuration' ? (or do you have DEBUG_UNIX, DEBUG_WINDOWS, ...)
Hi Jarod42,
I use the same configuration: I have not edited the project setting under Windows, if this is what you mean.
Nonetheless, CodeLite has been smart enough to automatically update the ProjectPath in the .mk file (as I mentioned in my initial post).
Jarod42 wrote:Have you try to rebuild ?
I suspect that dependencies (.d files) still reference with unix path.
Yes, cleaning and rebuilding has no effect: I get the same error.
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: How to compile a Linux project under Windows

Post by eranif »

All your files ( source files + workspace + project ) _must_ exist on the same drive. If they are not - it will not work


Eran
Make sure you have read the HOW TO POST thread
matbru
CodeLite Curious
Posts: 4
Joined: Tue Nov 19, 2013 4:24 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: How to compile a Linux project under Windows

Post by matbru »

Hello,

From my Linux, I have created a new workspace in a folder on the common drive (/data/codelite/NewWorkspace = D:\codelite\NewWorkspace).
I have imported my project into that workspace (all files were already located on the common folder in D:\codelite\GonflageGUI).

I have compiled and run the project with no problem.

When I reboot and launch CodeLite on Windows 7, I get the same error on compiling the project, even though I used my project through the new workspace which file is indeed on the common drive.
C:\Windows\system32\cmd.exe /c "mingw32-make.exe -j 4 -e -f Makefile"
"----------Building project:[ GonflageGUI - Debug ]----------"
wx-config Warning: Multiple compiled configurations of wxWidgets have been detected.
Using first detected version by default.

Please use the --wxcfg flag (as in wx-config --wxcfg=gcc_dll/mswud)
or set the environment variable WXCFG (as in WXCFG=gcc_dll/mswud)
to specify which configuration exactly you want to use.
mingw32-make.exe[1]: Entering directory `D:/codelite/GonflageGUI'
mingw32-make.exe[1]: *** No rule to make target `/data/codelite/GonflageGUI/gui.cpp', needed by `Debug/gui.o'. Stop.
mingw32-make.exe[1]: *** Waiting for unfinished jobs....
mingw32-make.exe: *** [All] Error 2
mingw32-make.exe[1]: Leaving directory `D:/codelite/GonflageGUI'
Makefile:4: recipe for target `All' failed
0 errors, 0 warnings
The workspace file is D:\codelite\NewWorkspace\NewWorkspace.workspace
The project file is D:\codelite\GonflageGUI\GonflageGUI.project
And all the source files are in D:\codelite\GonflageGUI

All of them located on the same drive.

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

Re: How to compile a Linux project under Windows

Post by eranif »

What happens when you delete the Makfile located under the workspace folder?
Eran
Make sure you have read the HOW TO POST thread
matbru
CodeLite Curious
Posts: 4
Joined: Tue Nov 19, 2013 4:24 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: How to compile a Linux project under Windows

Post by matbru »

Hello,

Under Cygwin, using a command:
find . -type f | xargs grep '/data/'

I realized that I had main.o.d and gui.o.d files that contained references to my Unix pathnames.
I do not understand what happened (not) to these files when I cleaned and rebuilt (I will redo the test next time I boot under Linux).

Having removed these files seems to allow me to go further.

Yet, I have new errors when I try to compile.

Code: Select all

C:\Windows\system32\cmd.exe /c "mingw32-make.exe -j 4 -e -f  Makefile"
"----------Building project:[ GonflageGUI - Release ]----------"
wx-config Warning: Multiple compiled configurations of wxWidgets have been detected.
Using first detected version by default.

Please use the --wxcfg flag (as in wx-config --wxcfg=gcc_dll/mswud)
or set the environment variable WXCFG (as in WXCFG=gcc_dll/mswud)
to specify which configuration exactly you want to use.
mingw32-make.exe[1]: Entering directory `D:/codelite/GonflageGUI'
g++: error: /MT: No such file or directory
g++: error: /DWIN32: No such file or directory
g++: error: /D__NO_VC_CRTDBG__: No such file or directory
g++: error: /D__WXMSW__: No such file or directory
g++: error: /D_UNICODE: No such file or directory
g++: error: /DwxUSE_GRAPHICS_CONTEXT=1: No such file or directory
g++: error: /IC:/SourceCode/Libraries/wxWidgets2.8/lib/vc_lib/mswu: Invalid argument
g++: error: /IC:/SourceCode/Libraries/wxWidgets2.8/include: Invalid argument
g++: error: /D_WINDOWS: No such file or directory
g++: error: /GR: No such file or directory
g++: error: /EHsc: No such file or directory
g++: error: /MT: No such file or directory
g++: error: /DWIN32: No such file or directory
g++: error: /D__NO_VC_CRTDBG__: No such file or directory
g++: error: /D__WXMSW__: No such file or directory
g++: error: /D_UNICODE: No such file or directory
g++: error: /DwxUSE_GRAPHICS_CONTEXT=1: No such file or directory
g++: error: /IC:/SourceCode/Libraries/wxWidgets2.8/lib/vc_lib/mswu: Invalid argument
g++: error: /IC:/SourceCode/Libraries/wxWidgets2.8/include: Invalid argument
g++: error: /D_WINDOWS: No such file or directory
g++: error: /GR: No such file or directory
g++: error: /EHsc: No such file or directory
mingw32-make.exe[1]: *** [Release/main.o.d] Error 1
mingw32-make.exe[1]: *** Waiting for unfinished jobs....
mingw32-make.exe[1]: *** [Release/gui.o.d] Error 1
GonflageGUI.mk:104: recipe for target `Release/main.o.d' failed
GonflageGUI.mk:96: recipe for target `Release/gui.o.d' failed
mingw32-make.exe[1]: Leaving directory `D:/codelite/GonflageGUI'
mingw32-make.exe: *** [All] Error 2
Makefile:4: recipe for target `All' failed
0 errors, 0 warnings
I guess it has to see with a confusion between '/' and '-' but I do not know how to fix this.

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

Re: How to compile a Linux project under Windows

Post by eranif »

You need to create different configurations for Linux and windows.
Mainly create different intermediate folders.
GCC places the dependencies files in those folders.
Eran
Make sure you have read the HOW TO POST thread
stahta01
CodeLite Enthusiast
Posts: 39
Joined: Thu Dec 29, 2011 10:07 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: How to compile a Linux project under Windows

Post by stahta01 »

Code: Select all

g++: error: /MT: No such file or directory
g++: error: /DWIN32: No such file or directory
g++: error: /D__NO_VC_CRTDBG__: No such file or directory
g++: error: /D__WXMSW__: No such file or directory
The above implies that something thinks its using MSVC options.
I would guess wx-config is the cause I suggest doing the suggest fix of defining WXCFG as suggested.
I would test in on the command line to verify that wx-config --cflags returns the correct flags for gcc instead for MSVC.

NOTE: I am once more trying out CodeLite to see if it works for me; I am a absolute beginners on CodeLite.
But, I have used wx-config many times.

Tim S.
Post Reply