delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/09/03/23:28:26

From: SerDevian <scriven AT CS DOT ColoState DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: gcc/gxx c++ -> .o (#defines)
Date: Wed, 27 Aug 1997 14:06:14 -0600
Organization: XYZZ Software Co.
Lines: 31
Message-ID: <340488B6.59E2@CS.ColoState.edu>
NNTP-Posting-Host: miro.vis.colostate.edu
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Hi.

Is there a way to get gxx to *not* link in extra libraries, or get gcc
to explicitly compile c++ code?

I've been working on a multipart c/c++ program, compiling each part
seperately and then linking them later.  

The c++ parts require that "__cplusplus" is defined (due to headers
included).  So, I compile them with gxx, which defines the proper
things.

The problem is that gxx automatically tries to link with the c++
library, even when I'm compiling to a .o file with the "-c" option. 
This gives me three warnings for each file I compile (warns that the c++
libs won't be linked).  If I use gcc instead, the warnings go away but
linking doesn't work right because all the plain C functions are
unrecognized.  (they're declared inside of one of these:
  #ifdef __cplusplus
  extern "C" {}
  #endif
in the headers for the plain c pieces)

I just want to get rid of the "library not linked" warnings, somehow.


 _  _ _  _ ___ ___  -----------"Use the source, Luke!"---------
( \/ ( \/ (__ (__ ) | ~  Scott Scriven (SerDevian / XYZZ)     |
 \  / \  /  //  //  | mailto:scriven AT CS DOT ColoState DOT edu         |
 /  \ / /  //_ //_  | mailto:scriven AT VIS DOT ColoState DOT edu        |
(_/\_(_/  (___(___) | http://www.vis.colostate.edu/~scriven/  |

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019