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. Environment Variables
QtWS25 Last Chance

Environment Variables

Scheduled Pinned Locked Moved General and Desktop
18 Posts 5 Posters 9.7k Views
  • 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
    Arukas
    wrote on last edited by
    #1

    I've been having fun. I'm going through someone else's code. I keep trying to compile their code, and the error I get is something about an environment variable not found. It just names the variable, and when I do a search for it in the PRO and source files, I can't find it. Can anyone shed any light on this for me?

    -Thanks

    1 Reply Last reply
    0
    • P Offline
      P Offline
      p-himik
      wrote on last edited by
      #2

      Maybe your project is incomplete and developers used some script to compile it.

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

        That very possibly true. However, Qt is what is asking for the environmental variable, and I can't figure out how it knows it needs that variable. I can't find the variable through a search, but it knows it needs one.

        What tells Qt to look for a environmental variable? I've poke around with the code but can't figure out how Qt knows it needs it.

        1 Reply Last reply
        0
        • P Offline
          P Offline
          p-himik
          wrote on last edited by
          #4

          Could you at least provide us the name of that variable?

          1 Reply Last reply
          0
          • F Offline
            F Offline
            foxyz
            wrote on last edited by
            #5

            Yes, You need tell us what the variable's name is. and you can try search in Makefile for it

            Usually, DEFINES += in PRO file ....

            I just know coding and coding

            1 Reply Last reply
            0
            • F Offline
              F Offline
              foxyz
              wrote on last edited by
              #6

              Sorry, I'm wrong. Environment Variable usually appears in make script

              I just know coding and coding

              1 Reply Last reply
              0
              • A Offline
                A Offline
                Arukas
                wrote on last edited by
                #7

                Greetings,

                -I started an old post, and I didn't want to recycle it as I have learn more about the problem.-

                I have a bunch of old source files I am looking through with little documentation. When I try to compile part of the code it gives me "MY_AAB_DIRECTORY". That doesn't look like a windows variable, it looks like a predefine variable in project files. However, I cannot locate that variable in the source code at all.

                I even opened up a project file in the source code. This project file had no other associated files with it for some reason, and I deleted the two lines that was in it. However when I ran qmake, I got the error about not finding the environment variable, and clearly this file was no associated with anything else, it was virtually a blank file. I even clean and clear everything before I ran qmake.

                What I have notice is if I drag a folder out of the source directory, I just unzipped the source files into an empty directory, onto the desktop I don't get the error about not finding the environment variable.

                So my question is how is Qt knowing it needs this variable? Obviously Qt is reading in some other directory but I don't know how it knows. I done everything I can think off, and still can't figure out where it is at.

                Thanks!

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  andre
                  wrote on last edited by
                  #8

                  The moderators think it is the same topic, and should thus be continued in the same forum thread, hence the merge. If the 'old topic' would have been months old or even older, perhaps you would have been right to start a new one. In this case, it is only a day old. That is not an 'old topic', it is just starting a second one on the same issue.

                  Frankly, I find it a bit disrespectful to the people who have responded in your 'old' post, who you did not seem fit to reply to. If you did not reply earlier, how is that stimulating for these people to now try to help you again?

                  1 Reply Last reply
                  0
                  • G Offline
                    G Offline
                    goetz
                    wrote on last edited by
                    #9

                    Just do a

                    @
                    find . -type f -print0 | xargs -0 grep MY_AAB_DIRECTORY
                    @

                    in the source directory. It will show you all the occurrences of the string MY_AAB_DIRECTORY, if any. This will work on any Unix/Linux/Mac and with MinGW on Windows.

                    http://www.catb.org/~esr/faqs/smart-questions.html

                    1 Reply Last reply
                    0
                    • A Offline
                      A Offline
                      andre
                      wrote on last edited by
                      #10

                      I just hit CTRL+SHIFT+F in Qt Creator to do the same :-)

                      1 Reply Last reply
                      0
                      • G Offline
                        G Offline
                        goetz
                        wrote on last edited by
                        #11

                        [quote author="Andre" date="1330597667"]I just hit CTRL+SHIFT+F in Qt Creator to do the same :-)[/quote]

                        That's only half the fun :)

                        http://www.catb.org/~esr/faqs/smart-questions.html

                        1 Reply Last reply
                        0
                        • A Offline
                          A Offline
                          Arukas
                          wrote on last edited by
                          #12

                          I had already did the CTRL+SHIFT+F in Qt Creator, before I posted.

                          1 Reply Last reply
                          0
                          • G Offline
                            G Offline
                            goetz
                            wrote on last edited by
                            #13

                            Sorry, I have not a single clue, what's going wrong here. The description is too vague and without looking at the actual project, I doubt that we can get any further here.

                            http://www.catb.org/~esr/faqs/smart-questions.html

                            1 Reply Last reply
                            0
                            • A Offline
                              A Offline
                              Arukas
                              wrote on last edited by
                              #14

                              Let me give you a clearer picture:

                              I have one project with just one file in it, the project file itself. There are only two lines in this project file, and I delete them. (Not: these two lines did not contain anything about the environment variable) I save the changes, I then clean all. There is now nothing in the project file and only this project file is loaded. I either do a qmake or build all, I get that error about my environmental variable not being found, on an empty project file.

                              So if you imagine a blank and empty project giving me MY_AAB_DIRECTORY environment variable, you have an accurate picture.

                              -Arukas

                              1 Reply Last reply
                              0
                              • G Offline
                                G Offline
                                goetz
                                wrote on last edited by
                                #15

                                How is an empty project file supposed to do any reasonable work?

                                http://www.catb.org/~esr/faqs/smart-questions.html

                                1 Reply Last reply
                                0
                                • A Offline
                                  A Offline
                                  Arukas
                                  wrote on last edited by
                                  #16

                                  That not my point. Your concern was you needed to see the project, and I'm pointing out there's nothing to see, literally. Qmake shouldn't give errors on empty project files about environment variables. I gave it a try Qmake does nothing on an empty file. I can also reproduce the same errors by deleting the entire contents of another project in the source folder.

                                  I should of mention earlier, when I get the error and click on it, it says "file not found". So its looking for something that's not there, and I don't know why its looking for it in the first place.

                                  -Thanks
                                  Arukas

                                  1 Reply Last reply
                                  0
                                  • G Offline
                                    G Offline
                                    goetz
                                    wrote on last edited by
                                    #17

                                    qmake moans on an empty test.pro - because it wants to link something (the app name is based on some default logic if there's no TARGET explicitly set). So no, qmake is not quiet on an empty project file.

                                    So, maybe you want to post the complete build log of that empty project. I doubt that anyone can imagine what's going on here.

                                    http://www.catb.org/~esr/faqs/smart-questions.html

                                    1 Reply Last reply
                                    0
                                    • A Offline
                                      A Offline
                                      Arukas
                                      wrote on last edited by
                                      #18

                                      Where's this build file?

                                      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