开发者

How to reference/including external source files/libraries in C with Visual Studio?

Trying to create a C project tha开发者_开发百科t references this so that I could use it in my own application. Unfortunately I'm having a bit of trouble. I'm a C# programmer and in that language it is very simple. First you reference the library and then you use the using keyword.

However, considering I have never programmed in C before I'm having a bit of trouble with this simple task. I tried just copy and pasting all the source files in to my project directory where my main class was also stored but it still couldn't be found. I also tried including the compiled DLL but got the same error:

error C1083: Cannot open include file: 'mpir.h': No such file or directory

I'm reading the documentation for it and it says to only do this at the top of your source file:

#include <mpir.h>

Which is what I'm doing but it does not seem to be working.. Any suggestions?


If mpir.h is in the same directory as your source file, you need to use the include directive with quotations instead of brackets, like this:

#include "mpir.h"

Take a look at Wikipedia's description of including files.


I followed this tutorial to get it set up:

http://www.exploringbinary.com/how-to-install-and-run-gmp-on-windows-using-mpir/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