www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/22/22:06:22

Date: Sat, 22 Feb 1997 22:02:16 -0500 (EST)
From: Michael Phelps <morphine AT hops DOT cs DOT jhu DOT edu>
To: John Beppu <beppu AT rigel DOT oac DOT uci DOT edu>
cc: djgpp AT delorie DOT com
Subject: Re: [Q] why would this error occur? undefined reference to terminate(void)
In-Reply-To: <5eo3ok$5oq@news.service.uci.edu>
Message-ID: <Pine.GSO.3.95.970222215845.15521A-100000@hops.cs.jhu.edu>
MIME-Version: 1.0

On 23 Feb 1997, John Beppu wrote:

> 
> 
>   I tried to use exception handling in C++ for the first time, and
>   I'm wondering if this may have something to do with these errors.
>   If someone could tell me how I could get rid of these errors,
>   please reply.  Thanks
> 
> 
> 
> gcc -O2 -lgpp -lm -fhandle-exceptions -fomit-frame-pointer -fforce-mem 
	-fforce-addr main.o subst.o -o main

Try linking in the libraries at the end of the command line:
	gcc -O2 -fhandle-exceptions -fomit-frame-pointer -fforce-addr
		main.o subst.o -o main -lgpp -lm

The order (and existance!) of libraries for linking is usually the reason
for underfined reference errors. 

> main.cc(.text+0x3cb): undefined reference to `terminate(void)'
> main.cc(.text+0x631): undefined reference to `terminate(void)'
> subst.cc(.text+0xcb7): undefined reference to `terminate(void)'
> subst.cc(.text+0x1701): undefined reference to `terminate(void)'
> make.exe: *** [main] Error 1
> 
> 
> -- 
>   beppu AT uci DOT edu .............................................................
> 


						---Michael Phelps
						   morphine AT cs DOT jhu DOT edu


                               CH3
                               |
                               N
                             / |
                     ______/   |
                    /      \   CH2
             _____/         \__|__      
           //     \\        /  |  \\     
         //        \\______/___CH2 \\  
          \        /       \       /
           \______/         \_____/
          / ------ \       /      \
        OH           \   /         OH
                       O
 
                   Morphine



- Raw text -


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