Reputation: 598
Hi stack overflow users.
Error description:
For a mini project I have decided to use the portaudio library (I use Windows 7 64-bit and C++): http://portaudio.com/
Before even using the library I had to build a .DLL file in another Visual Studio Project and then link the output to my own visual studio 2010 project (32-bit). I tried to use this simple piece of code:
#include <iostream>
#include <portaudio.h>
using namespace std;
void main()
{
cout << "Hello World!" << endl; cout << "Welcome to C++ Programming" << endl; }
I get this error message: fatal error C1083: Cannot open include file: 'portaudio.h': No such file or directory
I personally don't think it is the creation of the .DLL that is the issue but more a linking issue.
My attempt:
First of all I have attempted to follow this guide: http://portaudio.com/docs/v19-doxydocs/compile_windows.html
By following this guide, I got a compiled .DLL and .Lib files inside the release folder(Image 1):
Afterwards I try to link my visual studio 2010 with portaudio_x86.lib and include the directory where it is located (The output folder of the .DLL creation)(Image 2 and 3)
I myself have very poor experience with using external libraries and even less experience when compiling them yourself. I have only a little experience with previous programming, so I am pretty sure it is just me missing something vital.
Upvotes: 0
Views: 4479
Reputation: 1024
The compiler fails to find the portaudio.h
header file. As per the last screenshot, in Additional Include Directories, you need to point to the directory where the <portaudio.h>
file is, not where the binaries (.lib
, .dll
) are. The path to the .lib
file needs to either be specified explicitly (as in the next to the last screenshot, not just portaudio.lib
but the full path) or set in the VC++ Directories property page, which is also the preferred place to set your include directories.
Upvotes: 2