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. libs

libs

Scheduled Pinned Locked Moved C / C++ / MFC
debuggingquestion
6 Posts 3 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.
  • D Offline
    D Offline
    derek7
    wrote on last edited by
    #1

    when you write a very simple program you will need links some lib so that it can run. so I want to know which lib will need on PC WINDOW platform . main() { int i = 0; } the program need what lib to link? even I create a plain/empty project with vc6(window console), it link many lib for me ,all is a must? kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:yes /pdb:"Debug/testLib.pdb" /debug /machine:I386 /out:"Debug/testLib.exe" /pdbtype:sept -- modified at 9:00 Tuesday 28th February, 2006

    D M 2 Replies Last reply
    0
    • D derek7

      when you write a very simple program you will need links some lib so that it can run. so I want to know which lib will need on PC WINDOW platform . main() { int i = 0; } the program need what lib to link? even I create a plain/empty project with vc6(window console), it link many lib for me ,all is a must? kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:yes /pdb:"Debug/testLib.pdb" /debug /machine:I386 /out:"Debug/testLib.exe" /pdbtype:sept -- modified at 9:00 Tuesday 28th February, 2006

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      derek7 wrote:

      ...all is a must?

      No, the only one that will be loaded at runtime is kernel32.dll.


      "Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain

      "There is no death, only a change of worlds." - Native American Proverb

      D 1 Reply Last reply
      0
      • D David Crow

        derek7 wrote:

        ...all is a must?

        No, the only one that will be loaded at runtime is kernel32.dll.


        "Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain

        "There is no death, only a change of worlds." - Native American Proverb

        D Offline
        D Offline
        derek7
        wrote on last edited by
        #3

        but I remove all lib it also work. #include main() { int i = 0; std::cout<<"t\n"; }; the code work without any lib( no kernal.dll ) so I guess the c++ standard lib is linked unapparently but another question appear :if I DO NOT use cout how to unlink the c++ standard lib ? BTW: Is c++ standard lib c runtime lib? -- modified at 9:44 Tuesday 28th February, 2006

        D 1 Reply Last reply
        0
        • D derek7

          but I remove all lib it also work. #include main() { int i = 0; std::cout<<"t\n"; }; the code work without any lib( no kernal.dll ) so I guess the c++ standard lib is linked unapparently but another question appear :if I DO NOT use cout how to unlink the c++ standard lib ? BTW: Is c++ standard lib c runtime lib? -- modified at 9:44 Tuesday 28th February, 2006

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          derek7 wrote:

          the code work without any lib( no kernal.dll )

          Even though you removed kernel32.lib from the linker options, kernel32.dll is still "loaded" for your program. Look at the debug window to observe this.

          derek7 wrote:

          BTW: Is c++ standard lib c runtime lib?

          Are you referring to msvcrt.dll?


          "Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain

          "There is no death, only a change of worlds." - Native American Proverb

          D 1 Reply Last reply
          0
          • D derek7

            when you write a very simple program you will need links some lib so that it can run. so I want to know which lib will need on PC WINDOW platform . main() { int i = 0; } the program need what lib to link? even I create a plain/empty project with vc6(window console), it link many lib for me ,all is a must? kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:yes /pdb:"Debug/testLib.pdb" /debug /machine:I386 /out:"Debug/testLib.exe" /pdbtype:sept -- modified at 9:00 Tuesday 28th February, 2006

            M Offline
            M Offline
            mbue
            wrote on last edited by
            #5

            It's a very unusual question. But i can be wrong. Don't panic to link all the default .lib's. There is no more code as you use (DevStudio does so). But further you can remove all .lib's and bind only libs you want. Sample: #pragma comment ( lib, "XYZ" ) // thats what i do M$ itselves has prepared a .csv file to examine what .lib you need. You can find it at: \MSDEV\LIB\WIN32API.CSV oder \Microsoft Visual Studio\VC98\Lib\WIN32API.CSV and so on.

            1 Reply Last reply
            0
            • D David Crow

              derek7 wrote:

              the code work without any lib( no kernal.dll )

              Even though you removed kernel32.lib from the linker options, kernel32.dll is still "loaded" for your program. Look at the debug window to observe this.

              derek7 wrote:

              BTW: Is c++ standard lib c runtime lib?

              Are you referring to msvcrt.dll?


              "Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain

              "There is no death, only a change of worlds." - Native American Proverb

              D Offline
              D Offline
              derek7
              wrote on last edited by
              #6

              yes

              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