2014-03-31 76 views
0

我想使用這個庫連接到SQLite數據庫,但我甚至沒有把它與我的簡單源代碼一起編譯,我得到了許多編譯錯誤,編譯器編譯失敗,所以我不知道,如果有人可以幫助我展示我如何配置和編譯在Windows這個項目....使用ado-ada連接數據庫

ADO-ADA項目鏈接:https://code.google.com/p/ada-ado/

順便說一句,有另一種好辦法連接到MSSQL或SQLite或MySql數據庫?

C:\Users\AlexB\Desktop\testeSqlIte>gnatmake -P default.gpr 
gcc -c -g -O2 -I- -gnatA C:\Users\AlexB\Desktop\ada-ado-0.4.0\src\ado-queries-lo 
aders.adb 
ado-queries-loaders.adb:25:06: "ADO.STATEMENTS (spec)" depends on "ADO.SCHEMAS (
spec)" 
ado-queries-loaders.adb:25:06: "ADO.SCHEMAS (spec)" depends on "UTIL (spec)" 
ado-queries-loaders.adb:25:06: "ADO.OBJECTS (spec)" depends on "UTIL (spec)" 
ado-queries-loaders.adb:25:06: "ADO.DRIVERS.CONNECTIONS (spec)" depends on "ADO. 
STATEMENTS (spec)" 
ado-queries-loaders.adb:25:06: "ADO.STATEMENTS (spec)" depends on "ADO.OBJECTS (
spec)" 
ado-queries-loaders.adb:25:06: "ADO.OBJECTS (spec)" depends on "ADO.SESSIONS (sp 
ec)" 
ado-queries-loaders.adb:25:06: "ADO.SESSIONS (spec)" depends on "UTIL (spec)" 
ado-queries-loaders.adb:25:06: file "util.ads" not found 
ado-queries-loaders.adb:25:06: "ADO.QUERIES.LOADERS (body)" depends on "ADO.DRIV 
ERS.CONNECTIONS (spec)" 
ado-queries-loaders.adb:25:06: "ADO.DRIVERS.CONNECTIONS (spec)" depends on "UTIL 
(spec)" 
ado-queries-loaders.adb:27:06: file "util.ads" not found 
ado-queries-loaders.adb:28:06: file "util.ads" not found 
ado-queries-loaders.adb:29:06: file "util.ads" not found 
ado-queries-loaders.adb:30:06: file "util.ads" not found 
ado-queries-loaders.adb:31:06: file "util.ads" not found 
ado-queries-loaders.ads:19:20: "ADO.QUERIES (spec)" depends on "ADO (spec)" 
ado-queries-loaders.ads:19:20: "ADO (spec)" depends on "UTIL (spec)" 
ado-queries-loaders.ads:19:20: file "util.ads" not found 
ado-queries-loaders.ads:19:20: "ADO.QUERIES (spec)" depends on "UTIL (spec)" 
ado-queries-loaders.ads:19:20: "ADO.SQL (spec)" depends on "UTIL (spec)" 
ado-queries-loaders.ads:19:20: "ADO.PARAMETERS (spec)" depends on "ADO.DRIVERS (
spec)" 
ado-queries-loaders.ads:19:20: "ADO.DRIVERS (spec)" depends on "UTIL (spec)" 
ado-queries-loaders.ads:19:20: "ADO.QUERIES.LOADERS (body)" depends on "ADO.QUER 
IES.LOADERS (spec)" 
ado-queries-loaders.ads:19:20: "ADO.QUERIES.LOADERS (spec)" depends on "ADO.QUER 
IES (spec)" 
ado-queries-loaders.ads:19:20: "ADO.QUERIES (spec)" depends on "ADO.SQL (spec)" 
ado-queries-loaders.ads:19:20: "ADO.SQL (spec)" depends on "ADO.PARAMETERS (spec 
)" 
ado-queries-loaders.ads:19:20: "ADO.PARAMETERS (spec)" depends on "ADO.DRIVERS.D 
IALECTS (spec)" 
ado-queries-loaders.ads:19:20: "ADO.DRIVERS.DIALECTS (spec)" depends on "UTIL (s 
pec)" 
gnatmake: "C:\Users\AlexB\Desktop\ada-ado-0.4.0\src\ado-queries-loaders.adb" com 
pilation error 

回答

1

該項目的主頁(鏈接到)說,它需要Ada Util Library和Dynamo。您需要安裝它們(您的錯誤列表顯示您肯定需要Ada Util,我不知道Dynamo)。

您要求Windows構建幫助:您是否安裝了類Unix環境(例如Cygwin)?如果是這樣,您可以嘗試使用提供的configure然後makethe ’standard’ Unix way進行設置,但如果不是最好的選擇,則使用直覺將所提供的.gpr.in文件複製到相應的.gpr並編輯以刪除%變量:例如,需要與其中util.gpr是可以找到的目錄被替換ado.gpr.in開始於

with "config"; 
with "@[email protected]"; 

project Ado is 
    Version := "@[email protected]"; 
    Library_Dir := "@[email protected]"; 

@[email protected];然後,

gnatmake -p -P ado 

對於Ada Util,您需要類似的方法。據我所知,它需要配置,但不需要構建或安裝(在配置ada-ado時,需要添加--with-ada-util=/dir/where/ada-util/source/is;對於Ada Util 1.7.0,庫的構建看起來不錯,但是我需要1.6.1版本才能進行測試

+0

呵呵,是的,我的PC上有cygwin ... btw,我怎麼安裝Dynamo和Ada Util庫,我在哪裏安裝? – Alexandre

+0

好吧,當我嘗試構建securyt lib時,我遇到了很多錯誤... :( – Alexandre

+0

是發電機的'securyt lib'部分嗎?我認爲你可以不用它。 –