_aligned_malloc conflict

akalinin
2010-02-02
2013-06-06
  • akalinin
    akalinin
    2010-02-02

    Hello!

    I have a following code

    #include <mmintrin.h>
    #include <emmintrin.h>
    #include <stdlib.h>
    ...
    

    I got an error:

    .../mm_malloc.h:31: error: 'void* _aligned_malloc(size_t, size_t)' was declared 'extern' and later 'static'
    .../stdlib.h:413: error: previous declaration of 'void* _aligned_malloc(size_t, size_t)'
    

    How to solve conflict of _aligned_malloc whica are both declared in mm_malloc.h and stdlib.h?

     
  • Kai Tietz
    Kai Tietz
    2010-02-02

    Yes, this is reasoned by an incompatibility of the aligned_malloc of gcc's intrinsic and M$ variant. To avoid this issue please use instead of including directly gcc's ???intrin.h headers the 'intrin.h' header provide by us. It solves for you the issue.

    Regards,
    Kai

     
  • akalinin
    akalinin
    2010-02-03

    Yes, now all works. Thank you!