Results 1 to 11 of 11

Thread: help creating a project file

  1. #1
    Join Date
    Sep 2009
    Posts
    64

    Default help creating a project file

    I have a project that I am trying to move over from Visual Studio to the QT Creator IDE. It is in a subdir structure and I have written all my *.pro files and have it nicely organized in my Qt Creator environment.

    When i try to build the project I get countless "Cannot open include file" errors... even though the file is there and it is correctly included in one of the subdirs .pro files.

    I feel like i am missing something here but im not sure what... here is my top level .pro file and an example of one of the subdir .pro files...

    please any help would be greatly appreciated.

    Qt Code:
    1. TEMPLATE = subdirs
    2.  
    3. SUBDIRS = AssetControlStub \
    4. bin \
    5. config \
    6. ContextSetter \
    7. Hub \
    8. IGManager \
    9. Logger \
    10. MRPL_Parser \
    11. ServiceGPS \
    12. TactileEAI \
    13. VideoManager \
    14. VMux \
    15. IGService \
    16. Shared
    17.  
    18. CONFIG += qt
    To copy to clipboard, switch view to plain text mode 

    Qt Code:
    1. OTHER_FILES += Makefile.am
    2. HEADERS += IGManager.h
    3.  
    4. SOURCES += IGManagerMain.cpp \
    5. IGManager_config.cpp \
    6. IGManager.cpp
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: help creating a project file

    include paths don't necessarily have to be part of your project.
    You have to specify the include paths with INCLUDEPATH.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Sep 2009
    Posts
    64

    Default Re: help creating a project file

    what exactly do you mean? if a file in one directory is including another file in another subdirectory... i need to put that directory in the INCLUDEPATH variable?

  4. #4
    Join Date
    Sep 2009
    Posts
    64

    Default Re: help creating a project file

    tried that and yea it fixed the problem...

    is there a way i can do a top level include of everything haha... i have many subdirs and it would take forever to go through each and make sure im including the appropriate include paths

  5. #5
    Join Date
    Sep 2009
    Posts
    64

    Default Re: help creating a project file

    well... it WAS working.. but for one of the project files in one of the subdirs it doesnt seem to be doing anything... all the files in this subdir reference a .h file that i put the path of said .h file into the include path and it is still not able to find it...

    any suggestions?

  6. #6
    Join Date
    Sep 2009
    Posts
    64

    Default Re: help creating a project file

    sorry to keep spamming you... but i got past the includepath issue... but now am having linking errors when trying to connect all the .obj files... how do i go aobut trying to fix this error?

    sorry ive always been terrible with Makefiles and stuff like this... and ive tried looking online but even after reading some of the documentation on the issue im left scratching my head

  7. #7
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: help creating a project file

    You can use -L for specifying link directories in the LIBS tag.
    I suggest you read the qmake documentation:
    http://doc.trolltech.com/4.5/qmake-manual.html
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  8. #8
    Join Date
    Sep 2009
    Posts
    64

    Default Re: help creating a project file

    yea i looked through that documentation and added a few library directories to the .pro file

    because this is a project that is already completed and im just moving it to Qt environment, there are a ton of Makefile.am that i am referencing to make sure i am getting all the libraries and what not... still, even after adding a few of these library directories to the pro files im getting the same number of errors... seems like adding the LIBS+= to the pro file didnt do anything

  9. #9
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: help creating a project file

    well, its hard to say with out knowing exactly what you are doing.
    In complex make file systems such as it looks you have, you can easily be doing all kinds of mistakes.
    The simplest explanation would be that either the paths your are giving LIBS are wrong , or that the syntax you are using there is wrong, or, that this information is not being passed down to what ever makefile is generating the errors you get.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  10. #10
    Join Date
    Sep 2009
    Posts
    64

    Default Re: help creating a project file

    you have been a big help and i really appreciate the time you have put in to give me some advice...

    i have included the appropriate library files needed for my project but now i am getting linker errors... or at least thats what i think is happening... it does not know what to do with the *.obj files that are being created.. it compiles fine, but i am getting "unresolved external symbol" errors...

    any thoughts?

  11. #11
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: help creating a project file

    It would help if you could copy and paste here the full link command and error issues by the linker.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. Project suddenly doesn't compile
    By vieraci in forum Qt Programming
    Replies: 16
    Last Post: 7th June 2016, 08:12
  2. Double Clicking Pro File
    By BalaQT in forum Installation and Deployment
    Replies: 2
    Last Post: 18th November 2009, 06:23
  3. distclean batch file
    By talk2amulya in forum Qt Programming
    Replies: 0
    Last Post: 11th April 2009, 13:19
  4. qmake can't process project file on windows
    By s-troz in forum Qt Programming
    Replies: 3
    Last Post: 25th October 2008, 15:51
  5. how can i run a project from only a .ui file in qt4
    By iamjayanth in forum Qt Programming
    Replies: 2
    Last Post: 23rd October 2008, 02:36

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.