Build a dll

21 views
Skip to first unread message

Andrea Madaschi

unread,
Mar 4, 2025, 11:51:48 AMMar 4
to ArrayFire Users
Is there a way to compile a dll that use the Arrayfire library?
I created a simple dll project in Visual studio 2022.

I configured the project following the instruction on the main website:
  • Add "$(AF_PATH)/include;" to Project Properties -> C/C++ -> General -> Additional Include Directories.
  • Add "$(AF_PATH)/lib;" to Project Properties -> Linker -> General -> Additional Library Directories.
  • Add afcpu.lib, afcuda.lib, afoneapi.lib, or afopencl.lib to Project Properties -> Linker -> Input -> Additional Dependencies. based on your preferred backend.

I had the header "#include <arrayfire.h>" to my .cpp file and then I'm not able to do anything else because the compiler gives me many errors.
Is there a guide to make a dll?

Thanks in advance



Aaron Hsu

unread,
Mar 4, 2025, 9:49:13 PMMar 4
to ArrayFire Users
This may or may not be useful to you, but these highlighted lines are the Visual C invocation that I use to build a DLL linked against ArrayFire:


I think you basically have the right idea, but you can cross-check the options you've selected against what I have above and see if they are different, and if so, if they should be. 

--
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.

Reply all
Reply to author
Forward
Message has been deleted
0 new messages