News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

Shell commands on Windows

Started by cmaxb, October 24, 2006, 02:21:29 PM

Previous topic - Next topic

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:
DEL_FILE      = del
DEL_DIR       = rmdir
MOVE          = move

This worked great for qt build from cmd.exe. However, when I build within codeblocks, I see messages like

process_begin: CreateProcess((null), del parser_yacc.cpp parser_yacc.h, ...) failed.
process_begin: CreateProcess((null), move y.tab.h parser_yacc.h, ...) failed.


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:

DEL_FILE      = cmd /c del
DEL_DIR       = cmd /c rmdir
MOVE          = cmd /c move


Or change the make commands in your project build options and prepend "cmd /c " for each one of them.
Be patient!
This bug will be fixed soon...

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.