Hi people, I had some problems to compile a simple console application with MS Visual C++ 2008 Express and C::B.
The Build log is the following:
cl.exe /nologo /w /DNDEBUG /fp:precise /EHs /Ox /Zc:wchar_t /Zc:forScope /I"C:\Archivos de programa\Microsoft Visual Studio 9.0\VC\include" /c main.cpp /Foobj\main.obj
main.cpp
link.exe /nologo /LIBPATH:"C:\Archivos de programa\Microsoft Visual Studio 9.0\VC\lib" /out:"obj\CodeBlocks y VS2005.exe" obj\main.obj
LINK : fatal error LNK1104: no se puede abrir el archivo 'kernel32.lib'
I look for kernel32.lib but this but this file not exist in "C:\Archivos de programa\Microsoft Visual Studio 9.0\VC\include"
Any idea?
Thanks!
Hi,
"kernel32.lib" should be in Platform SDK (http://www.microsoft.com/downloads/details.aspx?FamilyId=A55B6B43-E24F-4EA3-A93E-40C0EC4F68E5&displaylang=en) LIB directory (usually "c:\Program Files\Microsoft SDKs\Windows\<sdk version>\Lib").
Thanks man!
But I still with links problems when I try to compile a Win32 API GUI application, the console and standard application compile without problems.
I add the Lib and Include derectory of the Windows SDK to the compiler configuration, but nothing...
The linkers errors are about the API functions: CreateWindowEx, ShowWindow, etc.
Can any help? :)
Bye!
Quote from: eagleoneraptor on April 14, 2009, 11:57:16 PM
Thanks man!
But I still with links problems when I try to compile a Win32 API GUI application, the console and standard application compile without problems.
I add the Lib and Include derectory of the Windows SDK to the compiler configuration, but nothing...
The linkers errors are about the API functions: CreateWindowEx, ShowWindow, etc.
Can any help? :)
Bye!
CreateWindowEx (http://msdn.microsoft.com/en-us/library/ms632680(VS.85).aspx) and ShowWindow (http://msdn.microsoft.com/en-us/library/ms633548(VS.85).aspx) functions are in
user32.lib, use MSDN (http://msdn.microsoft.com/en-us/library/ms633548(VS.85).aspx) to find which functions are in kernel32.lib, user32.lib etc.
Thanks again!!
I'm not include user32.lib to the linker because the accustoming to include the file implicitly.
Bye!
PD: Sorry about my english :oops:
Greetings,
check this location:
C:\Archivos de programa\Microsoft SDKs\Windows\v6.0A\Lib
In my case (visual c++ 2008 express - Windows XP SP2)
Then, as well as the functions you use in your code, you need to link some libraries. Add the location above to your compiler path lib search list: (codeblocks-menu->settings->compiler & debugger->search directories tab->linker.
Best regards.