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. ProcessIdToSessionId undeclared?
Forum Updated to NodeBB v4.3 + New Features

ProcessIdToSessionId undeclared?

Scheduled Pinned Locked Moved General and Desktop
6 Posts 3 Posters 3.8k 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
    QtNoob
    wrote on last edited by
    #1

    Hello!

    I have this problem when I try to compile...
    @error: undefined reference to `ProcessIdToSessionId(unsigned long, unsigned long*)@8'@

    It is declared on winbase.h which is included in windows.h and I'm like wtf? is it the linker? I need some help with this please, I can't seem to go back to visual studio after using this sexy library + IDE :D

    1 Reply Last reply
    0
    • G Offline
      G Offline
      giesbert
      wrote on last edited by
      #2

      If this is a windows API cal, you must add the needed library to your pro file. In mSVS, some of the libs are linked automatically, but that is not done with mingw.

      Nokia Certified Qt Specialist.
      Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

      1 Reply Last reply
      0
      • Q Offline
        Q Offline
        QtNoob
        wrote on last edited by
        #3

        thanks, now I have been trying to add the lib to the pro file but when I choose the lib file the "next" button stays "disabled"...

        1 Reply Last reply
        0
        • Q Offline
          Q Offline
          QtNoob
          wrote on last edited by
          #4

          for some weird reason adding extern "C" fixed the issue? I have no idea why though...

          1 Reply Last reply
          0
          • L Offline
            L Offline
            lgeyer
            wrote on last edited by
            #5

            Because C and C++ mangle functions different (the same functions result in different symbol names).

            See How to mix "C and C++":http://www.parashift.com/c++-faq-lite/mixing-c-and-cpp.html.

            1 Reply Last reply
            0
            • Q Offline
              Q Offline
              QtNoob
              wrote on last edited by
              #6

              Oh that makes sense :S thanks man.

              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