Viktor, from :
http://orclib.sourceforge.net/download/
I have download example to acces via oci to oracle in C.
I copy and unzipped it in OCI folder.
Then to test I try compile: C:\oci\ocilib\demo\abort.c :
*--------
#include "windows.h"
#include "process.h"
#include "ocilib.h"
/* Example on Microsoft platform */
static HANDLE evt;
void long_oracle_call(void *data)
{
OCI_Statement *st = OCI_CreateStatement((OCI_Connection *) data);
OCI_Resultset *rs;
/* execute a query that takes a long time to process */
OCI_ExecuteStmt(st, "select code, content from huge_table");
rs = OCI_GetResultset(st);
while (OCI_FetchNext(rs))
{
printf("%i - %s", OCI_GetInt(rs, 1), OCI_GetString(rs, 2));
}
SetEvent(evt);
}
int main(void)
{
OCI_Connection *cn;
if (!OCI_Initialize(NULL, NULL, OCI_ENV_DEFAULT))
return EXIT_FAILURE;
cn = OCI_ConnectionCreate("db", "usr", "pwd", OCI_SESSION_DEFAULT);
evt = CreateEvent(0, TRUE, FALSE, 0);
_beginthread(long_oracle_call, 0, cn);
if (WaitForSingleObject(evt, 10000) != WAIT_OBJECT_0)
{
OCI_Break(cn);
Sleep(2000);
}
OCI_Cleanup();
return EXIT_SUCCESS;
}
*--------
My directing :
C:\oci\ocilib\demo>hbmk2 abort.c -incpath=C:/oci/ocilib/include
-lC:/oci/ocilib/lib32/ociliba.lib -lC:/oci/ocilib/lib32/ocilibm.lib
-lC:/oci/ocilib/lib32/ocilibw.lib -lC:/oci/ocilib/lib32/libociliba.a
-C:/oci/ocilib/lib32/libocilibm.a -lC:\oci\ocilib\lib32\libocilibw.a
-trace
But MingGW is write :
--------------------------------
hbmk: Processing configuration: C:\harbour\bin\hbmk.cfg
hbmk: C compiler command:
gcc.exe -c -O3 -march=i586 -mtune=pentiumpro -fomit-frame-pointer
-I"C:/harbour/include" -I"C:/oci/ocilib/include" abort.c
hbmk: Linker command:
gcc.exe abort.o -mconsole -Wl,--start-group
C:/oci/ocilib/lib32/ociliba.lib C:/oci/ocilib/lib32/ocilibm.lib
C:/oci/ocilib/
lib32/ocilibw.lib C:/oci/ocilib/lib32/libociliba.a
C:/oci/ocilib/lib32/libocilibm.a C:/oci/ocilib/lib32/libocilibw.a
-lhbcpag
e -lhblang -lhbcommon -lhbcplr -lhbdebug -lhbvm -lhbrdd -lhbusrrdd
-lhbhsx -lhbsix -lrddntx -lrddcdx -lrddfpt -lhbuddall -lrd
dnsx -lhbrtl -lhbpp -lhbmacro -lhbextern -lgtcgi -lgtpca -lgtstd -lgtwin
-lgtwvt -lgtgui -lhbpcre -lhbzlib -lkernel32 -luser3
2 -lgdi32 -ladvapi32 -lws2_32 -lwinspool -lcomctl32 -lcomdlg32 -lshell32
-lole32 -loleaut32 -luuid -lmpr -lwinmm -lmapi32 -li
mm32 -lmsimg32 -Wl,--end-group -oabort.exe -LC:/harbour/lib/win/mingw
-LC:/harbour/lib
abort.o:abort.c:(.text+0x2b): undefined reference to `OCI_Initialize'
abort.o:abort.c:(.text+0x64): undefined reference to
`OCI_ConnectionCreate'
abort.o:abort.c:(.text+0xc7): undefined reference to `OCI_Cleanup'
abort.o:abort.c:(.text+0xe4): undefined reference to `OCI_Break'
abort.o:abort.c:(.text+0x10d): undefined reference to
`OCI_StatementCreate'
abort.o:abort.c:(.text+0x120): undefined reference to `OCI_ExecuteStmt'
abort.o:abort.c:(.text+0x128): undefined reference to `OCI_GetResultset'
abort.o:abort.c:(.text+0x13d): undefined reference to `OCI_GetString'
abort.o:abort.c:(.text+0x150): undefined reference to `OCI_GetInt'
abort.o:abort.c:(.text+0x16c): undefined reference to `OCI_FetchNext'
collect2: ld returned 1 exit status
hbmk: Error: Running linker. 1
gcc.exe abort.o -mconsole -Wl,--start-group
C:/oci/ocilib/lib32/ociliba.lib C:/oci/ocilib/lib32/ocilibm.lib
C:/oci/ocilib/
lib32/ocilibw.lib C:/oci/ocilib/lib32/libociliba.a
C:/oci/ocilib/lib32/libocilibm.a C:/oci/ocilib/lib32/libocilibw.a
-lhbcpag
e -lhblang -lhbcommon -lhbcplr -lhbdebug -lhbvm -lhbrdd -lhbusrrdd
-lhbhsx -lhbsix -lrddntx -lrddcdx -lrddfpt -lhbuddall -lrd
dnsx -lhbrtl -lhbpp -lhbmacro -lhbextern -lgtcgi -lgtpca -lgtstd -lgtwin
-lgtwvt -lgtgui -lhbpcre -lhbzlib -lkernel32 -luser3
2 -lgdi32 -ladvapi32 -lws2_32 -lwinspool -lcomctl32 -lcomdlg32 -lshell32
-lole32 -loleaut32 -luuid -lmpr -lwinmm -lmapi32 -li
mm32 -lmsimg32 -Wl,--end-group -oabort.exe -LC:/harbour/lib/win/mingw
-LC:/harbour/lib
My ask is - can we use hbmk2 to link and compile pure c code ?
Regards,
Marek Horodyski
_______________________________________________
Harbour mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour