View mode: basic / threaded / horizontal-split · Log in · Help
October 05, 2012
How to create library with exported functions
Hi!

I am make a yet another attempt to create an interface to 
PostgreSQL from the D: https://github.com/denizzzka/dpq2

I can not understand how do I compile it into a library and 
create .di headers file. Currently, "make debug" uses dmd -lib 
and creates libpq.di file, but its file contains only few strings 
from main()

Plz help!
October 05, 2012
Re: How to create library with exported functions
(sorry for my English)

Hi!

I am make a yet another attempt to create an interface to
PostgreSQL from the D: https://github.com/denizzzka/dpq2

I can not understand how do a compile it into a library and
create .di headers file. Currently, "make debug" uses dmd -lib
and creates libpq.di file, but this file contains only few strings
from main()

As far as I understand it, in libdpq2.di should be automatically 
added functions what are available from the library. But they are 
not.
October 05, 2012
Re: How to create library with exported functions
I tried to add:

 export { /* module code except imports*/}

but nothing has changed.
October 05, 2012
Re: How to create library with exported functions
On Friday, 5 October 2012 at 09:15:36 UTC, denizzzka wrote:
> I tried to add:
>
>  export { /* module code except imports*/}
>
> but nothing has changed.

libdpq2.di have a comment on top:

// D import file generated from 'unittests_main.d'

why only from unittests_main.d?

Build command is:

dmd libpq.di connection.d query.d answer.d unittests_main.d 
-L-lpq -L-lcom_err -w -d -Hflibdpq2.di -oflibdpq2 -g -debug -lib

which includes 5 source files.
October 05, 2012
Re: How to create library with exported functions
solved!

problem was in -Hf compiler switch
Top | Discussion index | About this forum | D home