Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!sun-barr!newstop!texsun!letni!void!ozdaltx!toma From: toma@ozdaltx.UUCP (Tom Armistead) Newsgroups: comp.lang.c++ Subject: Re: On Linking TC++ to Assembly Language Summary: extern "C" { ... } Message-ID: <6895@ozdaltx.UUCP> Date: 25 Aug 90 04:41:46 GMT References: <1990Aug20.143139.7100@ux1.cso.uiuc.edu> Followup-To: comp.lang.c++ Organization: AIDS INFO EXCG/OZ BBS - Dallas, TX Lines: 37 In article <1990Aug20.143139.7100@ux1.cso.uiuc.edu>, khan@ux1.cso.uiuc.edu (Scott Coleman) writes: > Today's hopefully-not-too-dumb question concerns linking routines in > Assembly Language to a Turbo C++ program. Specifically, I want to use > a Curses library (Aspen Curses) with TC++. The library compiles and links > when TC++ is in "ANSI C compiler" mode, but when I attempted to link it > with a C++ program, TLink couldn't find any of the symbols. > . . . > khan@ux1.cso.uiuc.edu The problem is that TC++ is C++ v2.x compatible, which supports 'typesafe' linking. What this means is that function names are mangled to include the type information. To fix this, use the 'extern "C"' direcive around your function prototypes. This tells the C++ compiler to NOT mangle the function names. To see an example of this, look in some the the TC++ include file (stdio.h). Ex. extern "C" int printf( char *fmt, ... ); or extern "C" { int printf( char *fmt, ... ); int strcmp( char *, char * ); } Maybe this'll do it for you? Tom -- ------------------------------- {uunet,smu,ames}!sulaco!ozdaltx!toma (Tom Armistead @ Garland, Texas) {mic,void,egsner}!ozdaltx!toma