|
藍森林 http://www.lslnet.com 2006年6月6日 10:18
你們在window下用過snmp++嗎?能告訴我怎麼設置環境嗎?
本來以前在unix下做的時候,編譯的時候指定
2個靜態庫就可以了,可現在要在windows下做,
也不知怎麼設置vc的環境,包含的頭文件說是有
錯誤,看的人莫名其妙。誰能告訴我需要什麼
頭文件和庫文件,怎麼設置?還有pro*c纏和
在一起,更麻煩。 |
你們在window下用過snmp++嗎?能告訴我怎麼設置環境嗎?
????
一樣的吧
把錯誤信息寫出來
或是自己照錯誤提示修改 |
你們在window下用過snmp++嗎?能告訴我怎麼設置環境嗎?
-->
現在有一部分問題解決了,可還有一個問題,編譯時的錯誤信息如下:
Compiling...
insert.c
D:\testprom\insert.c(140) : fatal error C1083: Cannot open include file: 'sys/time.h': No such file or directory
Error executing cl.exe.
insert.obj - 1 error(s), 0 warning(s)
<sys/time.h>;是在unix下才有的嗎?windows下怎麼沒有這麼頭文件呢?
sys目錄下有utime.h,timeb.h這兩個頭文件。但沒有time.h這個頭文件,怎麼
辦呢? |
你們在window下用過snmp++嗎?能告訴我怎麼設置環境嗎?
wndows下的頭文件與unix下不一樣
標準C只是定義了函數
沒有說明某個文件一定要在某個目錄下
因為time屬於系統調用
你可以把這行注外掉
看到報哪個函數不存在後再include對應頭文件 |
你們在window下用過snmp++嗎?能告訴我怎麼設置環境嗎?
-->
我註釋掉後,出來93個錯誤,都是些不明所以的錯誤,
說什麼要加分號了,少了一個大括號等等,
不註釋的話就這一個錯誤。真不知該怎麼辦。
我查了<sys/time.h>;只有unix的操作系統才有,
windows下的沒有的,不是ANSI C的標準庫。 |
你們在window下用過snmp++嗎?能告訴我怎麼設置環境嗎?
一個一個改
從第一個開始
如果說某函數沒有定義
那麼查找它是哪個頭文件中定義的
然後include這個頭文件 |
你們在window下用過snmp++嗎?能告訴我怎麼設置環境嗎?
我讓你看看compailing的錯誤分析吧。很長,你大致看一看就可以了。
如果把<sys/time.h>;註釋掉,錯誤如下:
--------------------Configuration: insert - Win32 Debug--------------------
Compiling...
insert.c
e:\program files\vc98\include\notifyqueue.h(61) : error C2059: syntax error : 'string'
e:\program files\vc98\include\snmp_pp.h(56) : error C2059: syntax error : 'string'
e:\program files\vc98\include\oid.h(54) : error C2059: syntax error : 'string'
e:\program files\vc98\include\smival.h(86) : error C2054: expected '(' to follow 'class'
e:\program files\vc98\include\smival.h(86) : error C2085: 'SnmpSyntax' : not in formal parameter list
e:\program files\vc98\include\smival.h(86) : error C2143: syntax error : missing ';' before '{'
e:\program files\vc98\include\collect.h(323) : error C2143: syntax error : missing '{' before '<'
e:\program files\vc98\include\collect.h(323) : error C2059: syntax error : '<'
e:\program files\vc98\include\oid.h(66) : error C2054: expected '(' to follow 'class'
e:\program files\vc98\include\oid.h(66) : error C2085: 'Oid' : not in formal parameter list
e:\program files\vc98\include\oid.h(66) : error C2143: syntax error : missing ';' before ':'
e:\program files\vc98\include\oid.h(222) : error C2143: syntax error : missing '{' before '<'
e:\program files\vc98\include\oid.h(222) : error C2059: syntax error : '<'
e:\program files\vc98\include\vb.h(56) : error C2059: syntax error : 'string'
e:\program files\vc98\include\integer.h(60) : error C2054: expected '(' to follow 'class'
e:\program files\vc98\include\integer.h(60) : error C2085: 'SnmpUInt32' : not in formal parameter list
e:\program files\vc98\include\integer.h(60) : error C2143: syntax error : missing ';' before ':'
e:\program files\vc98\include\integer.h(107) : error C2054: expected '(' to follow 'class'
e:\program files\vc98\include\integer.h(107) : error C2085: 'SnmpInt32' : not in formal parameter list
e:\program files\vc98\include\integer.h(107) : error C2143: syntax error : missing ';' before ':'
e:\program files\vc98\include\timetick.h(58) : error C2054: expected '(' to follow 'class'
e:\program files\vc98\include\timetick.h(58) : error C2085: 'TimeTicks' : not in formal parameter list
e:\program files\vc98\include\timetick.h(58) : error C2143: syntax error : missing ';' before ':'
e:\program files\vc98\include\counter.h(56) : error C2054: expected '(' to follow 'class'
e:\program files\vc98\include\counter.h(56) : error C2085: 'Counter32' : not in formal parameter list
e:\program files\vc98\include\counter.h(56) : error C2143: syntax error : missing ';' before ':'
e:\program files\vc98\include\gauge.h(59) : error C2054: expected '(' to follow 'class'
e:\program files\vc98\include\gauge.h(59) : error C2085: 'Gauge32' : not in formal parameter list
e:\program files\vc98\include\gauge.h(59) : error C2143: syntax error : missing ';' before ':'
e:\program files\vc98\include\ctr64.h(58) : error C2054: expected '(' to follow 'class'
e:\program files\vc98\include\ctr64.h(58) : error C2085: 'Counter64' : not in formal parameter list
e:\program files\vc98\include\ctr64.h(58) : error C2143: syntax error : missing ';' before ':'
e:\program files\vc98\include\octet.h(57) : error C2059: syntax error : 'string'
e:\program files\vc98\include\octet.h(68) : error C2054: expected '(' to follow 'class'
e:\program files\vc98\include\octet.h(68) : error C2085: 'OctetStr' : not in formal parameter list
e:\program files\vc98\include\octet.h(68) : error C2143: syntax error : missing ';' before ':'
e:\program files\vc98\include\address.h(51) : error C2059: syntax error : 'string'
e:\program files\vc98\include\address.h(107) : error C2061: syntax error : identifier 'GenAddress'
e:\program files\vc98\include\address.h(107) : error C2059: syntax error : ';'
e:\program files\vc98\include\address.h(108) : error C2061: syntax error : identifier 'UdpAddress'
e:\program files\vc98\include\address.h(108) : error C2059: syntax error : ';'
e:\program files\vc98\include\address.h(109) : error C2061: syntax error : identifier 'IpxSockAddress'
e:\program files\vc98\include\address.h(109) : error C2059: syntax error : ';'
e:\program files\vc98\include\address.h(114) : error C2054: expected '(' to follow 'class'
e:\program files\vc98\include\address.h(114) : error C2085: 'Address' : not in formal parameter list
e:\program files\vc98\include\address.h(114) : error C2143: syntax error : missing ';' before ':'
e:\program files\vc98\include\address.h(205) : error C2054: expected '(' to follow 'class'
e:\program files\vc98\include\address.h(205) : error C2085: 'IpAddress' : not in formal parameter list
e:\program files\vc98\include\address.h(205) : error C2143: syntax error : missing ';' before ':'
e:\program files\vc98\include\address.h(279) : error C2054: expected '(' to follow 'class'
e:\program files\vc98\include\address.h(279) : error C2085: 'UdpAddress' : not in formal parameter list
e:\program files\vc98\include\address.h(279) : error C2143: syntax error : missing ';' before ':'
e:\program files\vc98\include\address.h(343) : error C2054: expected '(' to follow 'class'
e:\program files\vc98\include\address.h(343) : error C2085: 'MacAddress' : not in formal parameter list
e:\program files\vc98\include\address.h(343) : error C2143: syntax error : missing ';' before ':'
e:\program files\vc98\include\address.h(398) : error C2054: expected '(' to follow 'class'
e:\program files\vc98\include\address.h(398) : error C2085: 'IpxAddress' : not in formal parameter list
e:\program files\vc98\include\address.h(398) : error C2143: syntax error : missing ';' before ':'
e:\program files\vc98\include\address.h(458) : error C2054: expected '(' to follow 'class'
e:\program files\vc98\include\address.h(458) : error C2085: 'IpxSockAddress' : not in formal parameter list
e:\program files\vc98\include\address.h(458) : error C2143: syntax error : missing ';' before ':'
e:\program files\vc98\include\address.h(524) : error C2054: expected '(' to follow 'class'
e:\program files\vc98\include\address.h(524) : error C2085: 'GenAddress' : not in formal parameter list
e:\program files\vc98\include\address.h(524) : error C2143: syntax error : missing ';' before ':'
e:\program files\vc98\include\address.h(576) : error C2143: syntax error : missing '{' before '<'
e:\program files\vc98\include\address.h(576) : error C2059: syntax error : '<'
e:\program files\vc98\include\vb.h(81) : error C2054: expected '(' to follow 'class'
e:\program files\vc98\include\vb.h(81) : error C2085: 'Vb' : not in formal parameter list
e:\program files\vc98\include\vb.h(81) : error C2143: syntax error : missing ';' before '{'
e:\program files\vc98\include\target.h(56) : error C2059: syntax error : 'string'
e:\program files\vc98\include\target.h(70) : error C2054: expected '(' to follow 'class'
e:\program files\vc98\include\target.h(70) : error C2085: 'SnmpTarget' : not in formal parameter list
e:\program files\vc98\include\target.h(70) : error C2143: syntax error : missing ';' before '{'
e:\program files\vc98\include\target.h(131) : error C2054: expected '(' to follow 'class'
e:\program files\vc98\include\target.h(131) : error C2085: 'CTarget' : not in formal parameter list
e:\program files\vc98\include\target.h(131) : error C2143: syntax error : missing ';' before ':'
e:\program files\vc98\include\target.h(224) : error C2143: syntax error : missing '{' before '<'
e:\program files\vc98\include\target.h(224) : error C2059: syntax error : '<'
e:\program files\vc98\include\pdu.h(58) : error C2054: expected '(' to follow 'class'
e:\program files\vc98\include\pdu.h(58) : error C2085: 'Pdu' : not in formal parameter list
e:\program files\vc98\include\pdu.h(58) : error C2143: syntax error : missing ';' before '{'
e:\program files\vc98\include\snmp_pp.h(92) : error C2061: syntax error : identifier 'Snmp'
e:\program files\vc98\include\snmp_pp.h(92) : error C2059: syntax error : ';'
e:\program files\vc98\include\snmp_pp.h(98) : error C2143: syntax error : missing ')' before '*'
e:\program files\vc98\include\snmp_pp.h(98) : error C2081: 'Snmp' : name in formal parameter list illegal
e:\program files\vc98\include\snmp_pp.h(98) : error C2143: syntax error : missing '{' before '*'
e:\program files\vc98\include\snmp_pp.h(98) : error C2059: syntax error : ','
e:\program files\vc98\include\snmp_pp.h(101) : error C2059: syntax error : ')'
e:\program files\vc98\include\snmp_pp.h(106) : error C2054: expected '(' to follow 'class'
e:\program files\vc98\include\snmp_pp.h(106) : error C2085: 'Snmp' : not in formal parameter list
e:\program files\vc98\include\snmp_pp.h(106) : error C2143: syntax error : missing ';' before '{'
e:\program files\vc98\include\msec.h(21) : error C2059: syntax error : 'string'
e:\program files\vc98\include\msec.h(28) : fatal error C1083: Cannot open include file: 'sys/time.h': No such file or directory
Error executing cl.exe.
insert.obj - 93 error(s), 0 warning(s)
如果不註釋掉,如下:
Compiling...
insert.c
D:\testprom\insert.c(140) : fatal error C1083: Cannot open include file: 'sys/time.h': No such file or directory
Error executing cl.exe.
insert.obj - 1 error(s), 0 warning(s)
幫我分析分析吧,鬱悶死了,也不知該怎麼辦!謝謝了! |
你們在window下用過snmp++嗎?能告訴我怎麼設置環境嗎?
在windows下面怎麼會有<sys/time.h>;
你試試這樣:
#include <time.h>;
#include <string.h>; |
你們在window下用過snmp++嗎?能告訴我怎麼設置環境嗎?
-->
這樣不行的,因為別的頭文件裡面包含了<sys/time.h>;。
把包含它的行註釋掉,就出了前面那些莫名其妙的錯誤。 |
你們在window下用過snmp++嗎?能告訴我怎麼設置環境嗎?
'string'
#include <string>;
using namespace std; |
你們在window下用過snmp++嗎?能告訴我怎麼設置環境嗎?
還是相同的錯誤呀,這樣吧,我把源代碼貼出來。
幫我分析分析。[code]#include <stdio.h>;
#include <stdlib.h>;
#include <string.h>;
#include <sys/time.h>;
#include <notifyqueue.h>;
#include <snmp_pp.h>;
#include <collect.h>;
'string'
#include <string>;
using namespace std;
#define sysdescr "1.3.6.1.2.1.1.1.0"
#define sysobjectid "1.3.6.1.2.1.1.1.0"
#define sysuptime "1.3.6.1.2.1.1.1.0"
#define syscontact "1.3.6.1.2.1.1.1.0"
#define sysname "1.3.6.1.2.1.1.1.0"
#define syslocation "1.3.6.1.2.1.1.1.0"
#define sysservices "1.3.6.1.2.1.1.1.0"
EXEC SQL BEGIN DECLARE SECTION;
VARCHAR username[20];
VARCHAR password[20];
EXEC SQL END DECLARE SECTION;
EXEC SQL INCLUDE sqlca;
void sqlerror();
void main()
{
EXEC SQL BEGIN DECLARE SECTION;
char SYSDESCR[20];
char SYSOBJECTID[20];
long SYSUPTIME;
char SYSCONTACT[20];
char SYSNAME[20];
char SYSLOCATION[20];
int SYSSERVICES;
EXEC SQL END DECLARE SECTION;
int status;
CTarget ctarget((IpAddress)"192.168.0.100");
Vb vb[7];
Pdu pdu;
Snmp snmp(status);
if (status != SNMP_CLASS_SUCCESS){
printf("%s\n",snmp.error_msg(status));
return;
}
vb[0].set_oid(sysdescr);
vb[1].set_oid(sysobjectid);
vb[2].set_oid(sysuptime);
vb[3].set_oid(syscontact);
vb[4].set_oid(sysname);
vb[5].set_oid(syslocation);
vb[6].set_oid(sysservices);
for(int i = 0;i < 7;i++)
pdu += vb[i];
if ( (stastus = snmp.get(pdu,ctarget)) != SNMP_CLASS_SUCCESS)
printf("%s\n",snmp.error_msg(status));
else {
pdu.get_vbs(vb,7);
strcpy(SYSDESCR,vb[0].get_printable_value());
printf("%s\n",vb[0].get_printable_value());
strcpy(SYSOBJECTID,vb[1].get_printable_value());
printf("SYSOBJECTID:%s\n",vb[1].get_printable_value());
SYSUPTIME = vb[2].get_printable_value();
printf("SYSUPTIME:%d\n",vb[2].get_printable_value());
strcpy(SYSCONTACT,vb[3].get_printable_value());
printf("SYSCONTACT:%s\n",vb[3].get_printable_value());
strcpy(SYSNAME,vb[4].get_printable_value());
printf("SYSNAME:%s\n",vb[4].get_printable_value());
strcpy(SYSLOCATION,vb[5].get_printable_value());
printf("SYSLOCATION:%s\n",vb[5].get_printable_value());
SYSSERVICES = vb[6].get_printable_value();
printf("SYSSERVICES:%d\n",vb[6].get_printable_value());
}
strcpy((char *)username.arr,"LSF");
username.len = (short)strlen(username.arr);
strcpy((char *)password.arr,"LSF");
password.len = (short)strlen(password.arr);
EXEC SQL WHENEVER SQLERROR DO sqlerror();
EXEC SQL CONNECT :username IDENTIFIED BY :password;
printf("\nConnected to ORACLE as user:%s\n",username.arr);
EXEC SQL INSERT INTO LSF(SYSDESCR,SYSOBJECTID,SYSUPTIME,SYSCONTACT,SYSNAME,SYSLOCATION,SYSSERVICES)
VALUES(:SYSDESCR,:SYSOBJECTID,:SYSUPTIME,:SYSCONTACT,:SYSNAME,:SYSLOCATION,:SYSSERVICES);
EXEC SQL COMMIT WORK;
printf("A record was added!\n");
}
void sqlerror(){
EXEC SQL WHENEVER SQLERROR CONTINUE;
printf("ORACLE error detected:\n");
printf("%.70s\n",sqlca.sqlerrm.sqlerrmc);
EXEC SQL ROLLBACK RELEASE;
exit(-1);
}[/code] |
你們在window下用過snmp++嗎?能告訴我怎麼設置環境嗎?
#include <stdlib.h>;
#include <string.h>;
#include <sys/time.h>;
#include <notifyqueue.h>;
#include <snmp_pp.h>;
#include <collect.h>;
'string' ??????????????????????????????????
#include <string>; |
你們在window下用過snmp++嗎?能告訴我怎麼設置環境嗎?
那個不是你寫的嘛?
當時我也不明白,可能是我理解錯了。 |
你們在window下用過snmp++嗎?能告訴我怎麼設置環境嗎?
把那去掉
這只是c語言標準
那樣寫不合標準當然會報錯 |
你們在window下用過snmp++嗎?能告訴我怎麼設置環境嗎?
-->
我當時沒把它去掉,也沒有報這個地方的錯,很奇怪的說。:)
這樣吧,我貼個簡單的程序,程序絕對沒問題,就是配置有
問題,你幫我看看。謝謝。[code]#include <stdio.h>;
#include <snmp_pp.h>;
#define SYSDESCR "1.3.6.1.2.1.1.1.0"
void main()
{
int status;
CTarget ctarget((IpAddress)"192.168.0.100");
Vb vb(SYSDESCR);
Pdu pdu;
Snmp snmp(status);
if (status != SNMP_CLASS_SUCCESS){
printf("%s\n",snmp.error_msg(status));
return;
}
pdu += vb;
if ((status = snmp.get(pdu,ctarget)) != SNMP_CLASS_SUCCESS)
printf("%s\n",snmp.error_msg(status));
else {
pdu.get_vb(vb,0);
printf("System Descriptor = %s\n",vb.get_printable_value());
}
}
[/code]
編譯沒錯誤,link錯誤如下:
--------------------Configuration: 11 - Win32 Debug--------------------
Linking...
Creating library Debug/11.lib and object Debug/11.exp
snmp.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall SnmpUInt32::~SnmpUInt32(void)" (??1SnmpUInt32@@UAE@XZ)
snmp.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall Address::valid(void)const " (?valid@Address@@UBEHXZ)
snmp.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall Address::~Address(void)" (??1Address@@UAE@XZ)
snmp.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall SnmpTarget::~SnmpTarget(void)" (??1SnmpTarget@@UAE@XZ)
snmp.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall Snmp::get_notify_filter(class SnmpCollection<class Oid>; &,class SnmpCollection<class CTarget>; &)" (?get_notify_filter@Snmp@@UAEHAAV?$SnmpCollection@VOid@@@@AAV?$Snm
pCollection@VCTarget@@@@@Z)
snmp.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall Snmp::notify_unregister(void)" (?notify_unregister@Snmp@@UAEHXZ)
snmp.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall Snmp::notify_register(class SnmpCollection<class Oid>; const &,class SnmpCollection<class CTarget>; const &,void (__cdecl*const)(int,class Snmp *,class Pdu &,class Sn
mpTarget &,void *),void const *)" (?notify_register@Snmp@@UAEHABV?$SnmpCollection@VOid@@@@ABV?$SnmpCollection@VCTarget@@@@Q6AXHPAV1@AAVPdu@@AAVSnmpTarget@@PAX@ZPBX@Z)
snmp.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall Snmp::notify_register(class SnmpCollection<class Oid>; const &,class SnmpCollection<class CTarget>; const &,class SnmpCollection<class GenAddress>; const &,void (__cde
cl*const)(int,class Snmp *,class Pdu &,class SnmpTarget &,void *),void const *)" (?notify_register@Snmp@@UAEHABV?$SnmpCollection@VOid@@@@ABV?$SnmpCollection@VCTarget@@@@ABV?$SnmpCollection@VGenAddress@@@@Q6AXHPAV1@AAVPdu@@AAVSnmpTarget@@PAX@ZPBX@Z)
snmp.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall Snmp::inform(class Pdu &,class SnmpTarget &)" (?inform@Snmp@@UAEHAAVPdu@@AAVSnmpTarget@@@Z)
snmp.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall Snmp::inform(class Pdu &,class SnmpTarget &,void (__cdecl*const)(int,class Snmp *,class Pdu &,class SnmpTarget &,void *),void const *)" (?inform@Snmp@@UAEHAAVPdu@@A
AVSnmpTarget@@Q6AXHPAV1@01PAX@ZPBX@Z)
snmp.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall Snmp::trap(class Pdu &,class SnmpTarget &)" (?trap@Snmp@@UAEHAAVPdu@@AAVSnmpTarget@@@Z)
snmp.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall Snmp::get_bulk(class Pdu &,class SnmpTarget &,int,int)" (?get_bulk@Snmp@@UAEHAAVPdu@@AAVSnmpTarget@@HH@Z)
snmp.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall Snmp::get_bulk(class Pdu &,class SnmpTarget &,int,int,void (__cdecl*const)(int,class Snmp *,class Pdu &,class SnmpTarget &,void *),void const *)" (?get_bulk@Snmp@@U
AEHAAVPdu@@AAVSnmpTarget@@HHQ6AXHPAV1@01PAX@ZPBX@Z)
snmp.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall Snmp::set(class Pdu &,class SnmpTarget &)" (?set@Snmp@@UAEHAAVPdu@@AAVSnmpTarget@@@Z)
snmp.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall Snmp::set(class Pdu &,class SnmpTarget &,void (__cdecl*const)(int,class Snmp *,class Pdu &,class SnmpTarget &,void *),void const *)" (?set@Snmp@@UAEHAAVPdu@@AAVSnmp
Target@@Q6AXHPAV1@01PAX@ZPBX@Z)
snmp.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall Snmp::get_next(class Pdu &,class SnmpTarget &)" (?get_next@Snmp@@UAEHAAVPdu@@AAVSnmpTarget@@@Z)
snmp.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall Snmp::get_next(class Pdu &,class SnmpTarget &,void (__cdecl*const)(int,class Snmp *,class Pdu &,class SnmpTarget &,void *),void const *)" (?get_next@Snmp@@UAEHAAVPd
u@@AAVSnmpTarget@@Q6AXHPAV1@01PAX@ZPBX@Z)
snmp.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall Snmp::get(class Pdu &,class SnmpTarget &)" (?get@Snmp@@UAEHAAVPdu@@AAVSnmpTarget@@@Z)
snmp.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall Snmp::get(class Pdu &,class SnmpTarget &,void (__cdecl*const)(int,class Snmp *,class Pdu &,class SnmpTarget &,void *),void const *)" (?get@Snmp@@UAEHAAVPdu@@AAVSnmp
Target@@Q6AXHPAV1@01PAX@ZPBX@Z)
snmp.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall Snmp::cancel(unsigned long)" (?cancel@Snmp@@UAEHK@Z)
snmp.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall Snmp::~Snmp(void)" (??1Snmp@@UAE@XZ)
snmp.obj : error LNK2001: unresolved external symbol "public: char * __thiscall Vb::get_printable_value(void)" (?get_printable_value@Vb@@QAEPADXZ)
snmp.obj : error LNK2001: unresolved external symbol "public: int __thiscall Pdu::get_vb(class Vb &,int)const " (?get_vb@Pdu@@QBEHAAVVb@@H@Z)
snmp.obj : error LNK2001: unresolved external symbol "public: class Pdu & __thiscall Pdu::operator+=(class Vb &)" (??YPdu@@QAEAAV0@AAVVb@@@Z)
snmp.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall CTarget::~CTarget(void)" (??1CTarget@@UAE@XZ)
snmp.obj : error LNK2001: unresolved external symbol "public: __thiscall Vb::~Vb(void)" (??1Vb@@QAE@XZ)
snmp.obj : error LNK2001: unresolved external symbol "public: __thiscall Pdu::~Pdu(void)" (??1Pdu@@QAE@XZ)
snmp.obj : error LNK2001: unresolved external symbol "public: char * __thiscall Snmp::error_msg(int)" (?error_msg@Snmp@@QAEPADH@Z)
snmp.obj : error LNK2001: unresolved external symbol "public: __thiscall Snmp::Snmp(int &,unsigned short)" (??0Snmp@@QAE@AAHG@Z)
snmp.obj : error LNK2001: unresolved external symbol "public: __thiscall Pdu::Pdu(void)" (??0Pdu@@QAE@XZ)
snmp.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall Oid::~Oid(void)" (??1Oid@@UAE@XZ)
snmp.obj : error LNK2001: unresolved external symbol "public: __thiscall Vb::Vb(class Oid const &)" (??0Vb@@QAE@ABVOid@@@Z)
snmp.obj : error LNK2001: unresolved external symbol "public: __thiscall Oid::Oid(char const *)" (??0Oid@@QAE@PBD@Z)
snmp.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall IpAddress::~IpAddress(void)" (??1IpAddress@@UAE@XZ)
snmp.obj : error LNK2001: unresolved external symbol "public: __thiscall CTarget::CTarget(class Address const &)" (??0CTarget@@QAE@ABVAddress@@@Z)
snmp.obj : error LNK2001: unresolved external symbol "public: __thiscall IpAddress::IpAddress(char const *)" (??0IpAddress@@QAE@PBD@Z)
Debug/11.exe : fatal error LNK1120: 36 unresolved externals
Error executing link.exe.
11.exe - 37 error(s), 0 warning(s) |
你們在window下用過snmp++嗎?能告訴我怎麼設置環境嗎?
snmp.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall SnmpUInt32::~SnmpUInt32(void)" (??1SnmpUInt32@@UAE@XZ)
SnmpUInt32::~SnmpUInt32這個在哪個文件內定義
如果是在文件內定義的話
要連它的obj文件
如果在庫內實現的話要連對應庫 |
你們在window下用過snmp++嗎?能告訴我怎麼設置環境嗎?
可是我找不到它的庫,就找到一個庫,
可不行。 |
你們在window下用過snmp++嗎?能告訴我怎麼設置環境嗎?
這在開發文檔中應該有吧
不然你什麼知道使用這個庫呢
有它的頭文件
那麼也會有它的README和對應的庫 |
你們在window下用過snmp++嗎?能告訴我怎麼設置環境嗎?
-->
你能告訴我如果一個程序編譯時需要一個.dll的文件,
在vc環境裡怎麼設置它呢? |
你們在window下用過snmp++嗎?能告訴我怎麼設置環境嗎?
.dll都會有對應的同名.lib
用於編譯時引導編譯
把那個.lib添加到工程裡面的link選項就可以了 |
| |