Podrška #17627
Zatvorennmraka-2: vista instalacija harbour mingw, hbsqlit3
0%
Opis
na ticketu vezanom za LD-PKE-XML sam rekao da treba probati sqlite sa harbour-om, pa ću sada na svojoj vista instalacija napraviti developersko okruženje, da to Saša može podžoniti
Fajlovi
Povezani tiketi 5 (0 otvoreno — 5 zatvorenih)
Izmjenjeno od Ernad Husremović prije više od 15 godina
Izmjenjeno od Ernad Husremović prije više od 15 godina
u sklopu njega tu je i mingw
Izmjenjeno od Ernad Husremović prije više od 15 godina
instaliramo moj klon harbour-a
Izmjenjeno od Ernad Husremović prije više od 15 godina
prije toga instaliramo msysgit
biram opciju:
Run "Git from the windows command prompt"
Izmjenjeno od Ernad Husremović prije više od 15 godina
Sljedeće pitanje: odabirem "Use Unix style line endings"
Izmjenjeno od Ernad Husremović prije više od 15 godina
Izmjenjeno od Ernad Husremović prije više od 15 godina
Napomena: moj ubuntu karmic puno ljepše radi od ove viste, ona non stop "nešto trza" u smislu odziva korisničkog interfejsa
Izmjenjeno od Ernad Husremović prije više od 15 godina
$ git config -l
core.symlinks=false core.autocrlf=input color.diff=auto pack.packsizelimit=2g help.format=html
Izmjenjeno od Ernad Husremović prije više od 15 godina
bringout@NMRAKA-2 /c $ mkdir devel bringout@NMRAKA-2 /c/devel $ mkdir git bringout@NMRAKA-2 /c/devel $ cd git bringout@NMRAKA-2 /c/devel/git $ git clone git://gitorious.bring.out.ba/~hernad/harbour/hernads-harb our.git harbour
Izmjenjeno od Ernad Husremović prije više od 15 godina
ovaj clone ide višestruko sporije nego na ubuntu, dobro to je poznato, ali na kraju ipak završi ..
Izmjenjeno od Ernad Husremović prije više od 15 godina
c:\devel\set_path.bat
C:\devel\git>git --version
git version 1.6.3.2.1299.gee46c
Izmjenjeno od Ernad Husremović prije više od 15 godina
HB_INC_COMPILE ne smije biti setovana !
echo ovo ne smije biti setovano kod harbour build-a! rem set HB_INC_COMPILE=c:\harbour\include
takođe mu smeta pristustvo sh.exe (iz git) tako ni c:\Git\bin ne treba biti u path-u kod harbour build-a
Izmjenjeno od Ernad Husremović prije više od 15 godina
c:\devel\git\harbour\harbour> make_gnu.bat
i build ide ... ide ... ima ogroman broj warning-a na build-u qt binding-a ali ne prijavljuje greške
Izmjenjeno od Ernad Husremović prije više od 15 godina
koji mingw32-make.exe¶
bilješka: mingw32-make se nalazi u qt .. \mingw\bin ... međuitm, ovaj make_gnu koristi exe koji se nalazi u harbour reposu (u harbour/config/mingw32-make.exe) i primjetio sam da ovaj standardni (ili qt-ov mingw32-make) prijavljuje grešku na config/dir.cf linija 64, a ovaj unutar config-a tu grešku ne prijavljuje ...
Izmjenjeno od Ernad Husremović prije više od 15 godina
C:\devel\git\harbour\harbour>harbour --version
Harbour 2.0.0beta1 (Rev. -1) Copyright (c) 1999-2009, http://www.harbour-project.org/
Izmjenjeno od Ernad Husremović prije više od 15 godina
C:\devel\git\harbour\harbour>dir c:\harbour\lib\libsqlite3.a
Volume in drive C is ACER Volume Serial Number is DC98-768C Directory of c:\harbour\lib 15.06.2009 16:10 705.458 libsqlite3.a 1 File(s) 705.458 bytes 0 Dir(s) 15.908.405.248 bytes free
Izmjenjeno od Ernad Husremović prije više od 15 godina
- Naslov promijenjeno iz nmraka-2: vista instalacija harbour mingw u nmraka-2: vista instalacija harbour mingw, hbsqlit3
Directory of C:\devel\git\harbour\harbour\contrib\hbsqlit3\tests
15.06.2009 14:56 <DIR> . 15.06.2009 14:56 <DIR> .. 15.06.2009 14:56 10.295 authoriz.prg 15.06.2009 14:56 9.183 backup.prg 15.06.2009 14:56 4.848 blob.prg 15.06.2009 14:56 39 hbsqlit3.hbc 15.06.2009 14:56 9.518 hooks.prg 15.06.2009 14:56 3.624 metadata.prg 15.06.2009 14:56 2.460 pack.prg 15.06.2009 14:56 8.512 sl3_test.prg 8 File(s) 48.479 bytes
2 Dir(s) 14.690.807.808 bytes free
Izmjenjeno od Ernad Husremović prije više od 15 godina
super ovo radi bez ikakve intervencije
#include "hbsqlit3.ch" #define TRACE #define TABLE_SQL "CREATE TABLE t1( id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT, age INTEGER )" #define DB_NAME "test.sqlite3" PROCEDURE main() ? sqlite3_libversion() sqlite3_sleep( 3000 ) IF sqlite3_libversion_number() < 3005001 RETURN ENDIF create_db() manipulate_db() RETURN /* */ PROCEDURE create_db() LOCAL lCreateIfNotExist := .f. LOCAL db := sqlite3_open( DB_NAME, lCreateIfNotExist ) IF ! Empty( db ) sqlite3_exec( db, "DROP TABLE t1" ) ENDIF RETURN /* */ PROCEDURE manipulate_db() LOCAL lCreateIfNotExist := .t. LOCAL db := sqlite3_open( DB_NAME, lCreateIfNotExist ) LOCAL stmt LOCAL nCCount, nCType, nI, nJ LOCAL aCType := { "SQLITE_INTEGER", "SQLITE_FLOAT", "SQLITE_TEXT", "SQLITE_BLOB", "SQLITE_NULL" } LOCAL aTable IF ! Empty( db ) #ifdef TRACE sqlite3_profile( db, .t. ) sqlite3_trace( db, .t. ) #endif sqlite3_exec( db, "PRAGMA auto_vacuum=0" ) sqlite3_exec( db, "PRAGMA page_size=4096" ) IF sqlite3_exec( db, TABLE_SQL ) == SQLITE_OK ? "CREATE TABLE t1 - Ok" END sqlite3_exec( db, ; "BEGIN TRANSACTION;" + ; "INSERT INTO t1( name, age ) VALUES( 'Bob', 52 );" + ; "INSERT INTO t1( name, age ) VALUES( 'Fred', 40 );" + ; "INSERT INTO t1( name, age ) VALUES( 'Sasha', 25 );" + ; "INSERT INTO t1( name, age ) VALUES( 'Ivet', 28 );" + ; "COMMIT;" ) ? "BEGIN TRANSACTION" ? "INSERT INTO t1( name, age ) VALUES( 'Bob', 52 )" ? "INSERT INTO t1( name, age ) VALUES( 'Fred', 40 )" ? "INSERT INTO t1( name, age ) VALUES( 'Sasha', 25 )" ? "INSERT INTO t1( name, age ) VALUES( 'Ivet', 28 )" ? "COMMIT" ? "The number of database rows that were changed: " + ltrim( str( sqlite3_changes( db ) ) ) ? "Total changes: " + ltrim( str( sqlite3_total_changes( db ) ) ) sqlite3_sleep( 3000 ) stmt := sqlite3_prepare( db, "INSERT INTO t1( name, age ) VALUES( :name, :age )") IF ! Empty( stmt ) IF sqlite3_bind_text( stmt, 1, "Andy" ) == SQLITE_OK .AND. ; sqlite3_bind_int( stmt, 2, 17 ) == SQLITE_OK IF sqlite3_step( stmt ) == SQLITE_DONE ? "INSERT INTO t1( name, age ) VALUES( 'Andy', 17 ) - Done" ENDIF ENDIF sqlite3_reset( stmt ) IF sqlite3_bind_text( stmt, 1, "Mary" ) == SQLITE_OK .AND. ; sqlite3_bind_int( stmt, 2, 19 ) == SQLITE_OK IF sqlite3_step( stmt ) == SQLITE_DONE ? "INSERT INTO t1( name, age ) VALUES( 'Mary', 19 ) - Done" ENDIF ENDIF sqlite3_clear_bindings( stmt ) sqlite3_finalize( stmt ) ENDIF ? "The number of database rows that were changed: " + ltrim( str( sqlite3_changes( db ) ) ) ? "Total changes: " + ltrim( str( sqlite3_total_changes( db ) ) ) ? "Last _ROWID_: " + str( sqlite3_last_insert_rowid( db ) ) ? "" stmt := sqlite3_prepare( db, "SELECT * FROM t1 WHERE name == :name ") sqlite3_bind_text( stmt, 1, "Andy" ) ? ? "SELECT * FROM t1 WHERE name == 'Andy'" nJ := 0 DO WHILE sqlite3_step( stmt ) == SQLITE_ROW nCCount := sqlite3_column_count( stmt ) ++nJ ? "Record # " + str( nJ ) IF nCCount > 0 FOR nI := 0 TO nCCount - 1 nCType := sqlite3_column_type( stmt, nI ) ? "Column name : " + sqlite3_column_name( stmt, nI ) ? "Column type : " + aCType[ nCType ] ? "Column value: " SWITCH nCType CASE SQLITE_BLOB ?? "BLOB" //sqlite3_column_blob( stmt, nI ) EXIT CASE SQLITE_INTEGER ?? str ( sqlite3_column_int( stmt, nI ) ) EXIT CASE SQLITE_NULL ?? "NULL" EXIT CASE SQLITE_TEXT ?? sqlite3_column_text( stmt, nI ) EXIT END SWITCH NEXT nI ENDIF ENDDO ? "Total records - " + str( nJ ) sqlite3_clear_bindings( stmt ) sqlite3_finalize( stmt ) sqlite3_sleep( 3000 ) stmt := sqlite3_prepare( db, "SELECT * FROM t1 WHERE age >= ?5") sqlite3_bind_int( stmt, 5, 40 ) ? ? "SELECT * FROM t1 WHERE age >= 40 " nJ := 0 DO WHILE sqlite3_step( stmt ) == SQLITE_ROW nCCount := sqlite3_column_count( stmt ) ++nJ ? "Record # " + str( nJ ) IF nCCount > 0 FOR nI := 1 TO nCCount nCType := sqlite3_column_type( stmt, nI ) ? "Column name : " + sqlite3_column_name( stmt, nI ) ? "Column type : " + aCType[ nCType ] ? "Column value: " SWITCH nCType CASE SQLITE_BLOB ?? "BLOB" //sqlite3_column_blob( stmt, nI ) EXIT CASE SQLITE_INTEGER ?? str( sqlite3_column_int( stmt, nI ) ) EXIT CASE SQLITE_NULL ?? "NULL" EXIT CASE SQLITE_TEXT ?? sqlite3_column_text( stmt, nI ) EXIT END SWITCH NEXT nI ENDIF ENDDO ? "Total records - " + str( nJ ) sqlite3_clear_bindings( stmt ) sqlite3_finalize( stmt ) sqlite3_sleep( 3000 ) ? ? "SELECT id, name, age + 5 FROM t1" stmt := sqlite3_prepare( db, "SELECT id, name, age + 5 FROM t1") ? sqlite3_column_name( stmt, 1 ) ? sqlite3_column_name( stmt, 2 ) ? sqlite3_column_name( stmt, 3 ) ? aCType[ sqlite3_column_type( stmt, 1 ) ] ? aCType[ sqlite3_column_type( stmt, 2 ) ] ? aCType[ sqlite3_column_type( stmt, 3 ) ] ? sqlite3_column_decltype( stmt, 1 ) ? sqlite3_column_decltype( stmt, 2 ) ? sqlite3_column_decltype( stmt, 3 ) sqlite3_finalize( stmt ) sqlite3_sleep( 3000 ) ? ? "sqlite3_get_table" ? aTable := sqlite3_get_table( db, "SELECT name, age FROM t1 WHERE age BETWEEN 10 AND 20" ) FOR nI := 1 TO Len( aTable ) FOR nJ := 1 TO Len( aTable[nI] ) ?? aTable[nI][nJ], " " NEXT nJ ? NEXT nI sqlite3_sleep( 3000 ) ENDIF RETURN
build:
C:\devel\git\harbour\harbour\contrib\hbsqlit3\tests>hbmk2 sqlite3_1.prg
hbmk: Processing configuration: c:\harbour\bin\hbmk.cfg hbmk: Processing: hbsqlit3.hbc Harbour 2.0.0beta1 (Rev. -1) Copyright (c) 1999-2009, http://www.harbour-project.org/ Compiling 'sqlite3_1.prg'... Lines 403, Functions/Procedures 3 Generating C source output to 'sqlite3_1.c'... Done.
C:\devel\git\harbour\harbour\contrib\hbsqlit3\tests>sqlite3_1.exe
3.6.14.2 CREATE TABLE t1 - Ok BEGIN TRANSACTION INSERT INTO t1( name, age ) VALUES( 'Bob', 52 ) INSERT INTO t1( name, age ) VALUES( 'Fred', 40 ) INSERT INTO t1( name, age ) VALUES( 'Sasha', 25 ) INSERT INTO t1( name, age ) VALUES( 'Ivet', 28 ) COMMIT The number of database rows that were changed: 1 Total changes: 4 INSERT INTO t1( name, age ) VALUES( 'Andy', 17 ) - Done INSERT INTO t1( name, age ) VALUES( 'Mary', 19 ) - Done The number of database rows that were changed: 1 Total changes: 6 Last _ROWID_: 6 SELECT * FROM t1 WHERE name == 'Andy' Record # 1 Column name : Column type : SQLITE_NULL Column value: NULL Column name : id Column type : SQLITE_INTEGER Column value: 5 Column name : name Column type : SQLITE_TEXT Column value: Andy Total records - 1 SELECT * FROM t1 WHERE age >= 40 Record # 1 Column name : id Column type : SQLITE_INTEGER Column value: 1 Column name : name Column type : SQLITE_TEXT Column value: Bob Column name : age Column type : SQLITE_INTEGER Column value: 52 Record # 2 Column name : id Column type : SQLITE_INTEGER Column value: 2 Column name : name Column type : SQLITE_TEXT Column value: Fred Column name : age Column type : SQLITE_INTEGER Column value: 40 Total records - 2 SELECT id, name, age + 5 FROM t1 id name age + 5 SQLITE_NULL SQLITE_NULL SQLITE_NULL INTEGER TEXT sqlite3_get_table name age Andy 17 Mary 19
u path-u mora biti hbc (config hbmk-2)
C:\devel\git\harbour\harbour\contrib\hbsqlit3\tests>type hbsqlit3.hbc
# # $Id$ # libs=hbsqlit3 sqlite3
Izmjenjeno od Ernad Husremović prije više od 15 godina
Izmjenjeno od Ernad Husremović prije više od 15 godina
sutra treba ovaj sqlite još malo pogledati i posložiti što se tiče ruby-ja i harbour-a
Za ruby treba pogledati primjere, da je Saletu lakše u to ući.
Takođe treba vidjeti koliko je posao buildati wxRuby na visti, te wxHarbour s obzirm da sam izbuildao bez problema sa mingw wx library.
Pokušati u harbour-u linkati onaj dbExplorer
Izmjenjeno od Ernad Husremović prije više od 15 godina
- Fajl hbmk2_fin.rb hbmk2_fin.rb dodano
- Fajl fin.hbc fin.hbc dodano
fin build sa hbmk2¶
treba u fin direktorij staviti ovaj ruby i hbc (config za hbmk2) i pokušati
ruby hbmk2_fin.rb
prije toga treba izbrisati files.prg koji je viška
Izmjenjeno od Ernad Husremović prije više od 14 godina
- Status promijenjeno iz Dodijeljeno u Zastarjelo