libraries and c++ compatibility

dnewbie run3 at myopera.com
Sun May 13 06:55:51 PDT 2012


On Sunday, 13 May 2012 at 02:44:22 UTC, Jason King wrote:
> 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.


Please try adding `-DOCI_API=__stdcall -DOCI_CHARSET_ANSI` to dmc 
command line. (check 
http://orclib.sourceforge.net/doc/html/group__g__install.html)

If you get runtime errors, please check your ORACLE_HOME 
environment variable and make sure your %ORACLE_HOME%\bin 
directory is in your PATH environment variable.





More information about the Digitalmars-d-learn mailing list