Subject: Using dllwrap on C++ code [Re: Linker error]
From: [email-masked] (Mumit Khan)

9 Dec 1998 07:19:09 -0800
Message-ID: <[email-masked]>
References: <[email-masked]>
To: "Joost Kraaijeveld" <[email-masked]>
Cc: [email-masked]

"Joost Kraaijeveld" <[email-masked]> writes:
> Below is the output of a compilation. Can anyone give me am idea where I
> must look for the error?

Note that I've changed the subject line to reflect the problem so that
it's easier to find when doing a mailing list search.

Dllwrap by default uses the C compiler-driver since it has no way of
knowning otherwise. Since you're linking C++ code, 

  - you can tell dllwrap that it needs to use the C++ driver via the
    --driver-name=c++ option so that the C++ runtime is automatically 
    linked in (preferred method in my book). 
    
    $ dllwrap --driver-name=c++ -o pq++.dll --dllname pq++.dll \
      --def pq++.def pgenv.o pgconnection.o pgtransdb.o pgcursordb.o \
      pglobject.o ../../utils/dllinit.o  -L../libpq -lpq
    
  - or, include the C++ runtime library explicitly (-lstdc++).

    $ dllwrap -o pq++.dll --dllname pq++.dll \
      --def pq++.def pgenv.o pgconnection.o pgtransdb.o pgcursordb.o \
      pglobject.o ../../utils/dllinit.o  -L../libpq -lpq -lstdc++

fyi, dllwrap deduces the ``--dllname <dllname>' argument from `-o <dll>'
argument (and vice versa), so you don't need to specify the --dllname
any more. I should probably write some documentation, but the weather 
needs to turn really cold before that happens.

Regards,
Mumit

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".