delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/12/19/20:21:19

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
From: "Dr Jekyll" <drjekyll AT empirics DOT net>
To: "'Cygwin List'" <cygwin AT cygwin DOT com>
Subject: g++3.3.3 compilation problem under Cygwin
Date: Mon, 20 Dec 2004 02:20:53 +0100
MIME-Version: 1.0
In-Reply-To: <6.2.0.14.0.20041219144604.04a7cd78@pop.prospeed.net>
Message-Id: <200412191921625.SM01664@xuanson>
X-IsSubscribed: yes

Hi,
I am reading the book "Inter-process Communications in Linux", section 1.10
Process Memory Addresses and I have tried to compile the following code
under Cygwin without success (with the command):

Bash-shell>g++ -o run p1.3.cxx

Where the content of "p1.3.cxx" is given here:

/*                                                     
    Displaying process segment addresses               
 */                                                    
#include <iostream>                                    
extern int etext, edata, end;                          
using namespace std;                                   
int main( ){                                               
  cout << "Adr etext: " << hex << int(&etext) << "\t ";
  cout << "Adr edata: " << hex << int(&edata) << "\t ";
  cout << "Adr end: "   << hex << int(&end  ) << "\n"; 
  return 0;                                            
}                                             

Here is the error message

$ g++ -o p1.3 p1.3.cpp
/cygdrive/c/DOCUME~1/JK/LOCALS~1/Temp/ccnKmHpn.o(.text+0x46):p1.3.cpp:
undefined reference to `_etext'
/cygdrive/c/DOCUME~1/JK/LOCALS~1/Temp/ccnKmHpn.o(.text+0x8a):p1.3.cpp:
undefined reference to `_edata'
collect2: ld returned 1 exit status


Can someone help me?

Best regards
JK



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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