VS 10包括,我有一个链接器错误

时间:2010-12-13 17:08:20

标签: visual-c++ visual-c++-2010

我正在使用Visual Studio 10在C ++中编程

我的课程的第一部分是 //包括

//#include <LEDA\numbers>               //fatal error C1083: Cannot open include file: 'LEDA\numbers': No such file or directory

#include <LEDA/numbers/real.h>      
//Why do I get a linker error here
//All.obj : error LNK2001: unresolved external symbol "class leda::memory_manager leda::std_memory_mgr" (?std_memory_mgr@leda@@3Vmemory_manager@1@A)
#include <LEDA\numbers\integer.h>       //Here I used the system to write most of it for me
#include <LEDA/numbers/integer.h>            //Include LEDA. So 2 things 
        //1. including the same file twice does not matter
        //2. forward slashes and backward slashes are the same
      //I tried to use a wild card and said   #include <LEDA/numbers/*>  
      //But that did not work

 #include <LEDA/numbers/rational.h>
 #include <LEDA/core/string.h>
 #include <LEDA/core/array.h>
 #include <LEDA/numbers/bigfloat.h>  

      //The sqrt does not work


 #include <iostream>                          //include ordinary C++
 #include <math.h>

我有LINKER错误

我已尝试通过指定LIB用户环境符号

来指定要使用的库

我已经尝试通过指定来指定要使用的库  包括目录和  图书馆目录

在我的项目属性中

我在某个地方犯了一个错误,但它在哪里

2 个答案:

答案 0 :(得分:0)

这个程序有几个错误:

  1. LEDA \ number显然是一个目录,而不是一个包含文件。所以你不应该试着加入它。
  2. (概念)#include语句根本无法解决链接器错误。相反,您需要指定要与链接器链接的库;库是以.lib结尾的文件。转到项目设置,然后添加包含缺少符号的库。

答案 1 :(得分:0)

#include <abcd.h> // looks for the include abcd.h in the INCLUDES path.

#include "abcd.h" // looks for the include abcd.h in the current path and then INCLUDES path.

根据您的描述,它看起来就像您当前目录下的LEDA lib。尝试使用“”而不是&lt;&gt;并查看它是否修复了您的错误。