PDA

View Full Version : 'test' is not recognized as an internal or external command



dvmorris
17th June 2007, 06:53
I'm trying to compile a program with Qt 4.3.0 on Windows Vista, and after a million issues of trying to even get Qt installed, I am now getting this error:



'test' is not recognized as an internal or external command,
operable program or batch file.
The syntax of the command is incorrect.
C:\mingw\bin\mingw32-make.exe: *** [vecmat//Makefile] Error 1


there are two lines in the generated makefile that say CHK_DIR_EXISTS = test -d

but i'm not really sure what that does or why it's never given me an error on Windows XP. It's also really difficult to search for a common word like "test" on google. Thanks for the help. This is frustrating. I'm using mingw32 4.3.2 and all my environment variables are supposedly correct.

thanks for the help,
dave

wysota
17th June 2007, 08:10
Supposedly or correct? :) Are you using the "Qt command prompt"?

dvmorris
17th June 2007, 17:09
I'm just using powershell and the regular command prompt, and also trying to do it from within eclipse IDE. Other than an error with my environment variables, what might be the problem?

What is the qt command prompt? i've never heard of it before.

jacek
17th June 2007, 17:32
What is the qt command prompt? i've never heard of it before.
It's a script that starts cmd.exe with environment variables set up correctly. You can find it in the Start menu in the same place where links to Qt Assistant and Qt Designer are.

dvmorris
17th June 2007, 17:49
ok, i tried again and i still get the error about 'test' not being recognized as a command. i can't find anything in the qmake documentation about this. any ideas.?

marcel
17th June 2007, 17:56
For windows it should be:


CHK_DIR_EXISTS= if not exist


Are you sure you used the right QMAKESPEC?
Anyway, it was weird from the beginning because there is no test command(by default). Maybe there is one that comes bundled with mingw, in which case you must have the path to the mingw binaries in PATH.

Regards

dvmorris
17th June 2007, 17:59
it's using win32-g++

is that correct?

marcel
17th June 2007, 17:59
Anyway, this is pretty much how it should look like:


first: release
install: release-install
uninstall: release-uninstall
MAKEFILE = Makefile
QMAKE = qmake
DEL_FILE = del
CHK_DIR_EXISTS= if not exist
MKDIR = mkdir
COPY = copy /y
COPY_FILE = $(COPY)
COPY_DIR = xcopy /s /q /y /i
INSTALL_FILE = $(COPY_FILE)
INSTALL_PROGRAM =
INSTALL_DIR = $(COPY_DIR)
DEL_FILE = del
SYMLINK =
DEL_DIR = rmdir
MOVE = move
CHK_DIR_EXISTS= if not exist
MKDIR = mkdir
SUBTARGETS = \
release \
debug

marcel
17th June 2007, 18:01
it's using win32-g++

is that correct?

That is correct.

Then do a search in the mingw install dir for "test"...
See if anything comes up.

EDIT: make that "test.exe"

Regards

dvmorris
17th June 2007, 18:03
there is a sample app called test, but i placed it in the bin directory and when it runs vista gets an error that says test.exe crashes every time i run make.

on windows xp my makefiles are correct, that's strange. that is the only test.exe on my entire hard drive so i don't know where it is getting that from. it says

CHK_DIR_EXISTS = test -d

marcel
17th June 2007, 18:12
Well, it's Vista...
Try running test.exe as Adminstrator.
Or, better yet, just disable UAC for 10 minutes and see if it works ( but remember to run it manually - something like test c:\windows ).

Regards

dvmorris
17th June 2007, 18:26
it just keeps crashing. but even still. test.exe is in the sample programs directory for mingw, so it wouldn't make sense that it would do anything important. i disabled UAC and tried it again as well.

i don't understand how no one else has had this problem yet. i just installed qt 4.3.0 from the trolltech website with mingw. maybe i should just delete everything and try again.

marcel
17th June 2007, 18:27
I am now 100% sure that test.exe comes with mingw. And it is normal, because test can be found only on Linux( and other Unix flavors ). It is used mainly for shell scripting.

Regards

dvmorris
17th June 2007, 18:30
ok, thanks for your help, i will try some other things.

marcel
17th June 2007, 18:38
Well, I am almost sure this is a compatibility issue( permissions, etc ).

When you run make, it will look at the exit code of test.exe. This is how it knows a dir exists or not.

Maybe you can find something relevant on other sites.

Regards

dvmorris
17th June 2007, 18:41
i deleted absolutely everything related to qt and mingw, and redownloaded it from trolltech, and it seems to be working now. for some reason i have a knack for finding ways to make qt break on all my os's. i always have weird problems on os x as well.

anyways, thank you so much for your help.
dave