Using different MinGW version problem

General questions regarding the usage of CodeLite
nezos
CodeLite Veteran
Posts: 59
Joined: Wed Dec 31, 2014 6:36 pm
Genuine User: Yes
IDE Question: C++
Contact:

Using different MinGW version problem

Post by nezos »

I am a new user of codelite (2 days). I tried compiling code with the supplied version of MinGW and worked fine. I then tried to use another version of MinGW (x86_64-4.9.1-release-posix-seh-rt_v3-rev3), which i use with CodeBlocks.

I added under Settings->Build Settings->Compilers a new compiler and pointed to the 4.9.1 version and automatically it filled out the options.

Created a new console project and tried to build it:

Code: Select all

#include <stdio.h>

int main(int argc, char **argv)
{
	printf("hello world\n");
	return 0;
}
C:\Windows\system32\cmd.exe /c "X:/MinGW/bin/mingw32-make.exe -j4 SHELL=cmd.exe -e -f Makefile"
"----------Building project:[ codelitehello - Debug ]----------"
mingw32-make.exe[1]: Entering directory 'X:/MyPrograms/codelitehello'
mingw32-make.exe[1]: *** [Debug/main.cpp.o.d] Error 1
mingw32-make.exe[1]: *** Waiting for unfinished jobs....
mingw32-make.exe: *** [All] Error 2
codelitehello.mk:96: recipe for target 'Debug/main.cpp.o.d' failed
mingw32-make.exe[1]: Leaving directory 'X:/MyPrograms/codelitehello'
Makefile:4: recipe for target 'All' failed
1 errors, 0 warnings
I checked my system parameters so that i don't have mingw in the path (conflict).

I can't find the root of the problem, searched codelite options but cannot figure what is wrong. Any help would be appreciated, thanks.

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

Re: Using different MinGW version problem

Post by eranif »

What happens when you run this command

Code: Select all

C:\Windows\system32\cmd.exe /c "X:/MinGW/bin/mingw32-make.exe -j4 SHELL=cmd.exe -e -f Makefile"
From the command line?

Eran
Make sure you have read the HOW TO POST thread
nezos
CodeLite Veteran
Posts: 59
Joined: Wed Dec 31, 2014 6:36 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Using different MinGW version problem

Post by nezos »

Executing from the command prompt yields :
X:\MyPrograms\codelitehello>C:\Windows\system32\cmd.exe /c "X:/MyPrograms/MinGW/bin/mingw32-make.exe -j4 SHELL=cmd.exe -e -f Makefile"
"----------Building project:[ codelitehello - Debug ]----------"
mingw32-make.exe[1]: Entering directory 'X:/MyPrograms/codelitehello'
process_begin: CreateProcess(NULL, makedir ./Debug, ...) failed.
make (e=2): The system cannot find the file specified.
codelitehello.mk:85: recipe for target 'Debug/.d' failed
mingw32-make.exe[1]: *** [Debug/.d] Error 2
mingw32-make.exe[1]: Leaving directory 'X:/MyPrograms/codelitehello'
Makefile:4: recipe for target 'All' failed
mingw32-make.exe: *** [All] Error 2
It seems to me that the problem is in the makefile but still can't figure it.
User avatar
eranif
CodeLite Plugin
Posts: 6372
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Using different MinGW version problem

Post by eranif »

nezos wrote:It seems to me that the problem is in the makefile but still can't figure it.
Its not in the Makefile.

The problem is here:
nezos wrote:make (e=2): The system cannot find the file specified.
I wonder why "make" is called (it should be mingw32-make) this only suggests that for some reason sh.exe is interfering in the way and "hijacks" the make

My guess:
By default mingw32-make will use the environment variable SHELL to determine which shell should it use, you probably have somewhere in your path sh.exe and this is the one used by your mingw32-make
Note that codelite passes SHELL=cmd.exe which tells mingw32-make to use CMD.EXE instead of sh.exe, obviously this is ignored by mingw32-make, which tells me that your mingw32-make is broken

To fix this:
Copy CodeLite's mingw32-make executable and replace your current (X:/MyPrograms/MinGW/bin/mingw32-make.exe) and it should be fixed
Note that replacing your mingw32-make does not affect your toolchain, so it should be safe to use it

Eran
Make sure you have read the HOW TO POST thread
nezos
CodeLite Veteran
Posts: 59
Joined: Wed Dec 31, 2014 6:36 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Using different MinGW version problem

Post by nezos »

First thanx again for the reply.

I don't have sh.exe and i had also checked whether it is defined somewhere but nothing.

Nevertheless, i tried your solution but then another problem came up, i am missing "libintl-8.dll"! I copied it also but then it requests for "libgcc_s_dw2-1.dll" where for 4.9.1 i have "libgcc_s_seh-1.dll". I don't know if it has a meaning to keep copying all the DLLs from the old to the new version. Any new thoughts on this?
User avatar
eranif
CodeLite Plugin
Posts: 6372
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Using different MinGW version problem

