Placing < windows.h> before <arrayfire.h> causes compilation errors

11 views
Skip to first unread message

vduva...@gmail.com

unread,
Oct 2, 2021, 5:14:45 PM10/2/21
to ArrayFire Users
Hi ArrayFire,

In the "helloworld.cpp" file, if I do the add <windows.h> header, as follows:

#include <windows.h>

#include <arrayfire.h>

then, the following compilation errors occur:
Severity Code Description Project File Line Suppression State
Error (active) E0018 expected a ')' TestArrayFire3_8 C:\Program Files\ArrayFire\v3\include\af\algorithm.h 163
Error (active) E0145 variable "af::minByKey" may not be initialized TestArrayFire3_8 C:\Program Files\ArrayFire\v3\include\af\algorithm.h 180
Error (active) E0020 identifier "keys_out" is undefined TestArrayFire3_8 C:\Program Files\ArrayFire\v3\include\af\algorithm.h 180
Error (active) E0146 too many initializer values TestArrayFire3_8 C:\Program Files\ArrayFire\v3\include\af\algorithm.h 180
Error (active) E0020 identifier "vals_out" is undefined TestArrayFire3_8 C:\Program Files\ArrayFire\v3\include\af\algorithm.h 180

It looks like there may be a clash with the min() function defined in <windows.h> (maybe?)

-Victor

Pradeep Garigipati

unread,
Oct 4, 2021, 12:27:46 AM10/4/21
to vduva...@gmail.com, ArrayFire Users
Hello Victor,

If windows headers are included in your application, you may most often need to include definitions NOMINMAX and WIN32_LEAN_AND_MEAN compile definitions depending on your application needs.

Hope that helps.

Regards,
Pradeep.

--
You received this message because you are subscribed to the Google Groups "ArrayFire Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to arrayfire-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/arrayfire-users/90c01b07-7e57-467a-9ac4-2e31ce3fbe46n%40googlegroups.com.


--

vduva...@gmail.com

unread,
Oct 4, 2021, 10:02:20 PM10/4/21
to ArrayFire Users
Thank you Pradeep. That solved this issue.
Reply all
Reply to author
Forward
0 new messages