User forums > General (but related to Code::Blocks)
Shell commands on Windows
(1/1)
cmaxb:
Hi, I am developing with mingw and codeblocks on winXP. I use qmake which uses a spec based on mingw and DOS, so Makefile contains things like:
--- Code: ---DEL_FILE = del
DEL_DIR = rmdir
MOVE = move
--- End code ---
This worked great for qt build from cmd.exe. However, when I build within codeblocks, I see messages like
--- Code: ---process_begin: CreateProcess((null), del parser_yacc.cpp parser_yacc.h, ...) failed.
process_begin: CreateProcess((null), move y.tab.h parser_yacc.h, ...) failed.
--- End code ---
It seems I have to use the unix equivalents mv or rm to make it work.
mandrav:
Because C::B doesn't run in a command prompt, it can't run these shell builtin commands.
The solution is (besides using the unix equivalent commands) to change it like this:
--- Code: ---DEL_FILE = cmd /c del
DEL_DIR = cmd /c rmdir
MOVE = cmd /c move
--- End code ---
Or change the make commands in your project build options and prepend "cmd /c " for each one of them.
cmaxb:
I found a switch 'MINGW_IN_SHELL' that I use in my enivronment. Qmake will use this to apply the unix equivalents. Also, for anyone interested. Here is how I set up Qt, in my environment:
I set up a tool that runs this batch file
cd C:\Dev\projectname
set QTDIR=C:\Dev\Qt\qt-win-opensource-src-4.2.0
set QMAKESPEC=C:\Dev\Qt\qt-win-opensource-src-4.2.0\mkspecs\win32-g++
set MINGW_IN_SHELL=1
C:\Dev\Qt\qt-win-opensource-src-4.2.0\bin\qmake -project "CONFIG += qt thread" "TARGET = projectname" "DESTDIR = bin/debug" "DEPENDPATH = inc src" "INCLUDEPATH = inc" "MOC_DIR = moc" "OBJECTS_DIR = obj" "UI_DIR = ui" "RESOURCES = app.qrc" "QMAKE_LEX = flex"
C:\Dev\Qt\qt-win-opensource-src-4.2.0\bin\qmake -makefile
I run this each time I add a class or header. Then I set external Makefile under Project.
Navigation
[0] Message Index
Go to full version