• 5786阅读
  • 3回复

为什么程序编译不通过啊? [复制链接]

上一主题 下一主题
离线smartdj
 

只看楼主 倒序阅读 楼主  发表于: 2008-06-27
— 本帖被 XChinux 执行加亮操作(2008-06-28) —
C:\>qmake -v
QMake version 2.01a
Using Qt version 4.4.0 in D:\qt-win-opensource-src-4.4.0\lib

C:\>qmake -project -o hello.pro

C:\>qmake
WARNING: Failure to find: ..\Documents and Settings\Administrator\??\????.lnk\Re
source.h
WARNING: Failure to find: ..\Documents and Settings\Administrator\??\????.lnk\??
?.ui
WARNING: Failure to find: ..\Documents and Settings\Administrator\??\????.lnk\Re
source.h
WARNING: Failure to find: ..\Documents and Settings\Administrator\??\????.lnk\??
?.ui


hello.cpp:


#include <QApplication>
#include <QPushButton>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QPushButton hello("Hello world!");
hello.resize(100, 30);
hello.show();
return app.exec();
}
离线captain08
只看该作者 1楼 发表于: 2008-06-27
是不是hello.cpp的路径带中文了?
离线snailbing

只看该作者 2楼 发表于: 2008-06-27
一看路径 Administrator 后面的两个问题就是 桌面 两字
离线lixusheng

只看该作者 3楼 发表于: 2008-06-27
你的程序我是这样做的,你试一下

#include <QApplication>
#include <QPushButton>
int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    QPushButton hello("Hello world!");
    hello.resize(100, 30);
    hello.show();
    return app.exec();
}

保存为D:\Study\QT\exg\QT4-exg\Form\main.cpp

进入命令行编译,以下是编译过程
-------------------------------------------
D:\Study\QT\exg\QT4-exg\Form>qmake -project

D:\Study\QT\exg\QT4-exg\Form>qmake

D:\Study\QT\exg\QT4-exg\Form>make
mingw32-make -f Makefile.Release
mingw32-make[1]: Entering directory `D:/Study/QT/exg/QT4-exg/Form'
g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT
-DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEED
_QMAIN -I"c:\Qt\4.3.1\include\QtCore" -I"c:\Qt\4.3.1\include\QtCore" -I"c:\Qt\4
3.1\include\QtGui" -I"c:\Qt\4.3.1\include\QtGui" -I"c:\Qt\4.3.1\include" -I"."
I"c:\Qt\4.3.1\include\ActiveQt" -I"release" -I"." -I"c:\Qt\4.3.1\mkspecs\win32-
++" -o release\main.o main.cpp
main.cpp:10:2: warning: no newline at end of file
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-re
oc -Wl,-s -mthreads -Wl -Wl,-subsystem,windows -o "release\Form.exe" release\ma
n.o  -L"c:\Qt\4.3.1\lib" -lmingw32 -lqtmain -lQtGui4 -lQtCore4
mingw32-make[1]: Leaving directory `D:/Study/QT/exg/QT4-exg/Form'
快速回复
限100 字节
 
上一个 下一个