User forums > Using Code::Blocks

win32 compile problem

<< < (3/4) > >>

bootstrap:
You know what?  I wonder whether I have any w32api headers installed at all.

When I downloaded the CodeBlocks binary package, I downloaded the large "everything" package that I thought included everything necessary to build win32 applications with CodeBlocks and mingw32.  But I wonder... where are those mingw32 header files supposed to be on my computer, so I can make sure they exist?

bootstrap:
Well, I just installed mingw with their automatic installer, which definitely created a c:/mingw directory with "include" and other subdirectories, so no question about that any longer.  Even when I put c:/mingw/include in the "default search path" list, it does not seem to find them.

For example, the first error appears in one of my files that contains:

#include <malloc.h>

near the top, but still generates errors on the following two lines:

  data = (u08*) _aligned_malloc (bytes, 16);

and

  if (buffer) { _aligned_free (buffer); }

...even though I look inside c:/mingw/include/malloc.h and find those functions *are* declared.  The error messages say:

error: '_aligned_malloc' was not declared in this scope
error: '_aligned_free' was not declared in this scope

Then, dork that I am, I tried adding

#include "c:/mingw/include/malloc.h"

at the top of my file, and it *still* generates the same exact errors (see above).

Wow!  Got me, batman!

I am beginning to feel un-freaking-believably stupid!!!  But I just don't know why, yet.  :-(

MortenMacFly:

--- Quote from: bootstrap on January 28, 2009, 03:11:16 am ---  data = (u08*) _aligned_malloc (bytes, 16);

--- End quote ---
Are you aware that these prototypes are within an ifdef statement:

--- Code: ---/* These require msvcr70.dll or higher. */
#if __MSVCRT_VERSION__ >= 0x0700
[...]
#endif

--- End code ---
???

bootstrap:
Eh, no, I didn't notice that, but you raise a question.

My code compiles and runs the way it is on VisualStudio2005.  Roughly how many "extra" #defines (that I don't have now and don't need in VS) am I likely to need to add?  And, do they belong in the #define tab in the IDE, or in my code somewhere?

Biplab:

--- Quote from: bootstrap on January 28, 2009, 08:13:29 am ---Eh, no, I didn't notice that, but you raise a question.

My code compiles and runs the way it is on VisualStudio2005.  Roughly how many "extra" #defines (that I don't have now and don't need in VS) am I likely to need to add?  And, do they belong in the #define tab in the IDE, or in my code somewhere?

--- End quote ---

Add the following


--- Code: ---__MSVCRT_VERSION__=0x0700
--- End code ---

to Project > Build options... > #defines

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version