News:

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

Main Menu

can't Integrate VC 2003 TOOLKIT with C::B

Started by code_tin, August 28, 2005, 10:27:08 AM

Previous topic - Next topic

code_tin

I have installed Microsoft Visual Toolkit 2003 and Platform SDK 2003 SP1,
and setting C::B like this

"Compiler" tab:
D:\Program Files\PlatformSDK\Include
D:\Program Files\CodeBlocks\Include

"Linker" tab:
D:\Program Files\PlatformSDK\Lib
D:\Program Files\CodeBlocks\Lib

"Resource compiler" tab:
D:\Program Files\PlatformSDK\Include

after this.i complied my code
but it still warn like this :
main.obj    error LNK2019: unresolved external symbol __imp__RegOpenKeyA@12

i know that because link can't find the lib file
how to setting the C::B to include lib file?
thanks a lot.

MortenMacFly

Quote from: code_tin on August 28, 2005, 10:27:08 AM
"Compiler" tab:
D:\Program Files\PlatformSDK\Include
D:\Program Files\CodeBlocks\Include
"Linker" tab:
D:\Program Files\PlatformSDK\Lib
D:\Program Files\CodeBlocks\Lib
"Resource compiler" tab:
D:\Program Files\PlatformSDK\Include
First of all: You are mixing compilers here: I assume you've installed Code::Blocks with MinGW (otherwise you would not have an include/lib folder there). You should not mix headers/libraries from Microsoft Platform SDK (D:\Program Files\PlatformSDK\Include) with those from MinGW (D:\Program Files\CodeBlocks\Include). So: Where is your Visual C++ installation? Or did you really install Visual C++ into the Code::Blocks-directory?
If you want to use Code::Blocks with Visual C++ only I suggest you install the compiler-free version. Otherwise make sure you setup the compiler correctly:
1.) Settings->Compiler, choose Visual C++
2.) Settings->Compiler->Visual C++, Directories for Compiler, Linker and Resource-Compiler (Visual C++ AND platform SDK in your case)
3.) Settings->Compiler->Visual C++, Programs -> Make sure you setup the root-path to VC++ here (not platform-SDK)
Furthermore IMHO one normally never installs compilers in a folder that contains spaces (but that's another story...)

Morten.
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]

squizzz

MortenMacFly is right,
Quote
D:\Program Files\CodeBlocks\Include
D:\Program Files\CodeBlocks\Lib
These look suspicious... :) (do they point to VCTK instalation directory?)

Quotehow to setting the C::B to include lib file?
- right click on your project, then click "Build Options"
- navigate to "Linker" tab
- add appropriate libraries (ones that you use) to the project using "Add" button
this space is for rent

mandrav

Quote from: code_tin on August 28, 2005, 10:27:08 AM
main.obj    error LNK2019: unresolved external symbol __imp__RegOpenKeyA@12

All the other posters are right.
Still, the error you 're getting is probably because you haven't added a required library (I think it's advapi32.lib but don't take my word for it)...

Yiannis.
Be patient!
This bug will be fixed soon...

code_tin

thanks all for answer my question.but ...
1. I have change the build option to VCTK 2003, so C::B will no longer use the MinGW's Include and Lib
2. my all programs are installed in D:\, so the VCTK Inlucde and Lib path are right.
3. I know this problem is cause by lake of LIB files,this is the problem that i want to ask.why i add SDK Lib path to C::B VCTK build path,but it looks like doesn't work... :(  all API call's warning.

thanks..

code_tin

thanks Morten's help.
this setting is not only what i have tryed.
i try a lot of ways:
1.only SDK.
2.SDK+VCTK
3.SDK+MinGW

I know the correct setting is like this:

Compiler:
D:\Program Files\Microsoft Visual C++ Toolkit 2003\include
D:\Program Files\Microsoft Platform SDK\Include

Linker:
D:\Program Files\Microsoft Visual C++ Toolkit 2003\lib
D:\Program Files\Microsoft Platform SDK\Lib

Resource compiler:
D:\Program Files\Microsoft Platform SDK\Include

I have tryed this setting.but it doesn't work too:(

code_tin

i have try to add advapi32.lib to project ->build options-> Linker Options
it worked
but if i want to use any WIN32API.
i should add LIB one by one? even i use api like MessageBoxA ?
why the Directories->Linker doesn't work?

grv575

This is how all compilers work.  If you do the same under MSVS it will link to a whole bunch of .lib files by default.  I think the linker is smart enough to match this up and only pull in libraries which are actually used.

code_tin

#8
thank you.
MSVC cover this fact so I'm never need to include some BASE lib before(like user32.lib )
thanks all of you.