Post by eranif »

Instead of copying the mingw32-make and then all its DLLs, just point your 4.9.1 compiler Make tool (from Settings->Build settings->Compilers-><Your compiler>->Tools->Make and point it to CodeLite's MinGW mingw32-make executable

Eran
Make sure you have read the HOW TO POST thread
nezos
CodeLite Veteran
Posts: 59
Joined: Wed Dec 31, 2014 6:36 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Using different MinGW version problem

Post by nezos »

Nothing, the same error appears.
C:\Windows\system32\cmd.exe /c "X:/MyPrograms/Dev/MinGW-4.8.1/bin/mingw32-make.exe -e -f Makefile"
"----------Building project:[ codelitehello - Debug ]----------"
mingw32-make.exe[1]: Entering directory 'X:/MyPrograms/codelitehello'
mingw32-make.exe[1]: *** [Debug/main.cpp.o.d] Error 1
mingw32-make.exe: *** [All] Error 2
codelitehello.mk:96: recipe for target 'Debug/main.cpp.o.d' failed
mingw32-make.exe[1]: Leaving directory 'X:/MyPrograms/codelitehello'
Makefile:4: recipe for target 'All' failed
1 errors, 0 warnings
Even if i hit the Compile i get an error, don't know if this helps:
C:\Windows\system32\cmd.exe /c "X:/MyPrograms/Dev/MinGW-4.8.1/bin/mingw32-make.exe -e -f "codelitehello.mk" ./Debug/main.cpp.o"
----------Building project:[ codelitehello - Debug ] (Single File Build)----------
mingw32-make.exe: *** [Debug/main.cpp.o.d] Error 1
codelitehello.mk:96: recipe for target 'Debug/main.cpp.o.d' failed
0 errors, 0 warnings
Is there a way to get any more details on the error message?
User avatar
eranif
CodeLite Plugin
Posts: 6372
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Using different MinGW version problem

Post by eranif »

Some ideas:

1. Run

Code: Select all

C:\Windows\system32\cmd.exe /c "X:/MyPrograms/Dev/MinGW-4.8.1/bin/mingw32-make.exe -e -f Makefile"
from the command line (seems like codelite is hiding some stderr messages...)
2. When you switched to your MinGW, did you alter any environment variables within codelite?, can you please paste the content of Settings->Environment variables here?

Eran
Make sure you have read the HOW TO POST thread
nezos
CodeLite Veteran
Posts: 59
Joined: Wed Dec 31, 2014 6:36 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Using different MinGW version problem

Post by nezos »

1)
C:\Windows\System32\cmd.exe /c "X:\MyPrograms\Dev\MinGW-4.8.1\bin\mingw32-make.exe -e -f Makefile"
"----------Building project:[ codelitehello - Debug ]----------"
mingw32-make[1]: Entering directory 'X:/MyPrograms/codelitehello'
'makedir' is not recognized as an internal or external command,
operable program or batch file.
codelitehello.mk:85: recipe for target 'Debug/.d' failed
mingw32-make[1]: *** [Debug/.d] Error 1
mingw32-make[1]: Leaving directory 'X:/MyPrograms/codelitehello'
Makefile:4: recipe for target 'All' failed
mingw32-make: *** [All] Error 2
I was looking at this before you posted, it seems that it tries to create a folder using the command makedir. Makedir doesn't exist in windows. I altered this to mkdir and:
"----------Building project:[ codelitehello - Debug ]----------"
mingw32-make[1]: Entering directory 'X:/MyPrograms/codelitehello'
A subdirectory or file ./Debug already exists.
codelitehello.mk:85: recipe for target 'Debug/.d' failed
mingw32-make[1]: *** [Debug/.d] Error 1
mingw32-make[1]: Leaving directory 'X:/MyPrograms/codelitehello'
Makefile:4: recipe for target 'All' failed
mingw32-make: *** [All] Error 2

2) No i didn't change any env variables.

CodeLiteDir=C:\Program Files (x86)\CodeLite
UNIT_TEST_PP_SRC_DIR=X:\AeroFS\MyPrograms\Dev\UnitTest++-1.3
User avatar
eranif
CodeLite Plugin
Posts: 6372
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Using different MinGW version problem

Post by eranif »

nezos wrote:Makedir doesn't exist in windows
That's the thing, it does exist, its an executable that comes with CodeLite (you can locate it under the installation folder of codelite)

To see the real error you should open a shell from within CodeLite (so the CMD.EXE that codelite will open will inherit codelite's environment variables):
Right click on the any tab label and select -> open shell here

See screenshot.
1.png
And now try to run the build command

Eran
You do not have the required permissions to view the files attached to this post.
Make sure you have read the HOW TO POST thread
Post Reply