Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: mythcat on December 22, 2010, 07:38:53 pm

Title: Problem with strsafe.h on settings
Post by: mythcat on December 22, 2010, 07:38:53 pm
Hi

I try using DirectX template from C::B , but C::B not find "strsafe.h".
I use Code::Blocks with mingw32 10.05 .
What i make wrong ?

Thank you.
Title: Re: Problem with strsafe.h on settings
Post by: MortenMacFly on December 22, 2010, 09:15:13 pm
I try using DirectX template from C::B , but C::B not find "strsafe.h".
http://lmgtfy.com/?q=strsafe.h

...reveals in the first link:
"Strsafe.h is available in the Windows SDK starting with Windows XP with Service Pack 2 (SP2)."
Title: Re: Problem with strsafe.h on settings
Post by: mythcat on December 23, 2010, 10:42:36 am
Yes I've found .
Quote
You should also note that Windows SDK[8] shall be installed in order to compile Windows app.
I download it from here: http://www.microsoft.com/downloads/details.aspx?FamilyID=e6e1c3df-a74f-4207-8586-711ebe331cdc&DisplayLang=en (http://www.microsoft.com/downloads/details.aspx?FamilyID=e6e1c3df-a74f-4207-8586-711ebe331cdc&DisplayLang=en)
But I got this error :
Code
-------------- Build: Debug in testDX9 ---------------

cl : Command line warning D9002 : ignoring unknown option '-g'
cl : Command line warning D9002 : ignoring unknown option '-ggdb'
cl : Command line warning D9024 : unrecognized source file type 'Files\Microsoft', object file assumed
cl : Command line warning D9024 : unrecognized source file type 'Visual', object file assumed
cl : Command line warning D9024 : unrecognized source file type 'Studio', object file assumed
LINK : fatal error LNK1181: cannot open input file 'Files\Microsoft.obj'
Process terminated with status 2 (0 minutes, 0 seconds)
1 errors, 0 warnings
 
I think C::B not see the compiler from Microsoft SDK ... and this is from Visual Studio
How i set it ?
Title: Re: Problem with strsafe.h on settings
Post by: stahta01 on December 23, 2010, 03:11:09 pm
Set default compiler to the correct Compiler; not MinGW GCC if you wish to use MS Visual Studio!
Re-do the project from template using the correct Compile; do NOT pick MinGW GCC if you wish to use MS Visual Studio!

Tim S.
Title: Re: Problem with strsafe.h on settings
Post by: mythcat on December 23, 2010, 09:06:49 pm
I try use Compiler from MS SDK , not  MS Visual Studio.
But C::B not see MS SDK compiler, if it is on \Bin.
My path is something like this :
Code
C:\Program Files\Microsoft SDKs\Windows\v6.1\Bin 
Maybe correct way is to install MS SDK and next install C::B.
I think is more easy if C::B come with some default settings for each compiler.
Maybe some tutorials is need to understand how is corect way to set up C::B.
Is good to be fully custom , but become dizzy with new users like me.
Thank you .
Regards.

Title: Re: Problem with strsafe.h on settings
Post by: mythcat on January 09, 2011, 11:29:11 am
I  solve the problem with add "#include <cstddef>" and remove "strsafe.h"
I  set SDK 2008 and Windows SDK v6.0.
I  set on Toolchain "C:\Program Files\CodeBlocks\MinGW" (seam Auto-detect want this path) .
On tabs "Program Files" and "aditional.." from toolchain is set correct "mingw32-g++.exe" path .
Now i got this error :
Code
mingw32-g++.exe: CreateProcess: No such file or directory
Process terminated with status 1 (0 minutes, 4 seconds)
0 errors, 2 warnings
...and C::B not make the exe file.
What is wrong ?
Thank you . Regards.

Title: Re: Problem with strsafe.h on settings
Post by: stahta01 on January 09, 2011, 06:56:29 pm
The message you got normally means an improper MinGW GCC Installation.
It could be an improper CB Configuration of the Compiler.

NOTE: You CAN NOT use MinGW GCC with MS SDK and have it Work!!

Tim S.
Title: Re: Problem with strsafe.h on settings
Post by: mythcat on January 12, 2011, 10:25:19 am
Quote
NOTE: You CAN NOT use MinGW GCC with MS SDK and have it Work!!
Can you tell me more ? I think more people thinking is working ...