News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Code::Blocks 10.05 && VC++ 2010 compiler setup

Started by kiwiDude, July 15, 2010, 02:10:47 PM

Previous topic - Next topic

kiwiDude

Hey there having a little difficulty setting up C::B with VC++2010, reason I'm using C::B over the VC++ 2010 IDE is that my laptop isn't very fast (Pentium III, 512MB RAM) so C::B runs/loads alot faster than VC++2010. 

Basically the "default" VC++ compiler location sets it self to the VC++ 2008 edition, and so I have to manually enter the path for the toolchain etc.  I'm a hobbyist programmer so I'm not sure what the extra options really mean in regards to what additional options I should be setting (sorry if thats a bit vague), I have the windows platform SDK installed but whenever I try to compile including the "windows.h" header file it says:

Quotefatal error C1083: Cannot open include file: 'windows.h': No such file or directory|

Now I'm not sure if this is because I haven't configured C::B correctly or if its something else, because of this sorry if this is the wrong section to post this in.  What I have done though is replaced the path of the default VC++ 2008 toolchain with the 2010 edition (where the compiler etc resides), although I'm still getting the error when trying to compile.

Trying with the standard headers for example like this:


#include <stdio.h>

int main(void){

    return 0;
}


And i get this from the build message box:

QuoteLINK||fatal error LNK1104: cannot open file 'kernel32.lib'|

Bit stuck..

MortenMacFly

Quote from: kiwiDude on July 15, 2010, 02:10:47 PM
Quotefatal error C1083: Cannot open include file: 'windows.h': No such file or directory|
Add the path to the platform SDK (header files) to the project's build options under compiler include paths.

Quote from: kiwiDude on July 15, 2010, 02:10:47 PM
QuoteLINK||fatal error LNK1104: cannot open file 'kernel32.lib'|
Add the path to the platform libraries to the project's build options under linker include paths.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

kiwiDude

Quote from: MortenMacFly on July 15, 2010, 02:31:22 PM
Quote from: kiwiDude on July 15, 2010, 02:10:47 PM
Quotefatal error C1083: Cannot open include file: 'windows.h': No such file or directory|
Add the path to the platform SDK (header files) to the project's build options under compiler include paths.

Quote from: kiwiDude on July 15, 2010, 02:10:47 PM
QuoteLINK||fatal error LNK1104: cannot open file 'kernel32.lib'|
Add the path to the platform libraries to the project's build options under linker include paths.


Aha that did it, sorry about this thread, still feeling my way around IDE's and such.

ysg

Quote from: MortenMacFly on July 15, 2010, 02:31:22 PM
Quote from: kiwiDude on July 15, 2010, 02:10:47 PM
Quotefatal error C1083: Cannot open include file: 'windows.h': No such file or directory|
Add the path to the platform SDK (header files) to the project's build options under compiler include paths.

Quote from: kiwiDude on July 15, 2010, 02:10:47 PM
QuoteLINK||fatal error LNK1104: cannot open file 'kernel32.lib'|
Add the path to the platform libraries to the project's build options under linker include paths.

Hi, I know that this thread is quite old, but I'm having the same problem as OP (and didn't want to make another thread, I can if that would be more appropriate).

But, honestly, I don't know where my SDK header files are on my machine.  The same goes for the libraries on my machine.  I'm running Win 7 32-bit at work and Vista 64-bit at home (if that helps).

And yes, I've googled and have yet to find a good solution to my problem.  This is the contents of C:\Program Files\Microsoft SDKs\Windows as printed out by cygwin:
http://bin.cakephp.org/view/1135131447

And yes, I'd like to use VC++ 2010 for my compiler.

Thanks in advance.

stahta01

C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

hawsang

i have just met and solved this problem. Maybe i can help u~
click into the "setting" button, and get into "Compiler..." ,there is a "Linker settings" in the horizontally lied menu, get into it.

then "add" "link libraries", find the kernel32.lib in your computer,(usually C:\Program Files\Microsoft SDKs\Windows\"version"\Lib\Kernel32.Lib, find it and click it into the link library sheet).

click"OK"

maybe your program can execute now!

forgive my poor English  :(  wish you can solve this problem too!


cacb

VC2010, either full version or free express version works very well with Code::Blocks, I am using both. Attached files show the compiler configuration settings needed to make it work.

Notice that this is for a recent Nightly Build on Windows, 8982 in this case. Notice also that using the VC2010 compiler may require debugging to be done in the VC2010 IDE. I have configured an entry in the Tools menu for this purpose.

cacb


cacb


oBFusCATed

cacb:
Don't attach images please, instead use a image upload service.
Forum space is limited and files are deleted at random. So your posts might get none-informational in the future.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]