Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. Chinese
  4. QT creator Cannot open source file
Forum Updated to NodeBB v4.3 + New Features

QT creator Cannot open source file

Scheduled Pinned Locked Moved Chinese
3 Posts 2 Posters 3.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    baijiaheizhiganmao
    wrote on last edited by
    #1

    Hi all:
    I just create a GUI project in a choosed path (windows system),befor add any code in this project ,I clicked the button:Run,only to find this error :Cannot open file:'.\main.cpp':No such file or directory .But actually it has such a file:created by the Qt itself ! so How Could I fix this issue ? thank you !
    ps:this issue hasn't occured when I use VS to create a same QT GUI project.


    大家好:
    我使用qt creator 创建了一个GUI的工程,工程路径是自己制定的,使用windows 系统。建立好了之后,我运行,发现他弹出这个错误提示:Cannot open file:'.\main.cpp':No such file or directory。事实上这是Qt自己完成的,我没有改动任何东西。请问我应该如何修改这个问题,谢谢。
    ps:我用vs建立Qt工程没有出现这个问题,两者使用的是同一个qt。

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      what type of project you created ? Do you see the main.cpp in Project explorer on the left side of your Qt creator ? Can you create new project and try ? Can you clean, run the qmake again and give build ?

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      1 Reply Last reply
      0
      • B Offline
        B Offline
        baijiaheizhiganmao
        wrote on last edited by
        #3

        @Dheerendra Dheerendra
        project type:Qt4 Gui Application
        I can see the main.cpp
        I can create new project but can't run as the same reason;
        I can clean and qmake that pro.,but when run it ,give me the error msg :
        Cannot find source file :‘.\main.cpp’ No such file or directory
        Cannot find source file :‘.\mainwindow.cpp’ No such file or directory

        the project name is testAgain,in that *.pro file I can see the info.as belowe:
        #---------------------------------------------

        project cerate by Qt Creator 2014-09-05t09:53:21

        #---------------------------------------------
        TARGET = testAgain
        TEMPLATE = app
        SOURCES += main.cpp
        mainwindow.cpp
        HEADERS += mainwindow.h
        FORM += mainwindow.ui

        so you can see I haven't change anyting before add my owner code to this project ,it just cannot work.
        The strange is ,if I use VS to create the same Qt project ,nothing go wrong ! But I need to use Qt creator in a straightway > _ <

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved