PDA

View Full Version : problem compiling qt4 application on Windows



superd
27th April 2006, 05:13
Hi,
I'm trying to find some info. on compiling on Windows. My qt4 app compiled just fine in Linux but I'm having problems in Windows. Does anyone know where a good tutorial is? I got the error "nmake is not recognized as an internal or external command" when I had the project folder in My Docs. I moved my project folder to the Visual Studio directory and now I get "g++ not recognized as internal or external command" , NMAKE: fatal error U1077.........

I can't find a tutorial and I'm not even sure I'm even doing this right. Any help would be appreciated.

munna
27th April 2006, 05:30
In your PATH add the path to where your nmake.exe is. You might also have to add INCLUDE path to your string.h. There might also be some other things you need to add.

ankurjain
27th April 2006, 05:39
i think i shall run the compiling steps again on windows. i guess u r running nmake from the prompt directly so the error of g++.

Just run the commands again :


->qmake -project ( if u don't hav a .pro file, else don't run it, it will overwrite ur existing .pro)
->qmake
->nmake


Also, add the required PATHS in the INCLUDE directive as suggested by munna bhai ;)

superd
27th April 2006, 06:03
Thats the steps i went through. qmake -project, qmake, then nmake. I get the error on nmake. The error changes to the g++ one after I put my project folder in the Visual Studio directory. Shouldn't I be able to run nmake from anywhere in the command prompt?? I tried using the entire path to nmake but still get the same error. I'm really new to this though. I think I'm missing something simple. I really need to find a in depth tutorial on compiling Qt apps in windows. Or maybe how to integrate it with Visual Studio. I'm doing the tutorial from "The Independant Qt Tutorial". Here is my project file after I ran qmake if anyone wants to look at it. Thanks again.

munna
27th April 2006, 06:12
It compiles perfectly for me.

Here's the dialog

http://img101.imageshack.us/my.php?image=demodialog9ut.png

type PATH on your command prompt and see if the path to your nmake.exe is available in the output.

ankurjain
27th April 2006, 06:15
ditto for me buddy,
compiled on first run, even no need to do any changes anywhere.
do as our munna bhai says

superd
27th April 2006, 15:35
Ok, you guys have been very helpful. This is my first go at compiling anything in Windows and I'm familiar with the OS so I don't know even the basics. Be patient, I'm learning fast(i think).

I appended the PATH to reflect the path to nmake.exe that solved that error. I then got the error "g++ not recognized and internal or external command". I did the same, appended PATH to reflect the path to g++.exe. It ran like it was going to compile but then errored out with MS error report pop-up. This said "ld.exe encountered a problem and needs to close" Any ideas??? I've searched, and can't find anything on this one. Thanks for the help.
Oh, I am installing Qt on my other box to see if I can get this to work there. I'm thinking I've got a corrupt file somewhere.

superd
27th April 2006, 16:01
It compiled just fine on my other box. So if you have any ideas about what might be wrong with the ld.exe on this other box it would be greatly appreciated.

jacek
27th April 2006, 16:51
Do you have commercial or Open Source edition? The latter (officially) works only with MinGW, so you can't use it with M$ toolchain.

superd
28th April 2006, 14:47
I have the open source edition. I haven't heard of the M$ toolchain but I will go check it out. I did get my application working though. I reinstalled Qt on my laptop.(the one I was having problems with) It compiled fine but I still can't run the app. I get an error that says "entry point in QtCore4.dll could not be found". I replaced that dll with the one from my other box where the app is working fine but I still get the same error. I'm not sure whats going on there but I have a few more things to try. I think I have learned a great deal from you guys so thanks again for everyones help.

jacek
28th April 2006, 15:48
I have the open source edition.
In this case you should use MinGW and its tools --- not "nmake". Make sure that PATH environment variable contains a path to MinGW's bin directory.