Re: function compiled with g++

From: Jeff Davis <list-pgsql-general(at)dynworks(dot)com>
To: Boris Pran <boris(dot)pran(at)finteh(dot)hr>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: function compiled with g++
Date: 2001-09-24 06:08:29
Message-ID: 200109240610.XAA16592@smtp.ucsd.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

C++ mangles the symbols for linking, i.e. a function named "foo" might not be
the symbol "foo". Try using the 'extern "C" { ... }' to make the symbols keep
their names like in C.

Hope this helps,
Jeff Davis

On Sunday 23 September 2001 11:03 pm, you wrote:
> Why the same function writen in C, compiled with gcc works OK, but compiled
> with g++, doesn't even load? Not mentioning those written in C++.
>
> i.e. loader reports undefined symbol: pg_detoast_datum__FP7varlena or some
> other undefined symbol...
>
> I would actually need to know should I forget C++ for writing functions or
> am I just doing something wrong ?
>
> Thanks.
> Boris
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org

In response to

Browse pgsql-general by date

  From Date Subject
Next Message cveridis 2001-09-24 06:28:34 Question on triggers...
Previous Message Boris Pran 2001-09-24 06:03:45 function compiled with g++