This is the mail archive of the
cygwin
mailing list for the Cygwin project.
g++3.3.3 compilation problem under Cygwin
- From: "Dr Jekyll" <drjekyll at empirics dot net>
- To: "'Cygwin List'" <cygwin at cygwin dot com>
- Date: Mon, 20 Dec 2004 02:20:53 +0100
- Subject: g++3.3.3 compilation problem under Cygwin
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/