News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Using C::B with MS Visual C++ 2008 Express

Started by eagleoneraptor, April 14, 2009, 09:39:58 PM

Previous topic - Next topic

eagleoneraptor

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!

polygon7

#1
Hi,
"kernel32.lib" should be in Platform SDK LIB directory (usually "c:\Program Files\Microsoft SDKs\Windows\<sdk version>\Lib").

best regards,
p7
Free open source UML modeling tool: ArgoUML

eagleoneraptor

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!

polygon7

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 and ShowWindow functions are in user32.lib, use MSDN to find which functions are in kernel32.lib, user32.lib etc.
best regards,
p7
Free open source UML modeling tool: ArgoUML

eagleoneraptor

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:

davemaster

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.
David Elias Flores Escalante