Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. [Moved] Define a macro on Qt for Embedded Linux
Forum Updated to NodeBB v4.3 + New Features

[Moved] Define a macro on Qt for Embedded Linux

Scheduled Pinned Locked Moved Mobile and Embedded
8 Posts 3 Posters 4.7k 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.
  • G Offline
    G Offline
    goli
    wrote on last edited by
    #1

    I try to define a macro for Embedded Linux project. this is what i write:

    @
    #ifdef Q_WS_WIN // Windows
    const QString BASE_DIRECTORY = "C:/path/on/windows";
    #elif defined(Q_WS_QWS) || defined(Q_WS_QPA) // Embedded linux
    const QString BASE_DIRECTORY = "/path/on/board";
    #else // Linux
    const QString BASE_DIRECTORY = "/home/path/on/linux-ubuntu";
    #endif // OS type
    @

    on the board that is Embedded Linux *lighthouse * version the BASE_DIRECTORY is equal to
    "/home/path/on/linux-ubuntu" .

    how can i figure out the OS version, and fix it?

    tnx

    1 Reply Last reply
    0
    • A Offline
      A Offline
      Anticross
      wrote on last edited by
      #2

      I think this not right branch of forum to ask such questions. Post in Mobile and Embedded.

      1 Reply Last reply
      0
      • K Offline
        K Offline
        koahnig
        wrote on last edited by
        #3

        [quote author="Anticross" date="1325160416"]I think this not right branch of forum to ask such questions. Post in Mobile and Embedded.[/quote]

        This might not be the best place to post for everything, but reposting the same thing in different forums is not a good solution either. Someone of the moderators will eventually move the topic.

        Vote the answer(s) that helped you to solve your issue(s)

        1 Reply Last reply
        0
        • G Offline
          G Offline
          goli
          wrote on last edited by
          #4

          where i can post this question exactly to get any help?

          1 Reply Last reply
          0
          • K Offline
            K Offline
            koahnig
            wrote on last edited by
            #5

            [quote author="goli" date="1325076024"]I try to define a macro for Embedded Linux project. this is what i write:

            @
            #ifdef Q_WS_WIN // Windows
            const QString BASE_DIRECTORY = "C:/path/on/windows";
            #elif defined(Q_WS_QWS) || defined(Q_WS_QPA) // Embedded linux
            const QString BASE_DIRECTORY = "/path/on/board";
            #else // Linux
            const QString BASE_DIRECTORY = "/home/path/on/linux-ubuntu";
            #endif // OS type
            @

            on the board that is Embedded Linux *lighthouse * version the BASE_DIRECTORY is equal to
            "/home/path/on/linux-ubuntu" .

            how can i figure out the OS version, and fix it?

            tnx

            [/quote]
            What do you mean with figuring out the OS?
            Typically the information you are using in your example would be part of some defines you are using.

            Vote the answer(s) that helped you to solve your issue(s)

            1 Reply Last reply
            0
            • G Offline
              G Offline
              goli
              wrote on last edited by
              #6

              i need to define a path that will be avalible only on the embedded system and i can't find the right define to achieve that.
              In the example you can see that I try
              @#elif defined(Q_WS_QWS) || defined(Q_WS_QPA) // Embedded linux
              @
              but it does not work and i entered into the default:
              @#else // Linux
              const QString BASE_DIRECTORY = "/home/path/on/linux-ubuntu";
              #endif // OS type
              @

              1 Reply Last reply
              0
              • K Offline
                K Offline
                koahnig
                wrote on last edited by
                #7

                I guess you have compiled Qt for cross-compilation to use with your embedded platform.
                Duirng configuration there is typically a sequence like "-xplatform qws/linux-arm-g++" for example. All default macro definitions can be found in "mkspecs/qws/linux-arm-g++" in your cross compiled installation (respective any compilation). Probably you have to follow different include files until you find the master. However, there you find all definitions for compilation.

                Vote the answer(s) that helped you to solve your issue(s)

                1 Reply Last reply
                0
                • G Offline
                  G Offline
                  goli
                  wrote on last edited by
                  #8

                  what are the definitions if I use lighthouse and not qws? I could not find any information in "mkspecs/qws/linux-arm-g++” 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