将demo源程序复制,在qt creator运行时出现了错误。error: LNK1181: cannot open input file 'debug\main.obj'

 

error: LNK1181: cannot open input file 'debug\main.obj'在文件目录中不使用空格和复杂符号。(待定)

This is most likely caused by an error in the project settings. Source files (*.cpp) are compiled into object files (*.o) which are then all linked together. Somehow the linker is failing to find the object files compiled from your source files. I can tell it is looking into debug\, but they are being stored somewhere else. Do you have write permissions to that directory?

This problem also occurs if the path of your project (name of any folder) contains a white space.

'The error occurs because the linker in VS2005 can not find the file or the file path defined in the project properties. However, the file path or file in the properties is correct because the linker can handle space character in the file path.

To solve the issue, you just avoid to use space character in the file path or add quotation around file path in project properties.

 

程序考背后需 构建->清理项目,因为一些配置qmake等与源目录相关,直接运行的话会在原来的拷贝目录下生成debug目录和调试文件,切若原目录不存在的话也将重新创建。而不是在当前新文件夹下生成调试文件。

你可能感兴趣的:(qt,qt,creator)