www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - How to create library with exported functions

reply "denizzzka" <4denizzz gmail.com> writes:
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!
Oct 05 2012
parent reply "denizzzka" <4denizzz gmail.com> writes:
(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.
Oct 05 2012
parent reply "denizzzka" <4denizzz gmail.com> writes:
I tried to add:

  export { /* module code except imports*/}

but nothing has changed.
Oct 05 2012
parent reply "denizzzka" <4denizzz gmail.com> writes:
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.
Oct 05 2012
parent "denizzzka" <4denizzz gmail.com> writes:
solved!

problem was in -Hf compiler switch
Oct 05 2012