0

I want to use the armadillo library in my C++ code. I downloaded it, and copied both the "include" and "lib_win64" folders into a new folder in my solution folder called "Dependencies".

The include folder contained another folder within which contained all the header files.

The lib_win64 folder contained "libopenblas.dll" and "libopenblas.lib".

Now, I opened up my C++ program in visual studio, went into project properties and changed these:

  • I added $(SolutionDir)Dependencies\armadillo\include in the C++->general->Additional include directories field
  • I added $(SolutionDir)Dependencies\armadillo\lib_win64 in the Linker->general->Additional library directories field
  • I lastly added libopenblas.lib to the Linker->input->Additional dependencies field

The C++ program builds successfully, but when I try to run it, I receive the system error: "The code execution cannot proceed because libopenblas.dll was not found. Reinstalling the program may fix this problem."

The initial armadillo download folder contains other folders, one being an example C++ program. I run that and it compiles and executes as it should, with no system error. So, I don't think the .dll file is corrupted or anything.

I was wondering if someone has maybe had a similar issue, or knows somewhere I may have messed up and can point it out.

Any advice would be much appreicated!

luca
  • 55
  • 6
  • 1
    Add the *.dll* path to *PATH* variable from "*Properties -> Debugging*" Check [\[SO\]: How to include OpenSSL in Visual Studio (@CristiFati's answer)](https://stackoverflow.com/questions/32156336/how-to-include-openssl-in-visual-studio/32158521#32158521) (*Build and run* section). – CristiFati Aug 02 '21 at 09:00
  • @CristiFati I'm not sure where exactly you mean to put the .dll path, ... But I followed the link you gave, and used the method where I just copied the .dll file into the folder where the executable is. Now the program compiles and runs with no linker error. – luca Aug 02 '21 at 09:47
  • You got the gist then. Anyway, I updated the answer, hope it clears some things up. – CristiFati Aug 02 '21 at 11:27
  • There is an answer for [VS2015](https://stackoverflow.com/questions/32960175/including-armadillo-c-library-in-a-c-project-in-microsoft-visual-studio-2015/37686978#37686978), it might give you some help – Claes Rolen Aug 03 '21 at 20:25

0 Answers0