How to fix "libopenblas.dll was not found" system error on visual studio C++? - c++

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!

Related

OpenCV: Code Execution Cannot Proceed, DLLs Missing

I'm making a program using OpenCV and I need feature matching. I was previously using OpenCV3 but apparently getting SURF to work is a bit of a hassle so I switched to OpenCV2.4
I downloaded the pre-built libraries and I want to use them on Visual studio but I have a problem, when I run the program I get messages like this:
When I click ok I get more follow up messages complaining about other missing dlls. I tries re-installing but still get this error.
Here are my settings:
Under C/C++>General: Additional Include Directores:
C:\opencv2.4\opencv\build\include
Under Linker>General: Additional Library Directories:
C:\opencv2.4\opencv\build\x64\vc14\lib
C:\opencv2.4\opencv\build\x64\vc14\bin
Under Linker>Incput: Additional Dependencies:
opencv_calib3d2413.lib
opencv_contrib2413.lib
opencv_core2413.lib
opencv_features2d2413.lib
opencv_flann2413.lib
opencv_gpu2413.lib
opencv_highgui2413.lib
opencv_imgproc2413.lib
opencv_legacy2413.lib
opencv_ml2413.lib
opencv_nonfree2413.lib
opencv_objdetect2413.lib
opencv_ocl2413.lib
opencv_photo2413.lib
opencv_stitching2413.lib
opencv_superres2413.lib
opencv_ts2413.lib
opencv_video2413.lib
opencv_videostab2413.lib
I've also tried editing the Environment Variables under Path I've added the include\ bin\ and lib\ directories. I have absolutely no idea how to fix this problem. I know the dlls are there.
I copied and pasted the dlls from the bin\ directory into my solution directory and everything works fine now.
I'm not sure why adding the bin\ to the path didn't work but anyway here's the solution to that problem.
The execution program did not find the DLL.
Under "Linker>General: Additional Library Directories" it expect the path for .lib files, but the DLL are searched by the program during the executio, so in the current folder and in the PATH folders.
Put the Dll's into the execution folder or modify the PATH to add the DLL's folder (in this last case remember to restart Visual Studio).
Cheers

How can I make my application find a third-party DLL using Visual Studio?

I have read many issues regarding and followed each one but nothing seems to work.
I am trying to include the rdkafka library into my project, but every time I run the application I am getting
The program can't start because librdkafka.dll is missing from your computer.
I can clearly see that librdkafka.dll as well as librdkafka.lib exist in the same directory. I have added the include files to the project, and I have also added the librdkafka.lib to the additional directories in the Linker section. The project builds fine but it throws that error at runtime.
Does anyone know how I can solve this issue?
When in Visual Studio by default it is searching for dlls in the project directory and running the application on its own will try to find the dlls in the current working directory. Moving the dlls to this location seems to solve the issue.

VS2012: Program can't start because "libvorbisfile.dll" is missing

I've got a project and I'm trying to make it read a .OGG file.
I've downloaded the libogg and libvorbis from here, compiled them (had some trouble figuring I had to build libogg first), then got the following files:
libogg.lib
libogg.dll
libvorbis.lib
libvorbis.dll
libvorbisfile.lib
libvorbisfile.dll
I dragged all of them in my project's Libraries folder, already added to the project, and included them in the Linker->Input (only the .lib).
Next I copied the headers to my project's Includes folder, also already added to the project, with the files:
ogg/ogg.h
ogg/os_types.h
vorbis/codec.h
vorbis/vorbisenc.h
vorbis/vorbisfile.h
Then I added some code, and I get the error "The program can't start because libvorbisfile.dll is missing from the computer."
And I'm pretty sure the file IS in the Library folder and properly defined in the properties.
Did I do something wrong along the way?
How can I figure what is wrong so I can fix it?
I already tried putting the .dll in the project's folder and in the Windows/System32 folder as well, didn't work.
The library folder is fine for your .lib files, but it's looking for the .dll at run time, which your project settings have no effect on. Windows looks in a few places for a .dll, but the easiest way to get your program to run is to put the .dlls in your working directory, which is where ever you run your executable from (probably the same directory as the .exe file).

How do I inform the debugger of the location of run-time linked DLL files?

I have a C++ program that uses the freeglut library (and hence requires the freeglut.dll at run-time. I have added the folder C:\Program Files\Common Files\freeglut\bin to my PATH environment variable.
To confirm that the location is correct, when I compile my program (debug build) and run the resulting .exe file, it works fine (the freeglut.dll file is not in the same directory as the executable).
However, when I run the program directly from the VS2012 debugger, I get this message:
The program can't start because freeglut.dll is missing from your computer. Try reinstalling the program to fix this problem.
I know that one solution is to place the freeglut.dll file in the directory of the executable. This is what I've been doing so far, but I would much rather simply inform VS2012 (or my program) of where to find the dll file. Note that this post also seems loosely related, but it doesn't seem to contain an answer relevant to what I am trying to achieve (I just want the debugger to look in the same place for DLLs as any other program!).
How do I achieve this in VS2012? Icing on the question cake would be an explanation as to why the debugger doesn't just look in the PATH variable like any other program...
You can also set project based Environment:
Open project Properties
Go to Configuration Properites -> Debugging
Enter the path in Environment, eg:
PATH=$(PATH);C:\Program Files\Common Files\freeglut\bin
Restart Visual Studio after modifying your PATH variable.
What I did actually worked. I just didn't restart VS...

freeglut.dll missing

I am reading the OpenGl superbible, and on the very first triangle program it will not run.
the program compiles just fine but when i run it, it gave me the error message freeglut.dll is missing from your computer. I downloaded that and put it in the correct directory, and it said that MSVCR71.dll was missing, so i downloaded that and put it in the correct directory and it began to say "The procedure entry point __glutCreateWindowWithExit could not be located in the dynamic link library freeglut.dll." does anyone know what i am doing wrong? i followed all the directions that the book told me.
You can't just grab random DLLs off the interwebtubes and dump them on your PC. There are versioning issues to consider that you're completely bypassing. It should have been a hint when the MSVC runtime dependency didn't link up.
Install the freeGLUT package properly, in its entirety.
I have had the same problem. Follow these steps:
Assuming that you have performed all steps given in the book.
Download the source code from companion siteā€¦I think the folder is SB5 and its 92 MB.
Then build the project named 'freeglut.vcproj'.
It will produce freeglut.dll apart from other files.Put freeglut.dll into c:\windows\syswow64 folder and all is done.
You could just include the dll wherever your executable is, if you are running this MSVC, then you could for example put the dll inside of your Debug folder. Cleaning the folder would remove everything except that dll so you wouldnt have to worry about constantly recopying it. Furthermore, if you want an alternative solution you could just put the dll inside of you Windows/System32 folder, or in the case of 64 bit architectures you could put it inside of the System/SysWow64 folder
The freeglut.dll should be placed in the VS project folder. The dll is part of the MSVC package - http://www.transmissionzero.co.uk/software/freeglut-devel/
Isn't there any options on the compiler where you can link the libraries? For example, if you use DevC++, you should go to Project -> Project Options -> Parameters, and set the Linkers.