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

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

Related

How to fix "libopenblas.dll was not found" system error on visual studio 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!

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

Linking Assimp 3.1.1 in Visual Studio 2015

I am linking to assimp as i´ve always done with other middleware, but when i run my application, i get a runtime error: "Application could not launch correctly (0xc000007b)."
What am i missing? I downloaded the assimp 3.1.1 binary and got
an include/assimp folder, containing header files and a "Compiler" folder containing more headers
"lib32" and "lib64" folders, each containing an "assimp.lib"
"bin32" and "bin64" folders, containing an "assimp.dll" and an "assimp.exe"
...along with other folders and files, like samples and cmake stuff.
I put the "include/assimp" folder into my projects include folder, the assimp.lib i put in my lib/x86 folder and the assimp.dll and .exe next to my application .exe.
In my startup-project´s properties i am linking to the include and library paths and i am including assimp.lib in my additional dependencies.
The problem was that the assimp.dll and assimp.exe had to go into my solution folder. appearently somewhere this is defined as the place to read .dll or .exe from.. even though thats strange because my glew.dll and sdl2.dll need to be inside the same directory as my application.. Probably the assimp.exe assumes the .dll is in the directory above it

How do I link a library? (MySQL Library)

Alright, I am trying to Link this into my program and I never linked anything before so I need help with not only linking it (Because I have the directory in the linker -> additional directories but I need to link against the libmysql.lib/dll. I am not sure how to do that.
If you could give me a basic understanding that would be great! Just don't make it too complex ;)
I am trying to follow the steps on the website and it says to do this: (I have looked up and people said something about a MakeFile and I honestly don't know anything how that works)
The Connector/C++ static library file is mysqlcppconn-static.lib. You link this library statically with your application. Also link against the files libmysql.dll and libmysql.lib. At runtime, the application will require access to libmysql.dll.
Here's what you need to do to install an library to your c++ project.
Add it to additional depencies in the linker.
Project->Properties->Linker->Input
Click the dropdown, click edit. On the list on the top, add just the names for every .lib file included in the library. For example, If installing SDL, one would add:
SDL2.lib
SDL2main.lib
These files can probably be found under the lib folder of the library you downloaded (look around a bit).
Tell VS where the header files are.
Project->Properties->VC++ Directories->Include Directories
Click the dropdown, click edit. add the location of all of the header files of the library. You can put them wherever you want, but it is suggested you put them in their own folder in your project folder somewhere. Wherever you put them, put the directory here; the containing folder, not the files themselves.
Tell VS where the lib files are.
Project->Properties->VC++Directories->Library Directories
Click the dropdown, edit. Same thing as step 2, but you instead are putting the location of all the .lib files. Yep, the same ones you defined in step 1.
Provide the .dll files to your executable.
When the executable runs, it needs .dll in the same directory or it will not run (CORRECTION = It will run, but will give you an error upon open). So find your executable and put any .dll files in the same directory. How to find where it is by default:
Solution Explorer->Right Click Solution->Open in explorer->Debug
You should see the .exe there. Put the libraries dll files in that same directory.
If you have any questions please ask.

dll is missing when running executable (libcurl)

I believe I have followed every instructions given, so I just have to ask the same question again.
I am trying to use libcurl.
I have changed the following settings in my project:
Configuation Properties|VC++ Directories|Library Directories - here I have put the folder where the .lib file is found. I did this for Debug, Release and All Configurations.
Configuation Properties|VC++ Directories|Include Directories - here I have put the folder where the .h files are found. I did this for Debug, Release and All Configurations.
Configuration Properties|Linker|Input|Additional Dependencies - I have added the .lib file. I did this for Release, Debug and All Configurations.
Configuration Properties|Linker|General|Additional Library Directories- I have added the folder where the .lib file is located. I did this for Release, Debug and All Configurations.
The program builds well without any errors.
When running the .exe file, I get the error message:
.dll is missing from your computer.
I have put the .lib file in the same folder as the .exe file, but that does not help. In fact I have put the .lib file in all folders for my project, but the computer can't find them anyway.
How can this be explained?
Is it possible to build the program without errors if the .lib file is simply wrong? I use a win32 .lib file and I create a Win32 project, but I'm running on a Win64 PC. Does that matter?
Desperate for help. Been searching like crazy for three days now.
Bests,
You have to put the "libcurl.dll" in the same folder as your executable (DEBUG or RELEASE). In case of debugging, the dll is expected in your Project folder because Visual Studio is setting that directory. The ".lib" file is only necessary on compile time, which is already successful in your case.
The DLL comes with the cURL Projekt or is build when building the lib. Usually you will find the DLL near the directory of the lib. Search for a "bin" folder.
If you use the 32 bit version, make sure that you use the 32 Version of the DLL. The DLL has to match with the EXE, not with the OS.