Qt error: LNK1181: cannot open input file 'debug\main.obj'

前端 未结 8 1633
小蘑菇
小蘑菇 2021-01-02 02:39

Qt creator was working well, but suddenly shows a problem error: LNK1181: cannot open input file \'debug\\main.obj\'.
This problem shows always with any typ

相关标签:
8条回答
  • 2021-01-02 03:40

    What worked for me:

    1. Close the Qt Creator
    2. Delete the [filename].pro.user file in your project directory
    3. Open the project again and let Qt configure itself

    Generally whenever I encounter an error like this, this is one of the first things I do as it solves a lot of problems with Qt.

    Edit: This will of course reset your project build location.

    0 讨论(0)
  • 2021-01-02 03:42

    The problem has been solved.

    The cause of the problem was when creating a new project (GUI or Console), all source files that belong to this new project take a wrong extension ex: main.cp, but the correct extension is supposed to be ex: main.cpp. And when change all the source files extension from .cp to .cpp worked fine.

    Or change the default source file extension from [Tools -> Option -> C++].

    enter image description here

    0 讨论(0)
提交回复
热议问题