On Wed, Sep 15, 2010 at 5:47 PM, G E Naganna <[email protected]> wrote: > Hi all, > > I am getting following error if I use __aligned_malloc function in code. > > Error : __mingw_aligned_malloc was not declared in this scope > > My code is as follows > ====================== >
Add an #include <stdlib.h> here, and ... > #include <malloc.h> > > #ifdef _WIN32 > #include <windows.h> > #else > #include <sys/time.h> > #include <linux/limits.h> > #endif > > #ifdef __MINGW32__ .. change this ifdef to look like: #if defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR) > #define _aligned_malloc __mingw_aligned_malloc > #define _aligned_free __mingw_aligned_free > #endif //MINGW > > #if defined (_WIN32) > output = (cl_uint *)_aligned_malloc(sizeof(cl_uint4), 16); > #else > output = (cl_uint *)memalign(16, sizeof(cl_uint4)); > #endif > > ============================================================ > 1. Downloaded mingw-w64-bin_x86_64-mingw_20100914_sezero.zip > 2. Unzipped to C:/mingw64 > 3. Set PATH=C:/mingw64/bin;%PATH% > 4. Built sample code for 64bit using make(I got above error) > > Could anybody help me to fix the problem? I am on XP64, SP1 Do the changes recommended above, and it will compile. > > Note: same code works fine for MinGW downloaded from > http://sourceforge.net/projects/mingw/files_beta/Automated%20MinGW%20Install > er/mingw-get-inst/mingw-get-inst-20100909/ > > > > Thanks and Regards > G E Naganna > -- O.S. PS: No need for posting both to the forum and to the mailing list at the same time. ------------------------------------------------------------------------------ Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev _______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
