我想运行和编译一些Qt
代码,所以我可以学习它,我去的网站下面,我看到他们提供了一些Qt
例子新Qt中得到了链接和Makefile错误
我使用最新版本,那么我复制的代码,但我得到这些错误:
mainwindow.obj:-1: error: LNK2005: main already defined in main.obj
debug\uwm.exe:-1: error: LNK1169: one or more multiply defined symbols found
于是,我问的问题在“qt forum”,他们建议删除“主窗口.H”和‘从我的项目目录mainwindow.cpp’
如果我这样做,第一个错误都没有了,但我建立了项目后,我得到新的:
11:58:21: Running steps for project uwm... 11:58:21: Configuration unchanged, skipping qmake step. 11:58:21: Starting: "C:\Qt\Qt5.0.2\Tools\QtCreator\bin\jom.exe"
C:\Qt\Qt5.0.2\Tools\QtCreator\bin\jom.exe -f Makefile.Debug Error: dependent '..\uwm\mainwindow.cpp' does not exist. jom: D:\qt\build-uwm-Desktop_Qt_5_0_2_MSVC2012_64bit-Debug\Makefile [debug] Error 2 11:58:21: The process "C:\Qt\Qt5.0.2\Tools\QtCreator\bin\jom.exe" exited with code 2. Error while building/deploying project uwm (kit: Desktop Qt 5.0.2 MSVC2012 64bit) When executing step 'Make' 11:58:21: Elapsed time: 00:00.
我无法提交我的第二个错误的屏幕截图http://s21.postimg.org/6z7t2mnx3/Scrshot11.png – amir 2013-04-27 17:52:20
由于某些原因,您更改项目'Makefile'和'Makefile.Debug'后没有更新。尝试删除整个'D:\ qt \ build-uwm-Desktop_Qt_5_0_2_MSVC2012_64bit-Debug'并重试。 – Paul 2013-04-27 18:00:24
@保罗谢谢你解决!完美...你是对的Makefile和Makefile.Debug没有更新。 – amir 2013-04-27 18:01:15