Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com X-Sent: 9 Dec 2001 01:18:05 GMT Message-ID: <000b01c1804f$61867ce0$0100a8c0@hannes> From: "Hans Horn" To: Subject: linking C++ code against library from fortran sources Date: Sat, 8 Dec 2001 17:18:16 -0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Hi everybody, I have a bunch of old numerical fortran77 sources, which I compiled with g77 and archived into, say libMyF77.a. I want those f77 functions to be called from w/i a c++ program. Here are my two questions: 1. to satisfy the compiler, I have to declare the functions used as 'extern'. Which language string should I be using? "FORTRAN" as language string (as I had used on other platforms, such as AIX) is not recognized by gcc/g++ gcc/g++ accepts only either "C" or nothing (or ????). Which is the right one here? 2. the linker complains about the functions used as undefined references. I think I've told the linker properly, where to look for archives (-L -lMyF77). What am I doing wrong? Do I have to do something special when archiving? Do I have to raise another magic flag for the linker???? Any light shed onto the subject is severely appreciated! Hans -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/