工程是從VC6.0直接轉換過來的,在VC6.0下編譯沒有問題,在WIN7 + VS2012 + ADO下編譯出現下面的提示:
fatal error C1083: 無法打開型別庫檔案:“C:\Program Files\Common Files\System\ado\MSJRO.DLL”: No such file or directory
在使用ado的時候宣告和匯入了兩個庫檔案:
#import "C:\Program Files\Common Files\System\ado\msado15.dll" rename("EOF", "EndOfFile")
#import "C:\Program Files\Common Files\System\ado\MSJRO.DLL" no_namespace rename("ReplicaTypeEnum", "_ReplicaTypeEnum")
查看了目錄C:\Program Files\Common Files\System\ado,的確是沒有MSJRO.dll這個檔案,想著是不是win7下缺少這個檔案,然后直接在winxp下復制了一個這樣的檔案,但編譯之后出現關于msjro.tlh的錯誤警告:
------------------------------------------
1>d:\vc++\filetracer\debug\msjro.tlh(196): error C2146: 語法錯誤: 缺少“;”(在識別符號“ConflictTables”的前面)
1>d:\vc++\filetracer\debug\msjro.tlh(196): error C4430: 缺少型別說明符 - 假定為 int。注意: C++ 不支持默認 int
1>d:\vc++\filetracer\debug\msjro.tlh(224): error C2146: 語法錯誤: 缺少“;”(在識別符號“GetConflictTables”的前面)
1>d:\vc++\filetracer\debug\msjro.tlh(224): error C4430: 缺少型別說明符 - 假定為 int。注意: C++ 不支持默認 int
1>d:\vc++\filetracer\debug\msjro.tlh(224): warning C4183: “GetConflictTables”: 缺少回傳型別;假定為回傳“int”的成員函式
1>d:\vc++\filetracer\debug\msjro.tli(111): error C2143: 語法錯誤 : 缺少“;”(在“IReplica::GetConflictTables”的前面)
1>d:\vc++\filetracer\debug\msjro.tli(111): error C2433: “_RecordsetPtr”: 不允許在資料宣告中使用“inline”
1>d:\vc++\filetracer\debug\msjro.tli(111): error C4430: 缺少型別說明符 - 假定為 int。注意: C++ 不支持默認 int
1>d:\vc++\filetracer\debug\msjro.tli(115): error C2064: 項不會計算為接受 2 個引數的函式
------------------------------------------
請問大家在這樣的環境下是否也遇到過這樣的問題,是怎么解決的?請賜教!
uj5u.com熱心網友回復:
http://blog.csdn.net/sea_god/article/details/2721162msado15.dll"
uj5u.com熱心網友回復:
msado15.dll已經import,如果之參考該檔案會報錯。
你發的這個帖子鏈接沒有解決我的問題啊。
uj5u.com熱心網友回復:
uj5u.com熱心網友回復:
沒高人現身?人氣之地沒落了?
uj5u.com熱心網友回復:
C:\Program Files (x86)\Common Files\System\adouj5u.com熱心網友回復:
錯誤如下:MSJRO.tlh(100) : error C2146: syntax error : missing ';' before identifier 'ConflictTables'
MSJRO.tlh(100) : error C2501: '_RecordsetPtr' : missing storage-class or type specifiers
MSJRO.tlh(100) : error C2501: 'ConflictTables' : missing storage-class or type specifiers
MSJRO.tlh(128) : error C2146: syntax error : missing ';' before identifier 'GetConflictTables'
MSJRO.tlh(128) : error C2501: '_RecordsetPtr' : missing storage-class or type specifiers
MSJRO.tli(43) : error C2143: syntax error : missing ';' before 'tag::id'
MSJRO.tli(43) : error C2433: '_RecordsetPtr' : 'inline' not permitted on data declarations
MSJRO.tli(43) : error C2501: '_RecordsetPtr' : missing storage-class or type specifiers
MSJRO.tli(43) : fatal error C1004: unexpected end of file found
原來頭檔案相關代碼是這樣:
#pragma warning (disable: 4146)
// CG : In order to use this code against a different version of ADO, the appropriate
// ADO library needs to be used in the #import statement
#pragma message ("Make sure you go to Tools.Options.Directories.Library files and add the paths to msado15.dll and msjro.dll will usually be in C:\\Program Files\\Common Files\\System\\ado")
//#import "C:\Program Files\Common Files\System\ado\msado15.dll" rename("EOF", "EndOfFile")
//#import "C:\Program Files\Common Files\System\ado\MSJRO.DLL" no_namespace rename("ReplicaTypeEnum", "_ReplicaTypeEnum")
#import <msado15.dll> rename("EOF", "EndOfFile")
#import <MSJRO.DLL> no_namespace rename("ReplicaTypeEnum", "_ReplicaTypeEnum")
需要在路徑中設定C:\Program Files\Common Files\System\ado\
解決方案:
從XP SP3系統中拷貝msado15.dll,msjro.dll,放入資料庫頭檔案同目錄下,修改頭檔案:
#import "msado15.dll" rename("EOF", "EndOfFile")
#import "MSJRO.DLL" no_namespace rename("ReplicaTypeEnum", "_ReplicaTypeEnum")
uj5u.com熱心網友回復:
搜索"MSJRO.DLL" 我的在:C:\Program Files (x86)\Common Files\System\ado
uj5u.com熱心網友回復:
在stdafx.h中引入ADO如下編譯通過:#import <C:\Program Files\Common Files\System\ado\msado15.dll> no_namespace rename("EOF", "EndOfFile")
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/132529.html
標籤:基礎類
上一篇:雙按鍵不能跳轉到執行函式
