Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Adding classes to a VS2008 project
Forum Updated to NodeBB v4.3 + New Features

Adding classes to a VS2008 project

Scheduled Pinned Locked Moved Qt Creator and other tools
3 Posts 2 Posters 1.9k 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.
  • A Offline
    A Offline
    andybisson
    wrote on last edited by
    #1

    I have added cpp/h files to a Qt project that I built from within Visual Studio and it now fails to compile. It says that its failing to find the new files (cannot open source file, cannot open include file) Is there something that I must do other than just physically copying the files and adding them to the project?

    Thanks,
    Andy

    1 Reply Last reply
    0
    • ZlatomirZ Offline
      ZlatomirZ Offline
      Zlatomir
      wrote on last edited by
      #2

      It should be enough to copy files and add to project, what is the error when you try to open the files?

      As an alternative you can create the class from VS interface (or create .h and .cpp separatelly) and then copy-paste the code from original h/cpp.

      https://forum.qt.io/category/41/romanian

      1 Reply Last reply
      0
      • A Offline
        A Offline
        andybisson
        wrote on last edited by
        #3

        Thanks for the quick reply. I seem to have resolved this issue (it can now find the files and I'm not sure what I did to fix it) but they are not being moc'ed so the link fails. I have seen the resolution to this problem when using a qmake file but I don't have one. How do I ensure that the new .cpp/.h files are moc'ed.

        Thanks,
        Andy

        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