This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

g++3.3.3 compilation problem under Cygwin

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
undefined reference to `_etext'
undefined reference to `_edata'
collect2: ld returned 1 exit status

Can someone help me?

Best regards

Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]