Author Topic: Problem with strsafe.h on settings  (Read 11460 times)

Offline mythcat

  • Multiple posting newcomer
  • *
  • Posts: 14
Problem with strsafe.h on settings
« 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.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9496
Re: Problem with strsafe.h on settings
« Reply #1 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)."
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline mythcat

  • Multiple posting newcomer
  • *
  • Posts: 14
Re: Problem with strsafe.h on settings
« Reply #2 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
But I got this error :
Code: [Select]
-------------- 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 ?
« Last Edit: December 23, 2010, 01:43:30 pm by mythcat »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6636
    • My Best Post
Re: Problem with strsafe.h on settings
« Reply #3 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.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline mythcat

  • Multiple posting newcomer
  • *
  • Posts: 14
Re: Problem with strsafe.h on settings
« Reply #4 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: [Select]
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.


Offline mythcat

  • Multiple posting newcomer
  • *
  • Posts: 14
Re: Problem with strsafe.h on settings
« Reply #5 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: [Select]
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.


Offline stahta01

  • Lives here!
  • ****
  • Posts: 6636
    • My Best Post
Re: Problem with strsafe.h on settings
« Reply #6 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.
« Last Edit: January 09, 2011, 07:01:10 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline mythcat

  • Multiple posting newcomer
  • *
  • Posts: 14
Re: Problem with strsafe.h on settings
« Reply #7 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 ...