Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Imported subdirs project using git and Qt Creator can't find libraries
Forum Updated to NodeBB v4.3 + New Features

Imported subdirs project using git and Qt Creator can't find libraries

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 3.5k 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.
  • Q Offline
    Q Offline
    quicknick26
    wrote on 23 May 2013, 01:20 last edited by
    #1

    This is probably a frequently asked question, but I did a little searching and couldn't find anything on the surface. I started a subdirs project on my laptop in the front room. I put my libraries in folders separate from the app and added them to the app by right-clicking on the project tree and selecting add library. The program compiles and runs just fine.

    I set up a project on sourceforge ("VIMAT":https://sourceforge.net/projects/vimat/) and sent everything over using Git. When I went to my office to clone on my desktop, Qt Creator recommended not to use the same project settings. I got all of the files, but now the program won't run. I tried using the same process that I did on my laptop to add the libraries to the subprojects. It keeps giving me "/usr/bin/ld: cannot find -lvimatDB" and "collect2: ld returned 1 exit status." I'm sure there is more configuring that needs to be done. I know a little bit about writing code and I know much less about the whole make/build process. I don't know where to begin to get this working on my desktop. Any ideas?

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on 23 May 2013, 03:23 last edited by
      #2

      The vimat.pro file should be part of the source but the Qt Creator related settings file (vimat.pro.user) generally should not be because they will be different from machine to machine, platform to platform etc.

      You should use
      @
      CONFIG += ordered
      @
      in your vimat.pro file to ensure that the vimatLibrary is built before the other components that require it to exist in order to build. Without "ordered" the four sub directories may be traversed in any order.

      See "qmake Project files" in the qmake manual.

      1 Reply Last reply
      0
      • Q Offline
        Q Offline
        quicknick26
        wrote on 23 May 2013, 03:56 last edited by
        #3

        Thank you so much! I added that line to my project file and reordered my subdirs the way they're supposed to be right below that line and now it's running on both computers. I'm glad this isn't going to be an ordeal any longer.

        Your reply begs the question: How do you tell Qt Creator that you want to store the settings file outside the project? Obviously it would be silly to continue sending that back and forth to the repository when it doesn't do any other machines any good. I searched online and saw people wanting to locate it so they could back it up, but not relocate it. I looked in the options on Qt Creator and didn't see anything in there.

        Thanks again, Chris

        1 Reply Last reply
        0
        • A Offline
          A Offline
          amccarthy
          wrote on 23 May 2013, 04:57 last edited by
          #4

          There isn't an option to get Qt Creator to store the .pro.user file in a different location. Instead I suggest you remove it from git and set up a git ignore rule.

          Remove the existing file from git without removing it from the working directory:

          @
          git rm --cached *.pro.user
          git commit -m "Remove .pro.user file from git"
          @

          The add the follow to the .gitignore file (see git help ignore)

          @*.pro.user@

          1 Reply Last reply
          0
          • Q Offline
            Q Offline
            quicknick26
            wrote on 23 May 2013, 20:13 last edited by
            #5

            And thanks to you. Worked like a charm. Some day I hope to have my own sense of InTuition when it comes to problem-solving like this.

            1 Reply Last reply
            0

            1/5

            23 May 2013, 01:20

            • Login

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