Menu

Need help - windows.h

2008-02-01
2012-09-26
  • Nobody/Anonymous

    Hello All,

    I've just learned C++ and I've started a book called "Beginning Game Programming" to do
    just that.

    But the projects included in the CD will compile but not correctly and the compaion
    website is down atm. The .exe produced will run but with run-time bugs.
    However, there is a readme file inside which states that Dev-C++ 4.9.9.1 doesn't implement
    windows.h correctly - it is set to target an older version of windows. It gives a mod
    code block to fix the issue, but it doesn't appear to fix the issue in 4.9.9.2.

    Can anyone tell me how I might find a work around for the related problem?

    Also, after reading the Dev-C++ manuel front to back, and looking for tutorials to find
    help, every time I try to rebuild all and set 'yes' in the linker options to enable
    debugging info, Dev-Cpp seems to forget to execute in debug mode. When I ask it to debug
    again, it tells me "Your project doesn't have debugging info enabled... wanna rebuild?"
    This happens every time, and my break points are set, mind you.

    Any help to the related issues of this thread will be found relavent and appreciated.
    Thanks!

    novice programmer: davesnothere

     
    • Nobody/Anonymous

      Did you check out the "Please Read" thread's section on getting started with the debugger.

      It shows you how to set the right options.

      Wayne

       
    • Nobody/Anonymous

      [QOUTE]Did you check out the "Please Read" thread's section on getting started with the debugger.[\QOUTE]

      Yes sir, I did indeed, and it explains about the same method, basically.
      I'm thinking that when I updated Dev-C++ from 4.9.9.1 to 4.9.9.2 I didn't do a clean
      uninstall ( as explained in the "Please Read" ) and maybe thats the issue with the
      debugger.

      But in relation to the windows.h, I'm certainly lost. Anyones feedback regarding this is
      problem is desperately needed...

       
      • Nobody/Anonymous

        No it doesn't use the same method at all. It shows you how to set the command line
        options

        -g3 -O0

        I know, I wrote it.

        Wayne

         
    • Nobody/Anonymous

      I don't think that migrating from 4.9.9.1 to 4.9.9.2 has the problem that the 'clean uninstall' process seeks to resolve. You should be OK.

      Dev-C++ does not implement <windows.h> at all. The windows header is part of the Win32 API package from www.mingw.org. You can update it from there or via Tools->Check for Updates and Packages.

      With respect to targetting older versions of Windows. I believe that it is probably OK, but you need to set the approproate version macros. It probably has a default target of Windows95/NT whereas the latest MS SDK defaults to XP. That does not make the header wrong, just different. The macros for determining API version are defined here: http://msdn2.microsoft.com/en-us/library/aa383745(VS.85).aspx (you have to use the legacy rather than the 'preferred' macros).

      You set the macros with -D<macro>=<value> compiler options. It is best not to use a #define in the code itself.

      >> Can anyone tell me how I might find a work around for the related problem?
      Well you will have to show us the problem before we could possibly tell you that wouldn't you? I suggest the build log (without the suggested modification so we can see the original problem), and then perhaps the suggested fix. Just because it was in a book does not mean that it is necessarily the best solution. People here have probably been using this tool far longer that the author.

      >> I try to rebuild all and set 'yes' in the linker options to
      >> enable debugging info, Dev-Cpp seems to forget to execute in
      >> debug mode.
      Yes, it is a bug. I think it applies teh option to the Tools->Compiler options, but if you have already created a project, it won't inherit those settings and you have to mannualy set them in Project->Options->Compiler. Or place the -g -O0 options in Project->Options->Parameters. I suggest the first to avoid conflicting settings. Remember to switch optimisation off as well as debug on.

      If you persist in having problems you really do have to post the compile log so we can see what you have done.

      Clifford

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.