Re: help with C++ and FastCGI

Bill Burton (billb@bedford.progress.com)
Fri, 7 Jun 1996 12:48:11 -0400

Date: Fri, 7 Jun 1996 12:48:11 -0400
From: billb@bedford.progress.com (Bill Burton)
Message-Id: <960607124059.ZM18470@pcbillb.bedford.progress.com>
In-Reply-To: <199606071321.JAA21665@breckenridge.openmarket.com>
To: fastcgi-developers@OpenMarket.com
Subject: Re: help with C++ and FastCGI

On Jun 7,  9:21am, Mark Brown wrote:
> Subject: help with C++ and FastCGI
> 
> Here's another message that bounced and got misplaced.
> (These bounces were caused by a majordomo mis-configuration,
> now cured.)  Reply at the bottom.
> 
>     --mark
> 
> - ------- Forwarded Message
> Date: Mon, 27 May 1996 21:35:31 -0500 (CDT)
> From: MOSES R DE_JONG <dejo0012@itlabs.umn.edu>
> To: fastcgi-developers@OpenMarket.com
> Subject: help with c++ and fast cgi
> 
> 
> I am trying to get a version of fast cgi to run with c++ but I am
> getting an error when I try to compile with CC.
> 
> here is my compile line
> CC -o run test.C -Iinclude libfcgi/libfcgi.a
> 
> i get this back
> undefined __eprintf
> 
> but when I run this
> g++ -o run test.C -Iinclude libfcgi/libfcgi.a
> 
> it works fine.
> 
> the symbol __eprintf is undefined in the libfcgi.a file using nm.
> 
> any ideas?

It would appear you built libfcgi.a with gcc.  In order to link successfully 
when building your application with some other compiler (whether C++ or not), 
you need to link with the libgcc.a library built when gcc is installed.  The 
full path to the location of the libgcc.a library can be obtained by running gcc 
or g++ with the option -print-libgcc-file-name.

So, to link your executable, you could add something like:
  `gcc -print-libgcc-file-name` 
to the list of object files.

The other option is to just rebuild libfcgi.a using the same compiler you will 
be using to build your application.

-Bill

> - ------- End of Forwarded Message
> 
> Moses, your problem sounds platform/compiler specific.  For instance,
> on Digital UNIX, nm tells me:
> 
>     alpha> nm libfcgi.a | grep printf
>     sprintf                | 0000000000000000 | U | 0000000000000008
>     FCGI_fprintf           | 0000000000003712 | T | 0000000000000008
>     FCGI_printf            | 0000000000003936 | T | 0000000000000008
>     FCGI_vfprintf          | 0000000000004096 | T | 0000000000000008
>     FCGI_vprintf           | 0000000000004272 | T | 0000000000000008
>     vfprintf               | 0000000000000000 | U | 0000000000000008
> 
> sprintf is called from fcgiapp and vfprintf is called from fcgi_stdio.
> 
> Perhaps somebody else has an idea.
> 
> The next version of the header files has the conditional 'extern "C"' stuff
> for the benefit of C++.  Is anyone already using C++ with FastCGI?
> 
>     --mark
> 
> ------- End of Forwarded Message
> 
>-- End of excerpt from Mark Brown

-- 
Bill Burton @ Progress Software Corporation, 14 Oak Park, Bedford, MA 01730
E-mail: billb@progress.com  Phone: +1 617 280-4893  Fax: +1 617 280-4655
---------------------  URL: http://www.progress.com/  ---------------------