Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Visual C++ 6.0 SETUPAPI help! [modified]

Visual C++ 6.0 SETUPAPI help! [modified]

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpquestiondebugging
6 Posts 2 Posters 0 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.
  • C Offline
    C Offline
    callousfantom
    wrote on last edited by
    #1

    Hi, I have only recently got back to VC++ programming and I was only a rookie when I used to program in it but now I need to create an application that can list all the devices attached to the system like "devcon.exe" does. I only just started coding it and I'm now facing a linker error that I just can't resolve! The path to my SETUPAPI.h file exists in the "Directories" under options. And I'm only calling the "SetupDiGetClassDevsEx" function. The program compiles fine but gives the following error while linking: DeviceMDlg.obj : error LNK2001: unresolved external symbol __imp__SetupDiGetClassDevsExA@24 Debug/DeviceM.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe. DeviceM.exe - 2 error(s), 0 warning(s) Please help! I'm losing my mind!:) Thanks and sorry if it's a really stupid question *** What do you mean add SetupAPI.lib to the linker files list?? Paths of both header and lib file are listed under the "Include files" and "Library files" options. Also SetupAPI.h and .lib are present in the default path ~/VC98/Include and ~/VC98/Lib. I didn't add any external library. Any ideas??

    modified on Friday, June 5, 2009 12:36 AM

    C 2 Replies Last reply
    0
    • C callousfantom

      Hi, I have only recently got back to VC++ programming and I was only a rookie when I used to program in it but now I need to create an application that can list all the devices attached to the system like "devcon.exe" does. I only just started coding it and I'm now facing a linker error that I just can't resolve! The path to my SETUPAPI.h file exists in the "Directories" under options. And I'm only calling the "SetupDiGetClassDevsEx" function. The program compiles fine but gives the following error while linking: DeviceMDlg.obj : error LNK2001: unresolved external symbol __imp__SetupDiGetClassDevsExA@24 Debug/DeviceM.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe. DeviceM.exe - 2 error(s), 0 warning(s) Please help! I'm losing my mind!:) Thanks and sorry if it's a really stupid question *** What do you mean add SetupAPI.lib to the linker files list?? Paths of both header and lib file are listed under the "Include files" and "Library files" options. Also SetupAPI.h and .lib are present in the default path ~/VC98/Include and ~/VC98/Lib. I didn't add any external library. Any ideas??

      modified on Friday, June 5, 2009 12:36 AM

      C Offline
      C Offline
      CPallini
      wrote on last edited by
      #2

      You should add SetupAPI.lib to the linker input files list. :)

      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
      This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
      [My articles]

      C 1 Reply Last reply
      0
      • C CPallini

        You should add SetupAPI.lib to the linker input files list. :)

        If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
        This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
        [My articles]

        C Offline
        C Offline
        callousfantom
        wrote on last edited by
        #3

        I'm sorry if I didn't specify it earlier but please look at the extra detail I've added to the end. Is there anything else I need to do too?

        C 1 Reply Last reply
        0
        • C callousfantom

          I'm sorry if I didn't specify it earlier but please look at the extra detail I've added to the end. Is there anything else I need to do too?

          C Offline
          C Offline
          callousfantom
          wrote on last edited by
          #4

          I've also noticed something now. MSDN shows that SetupDiGetClassDevsEx accepts 7 parameters but I guess VC++6.0 uses an older version as the SetupAPI.h header file in the default path(~/VC98/include) accepts only 6 parameters. So I tried to use the header and lib files available with Windows DDK which has SetupDiGetClassDevsEx with 7 params. But the two seem incompatible as now it shows me 37 errors at compile time, all in the header SetupAPI.h. Any help about how to handle this?

          1 Reply Last reply
          0
          • C callousfantom

            Hi, I have only recently got back to VC++ programming and I was only a rookie when I used to program in it but now I need to create an application that can list all the devices attached to the system like "devcon.exe" does. I only just started coding it and I'm now facing a linker error that I just can't resolve! The path to my SETUPAPI.h file exists in the "Directories" under options. And I'm only calling the "SetupDiGetClassDevsEx" function. The program compiles fine but gives the following error while linking: DeviceMDlg.obj : error LNK2001: unresolved external symbol __imp__SetupDiGetClassDevsExA@24 Debug/DeviceM.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe. DeviceM.exe - 2 error(s), 0 warning(s) Please help! I'm losing my mind!:) Thanks and sorry if it's a really stupid question *** What do you mean add SetupAPI.lib to the linker files list?? Paths of both header and lib file are listed under the "Include files" and "Library files" options. Also SetupAPI.h and .lib are present in the default path ~/VC98/Include and ~/VC98/Lib. I didn't add any external library. Any ideas??

            modified on Friday, June 5, 2009 12:36 AM

            C Offline
            C Offline
            CPallini
            wrote on last edited by
            #5

            callousfantom wrote:

            What do you mean add SetupAPI.lib to the linker files list?? Paths of both header and lib file are listed under the "Include files" and "Library files" options. Also SetupAPI.h and .lib are present in the default path ~/VC98/Include and ~/VC98/Lib. I didn't add any external library. Any ideas??

            You should explicitely add SetupAPI.lib to the list of the linker input files (I suppose it is in Project Menu->Settings, Link tab, Category->General->Object/library) :)

            If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
            This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
            [My articles]

            C 1 Reply Last reply
            0
            • C CPallini

              callousfantom wrote:

              What do you mean add SetupAPI.lib to the linker files list?? Paths of both header and lib file are listed under the "Include files" and "Library files" options. Also SetupAPI.h and .lib are present in the default path ~/VC98/Include and ~/VC98/Lib. I didn't add any external library. Any ideas??

              You should explicitely add SetupAPI.lib to the list of the linker input files (I suppose it is in Project Menu->Settings, Link tab, Category->General->Object/library) :)

              If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
              This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
              [My articles]

              C Offline
              C Offline
              callousfantom
              wrote on last edited by
              #6

              Thanks!:):thumbsup:

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups