libraries and c++ compatibility

Jason King jhking at airmail.net
Sat May 12 19:44:20 PDT 2012


I'm trying to use ocilib (deimos\ocilib) bindings and having some 
issues.
dmd 2.0.59, Windows 7 64 bit.
I can change sc.ini to get everything to build.
I can compile with dmd myapp.d -I<path_to_deimos> -c, but I can't 
seem to figure out the right switches to make the app find the 
ociliba-dm.lib that I generated.
Using sc.ini seems to work, using the lib environment variable 
seems to work but I'd like to understand how to make the command 
line switches work.

The compiled application hangs the first time it calls an ocilib 
routine and I don't expect you folks to debug that for me but it 
occurred to me that since I have the paid-for version of dmc I 
could try essentially the same code vs. c++ and if it worked that 
would isolate the problem to the ocilib.d header.

I have the same "can't find the library with command line 
switches" problem but I suspect the D fix will help me c++-wise 
as well.  The unique to c++ issue is shows like so.
C:\ocilib\ocilib3.9.3\lib32>dmc myapp.cpp -c 
-Ic:\ocilib\ocilib3.9.3\include

C:\ocilib\ocilib3.9.3\lib32>optlink myapp.obj,,,ociliba-dm.lib
OPTLINK (R) for Win32  Release 7.50B1
Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved

myapp.obj(myapp)
  Error 42: Symbol Undefined _OCI_Cleanup
myapp.obj(myapp)
  Error 42: Symbol Undefined _OCI_GetString
... 7 more, covering all ocilib calls.

running lib -l vs. ociliba-dm.lib shows symbols with @ signs 
appended, e.g.
_OCI_Cleanup at 0 and _OCI_GetString at 8.
I suspect there's some simple disconnect on my part here, but I 
can't see it.
Any assistance deeply appreciated.


More information about the Digitalmars-d-learn mailing list