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