473,326 Members | 2,173 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

dinkumware 402 linking with g++ 3.x/ _Winit undefined ref

Hi,

I have some problems to link a simple hello world program using
g++ (version 3.2.3 or 3.3) and dinkumware 402.

//hallo world...
#include <iostream>
main () {
std::cout << "bla" << std::endl;
}

// the linking is something of that kind...
g++ -I./dinkumware_co/include ./libgcc_v3.2_c99_standard.a test.cpp

then I get:

/usr/tmp/cct8tLwS.o: In function
`__static_initialization_and_destruction_0(int, int)':
/usr/tmp/cct8tLwS.o(.text+0x74): undefined reference to
`std::_Winit::_Winit[in-charge]()'
/usr/tmp/cct8tLwS.o(.text+0x8f): undefined reference to
`std::_Winit::~_Winit
[in-charge]()'
/usr/tmp/cct8tLwS.o: In function `std::basic_ios<char,
std::char_traits<char>
::clear(std::_Iosb<int>::_Iostate, bool)':

/usr/tmp/cct8tLwS.o(.gnu.linkonce.t._ZNSt9basic_iosIcSt11ch ar_traitsIcEE5clearENSt5_IosbIiE8_IostateEb+0x3c):
undefined reference to `std::ios_base::clear(std::_Iosb<int>::_Iostate,
bool)'
/usr/tmp/cct8tLwS.o: In function `std::ctype<char> const&
std::use_facet<std::ctype<char> >(std::locale const&)':
/usr/tmp/cct8tLwS.o(.gnu.linkonce.t._ZSt9use_facetISt5ctype IcEERKT_RKSt6locale+0x3f):
undefined reference to `std::locale::_Getfacet(unsigned) const'
/usr/tmp/cct8tLwS.o(.gnu.linkonce.t._ZSt9use_facetISt5ctype IcEERKT_RKSt6locale+0xee):
undefined reference to `std::locale::facet::_Register()'
/usr/tmp/cct8tLwS.o: In function `std::locale::id::operator unsigned()':
/usr/tmp/cct8tLwS.o(.gnu.linkonce.t._ZNSt6locale2idcvjEv+0x 2e): undefined
reference to `std::locale::id::_Id_cnt'
/usr/tmp/cct8tLwS.o(.gnu.linkonce.t._ZNSt6locale2idcvjEv+0x 33): undefined
reference to `std::locale::id::_Id_cnt'
/usr/tmp/cct8tLwS.o: In function `std::ctype<char>::ctype[in-charge](short
const*, bool, unsigned)':
/usr/tmp/cct8tLwS.o(.gnu.linkonce.t._ZNSt5ctypeIcEC1EPKsbj+ 0x37): undefined
reference to `std::_Locinfo::_Locinfo[in-charge](char const*)'
/usr/tmp/cct8tLwS.o(.gnu.linkonce.t._ZNSt5ctypeIcEC1EPKsbj+ 0x5c): undefined
reference to `std::_Locinfo::~_Locinfo [in-charge]()'
/usr/tmp/cct8tLwS.o(.gnu.linkonce.t._ZNSt5ctypeIcEC1EPKsbj+ 0x6c): undefined
reference to `std::_Locinfo::~_Locinfo [in-charge]()'
collect2: ld returned 1 exit status

Jul 22 '05 #1
13 3315
Try without std::

"david" <d.*******@callassoftware.com> wrote in message
news:br**********@news1.transmedia.de...
Hi,

I have some problems to link a simple hello world program using
g++ (version 3.2.3 or 3.3) and dinkumware 402.

//hallo world...
#include <iostream>
main () {
std::cout << "bla" << std::endl;
}

// the linking is something of that kind...
g++ -I./dinkumware_co/include ./libgcc_v3.2_c99_standard.a test.cpp

then I get:

/usr/tmp/cct8tLwS.o: In function
`__static_initialization_and_destruction_0(int, int)':
/usr/tmp/cct8tLwS.o(.text+0x74): undefined reference to
`std::_Winit::_Winit[in-charge]()'
/usr/tmp/cct8tLwS.o(.text+0x8f): undefined reference to
`std::_Winit::~_Winit
[in-charge]()'
/usr/tmp/cct8tLwS.o: In function `std::basic_ios<char,
std::char_traits<char>
::clear(std::_Iosb<int>::_Iostate, bool)':

/usr/tmp/cct8tLwS.o(.gnu.linkonce.t._ZNSt9basic_iosIcSt11ch ar_traitsIcEE5cle
arENSt5_IosbIiE8_IostateEb+0x3c): undefined reference to `std::ios_base::clear(std::_Iosb<int>::_Iostate,
bool)'
/usr/tmp/cct8tLwS.o: In function `std::ctype<char> const&
std::use_facet<std::ctype<char> >(std::locale const&)':
/usr/tmp/cct8tLwS.o(.gnu.linkonce.t._ZSt9use_facetISt5ctype IcEERKT_RKSt6loca
le+0x3f): undefined reference to `std::locale::_Getfacet(unsigned) const'
/usr/tmp/cct8tLwS.o(.gnu.linkonce.t._ZSt9use_facetISt5ctype IcEERKT_RKSt6loca
le+0xee): undefined reference to `std::locale::facet::_Register()'
/usr/tmp/cct8tLwS.o: In function `std::locale::id::operator unsigned()':
/usr/tmp/cct8tLwS.o(.gnu.linkonce.t._ZNSt6locale2idcvjEv+0x 2e): undefined
reference to `std::locale::id::_Id_cnt'
/usr/tmp/cct8tLwS.o(.gnu.linkonce.t._ZNSt6locale2idcvjEv+0x 33): undefined
reference to `std::locale::id::_Id_cnt'
/usr/tmp/cct8tLwS.o: In function `std::ctype<char>::ctype[in-charge](short
const*, bool, unsigned)':
/usr/tmp/cct8tLwS.o(.gnu.linkonce.t._ZNSt5ctypeIcEC1EPKsbj+ 0x37): undefined reference to `std::_Locinfo::_Locinfo[in-charge](char const*)'
/usr/tmp/cct8tLwS.o(.gnu.linkonce.t._ZNSt5ctypeIcEC1EPKsbj+ 0x5c): undefined reference to `std::_Locinfo::~_Locinfo [in-charge]()'
/usr/tmp/cct8tLwS.o(.gnu.linkonce.t._ZNSt5ctypeIcEC1EPKsbj+ 0x6c): undefined reference to `std::_Locinfo::~_Locinfo [in-charge]()'
collect2: ld returned 1 exit status

Jul 22 '05 #2

Igor Malner wrote:
Try without std::

Hi

sorry this does not solve the Problem. I still have the same undefined
references!

I then have to add the line after the std include:

using namespace std;

Important:
If the include path is not pointing to the correct path of the dinkumware
library, then it "works" - at least it seems so in the first view - , but
then it is linked with the libstdc++ distributed by g++, and not with the
dinkumware library!
David

Jul 22 '05 #3
david wrote:
Hi,

I have some problems to link a simple hello world program using
g++ (version 3.2.3 or 3.3) and dinkumware 402.

//hallo world...
#include <iostream>
main () {
std::cout << "bla" << std::endl;
}


I'm guessing it chokes on the fact that the main() you have defined is not
actually a function definition. Try this:

#include <iostream>
int main() {
std::cout << "bla" << std::endl;
return 0;
}

NOTE: int is the *only* valid return type for main(). void main() is not,
never has been, and never will be, valid C++. For main() without return type
it's the same story. Afaik, the only functions that you can (must, even)
declare without return type are constructors and destructors.

--
Unforgiven
Jul 22 '05 #4
Unforgiven wrote:
david wrote:
Hi,

I have some problems to link a simple hello world program using
g++ (version 3.2.3 or 3.3) and dinkumware 402.

//hallo world...
#include <iostream>
main () {
std::cout << "bla" << std::endl;
}


I'm guessing it chokes on the fact that the main() you have defined is not
actually a function definition. Try this:

#include <iostream>
int main() {
std::cout << "bla" << std::endl;
return 0;
}

NOTE: int is the *only* valid return type for main(). void main() is not,
never has been, and never will be, valid C++. For main() without return
type it's the same story. Afaik, the only functions that you can (must,
even) declare without return type are constructors and destructors.

You are right but
I did not write "void main()" but just
"main ()" which implicit means "int main ()"

This does not solve it , but thanks anyway.


Jul 22 '05 #5
david wrote:
This does not solve it , but thanks anyway.


Your problem is very likely not standard-related then. You'd have better
luck posting your question in a group where gcc/dinkumware is topical.

--
Unforgiven
Jul 22 '05 #6
On Mon, 08 Dec 2003 19:31:23 +0000, david
<d.*******@callassoftware.com> wrote:
You are right but
I did not write "void main()" but just
"main ()" which implicit means "int main ()"


Only in C. C++ has never had "implicit int". Some compilers accept it
as an extension.

Tom

C++ FAQ: http://www.parashift.com/c++-faq-lite/
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
Jul 22 '05 #7

"david" <d.*******@callassoftware.com> wrote in message news:br**********@news1.transmedia.de...
I did not write "void main()" but just
"main ()" which implicit means "int main ()"

Nope. There is no implicit function return type. Your program is ill-formed.
Jul 22 '05 #8

"tom_usenet" <to********@hotmail.com> wrote in message news:94********************************@4ax.com...
On Mon, 08 Dec 2003 19:31:23 +0000, david
<d.*******@callassoftware.com> wrote:
You are right but
I did not write "void main()" but just
"main ()" which implicit means "int main ()"


Only in C. C++ has never had "implicit int". Some compilers accept it
as an extension.


It's not even the case in C anymore.
Jul 22 '05 #9
"david" <d.*******@callassoftware.com> wrote in message
news:br**********@news1.transmedia.de...
I have some problems to link a simple hello world program using
g++ (version 3.2.3 or 3.3) and dinkumware 402.

//hallo world...
#include <iostream>
main () {
std::cout << "bla" << std::endl;
}

// the linking is something of that kind...
g++ -I./dinkumware_co/include ./libgcc_v3.2_c99_standard.a test.cpp

then I get:

/usr/tmp/cct8tLwS.o: In function
`__static_initialization_and_destruction_0(int, int)':
/usr/tmp/cct8tLwS.o(.text+0x74): undefined reference to
`std::_Winit::_Winit[in-charge]()'
.....


If you were to read the readme.txt file that accompanies the
library, you would see that the setup/Gcc script generates
Link* and Compile* scripts with all the necessary command
line arguments. You should at least read those scripts before
essaying your own command lines. In particular, the command

../dinkumware_co/Linkx test.cpp

should work just fine.

P.J. Plauger
Dinkumware, Ltd.
http://www.dinkumware.com
Jul 22 '05 #10
P.J. Plauger wrote:
"david" <d.*******@callassoftware.com> wrote in message
news:br**********@news1.transmedia.de...
...
If you were to read the readme.txt file that accompanies the
library, you would see that the setup/Gcc script generates
Link* and Compile* scripts with all the necessary command
line arguments. You should at least read those scripts before
essaying your own command lines. In particular, the command

./dinkumware_co/Linkx test.cpp

should work just fine.


Yes indeed! Thank you!


P.J. Plauger
Dinkumware, Ltd.
http://www.dinkumware.com


Jul 22 '05 #11
david <d.*******@callassoftware.com> writes:
I have some problems to link a simple hello world program using
g++ (version 3.2.3 or 3.3) and dinkumware 402.


Purely out of interest, why would I want (or need) to use the
Dinkumware library over the GNU libstdc++ that comes with GCC?
--
Roger Leigh

Printing on GNU/Linux? http://gimp-print.sourceforge.net/
GPG Public Key: 0x25BFB848. Please sign and encrypt your mail.
Jul 22 '05 #12
Roger Leigh <${******@invalid.whinlatter.uklinux.net.invalid > wrote:
david <d.*******@callassoftware.com> writes:
I have some problems to link a simple hello world program using
g++ (version 3.2.3 or 3.3) and dinkumware 402.


Purely out of interest, why would I want (or need) to use the
Dinkumware library over the GNU libstdc++ that comes with GCC?

Because Coemau/Dinkumware is considered to
be the most std conformant? Because the
Dinkumware lib is used on another platform
already and this makes porting easier?

Schobi

--
Sp******@gmx.de is never read
I'm Schobi at suespammers dot org

"Sometimes compilers are so much more reasonable than people."
Scott Meyers
Jul 22 '05 #13
"Hendrik Schober" <Sp******@gmx.de> writes:
Roger Leigh <${******@invalid.whinlatter.uklinux.net.invalid > wrote:
david <d.*******@callassoftware.com> writes:
> I have some problems to link a simple hello world program using
> g++ (version 3.2.3 or 3.3) and dinkumware 402.


Purely out of interest, why would I want (or need) to use the
Dinkumware library over the GNU libstdc++ that comes with GCC?

Because Coemau/Dinkumware is considered to
be the most std conformant? Because the
Dinkumware lib is used on another platform
already and this makes porting easier?


I don't mean to be facetious, but surely using *both* will make
(future) porting easier--since you will eliminate any dependency on
any non-standard extensions in either library.
--
Roger Leigh

Printing on GNU/Linux? http://gimp-print.sourceforge.net/
GPG Public Key: 0x25BFB848. Please sign and encrypt your mail.
Jul 22 '05 #14

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Joonas Paalasmaa | last post by:
Hi, When compiling Sketch's streamfilter C extension the errors below are raised during linking. What could cause the errors? (Python 2.3, MinGw 1.1 with GCC 2.95.3-6, Windows 98) Here are...
1
by: Brian J. Ackermann | last post by:
Hi everybody, I'm new to c++, and I'm working on this simple little application, which ought to compile just fine, but I'm missing something. The program has 4 file, 2 headers, and 2 cpp files....
1
by: Venky | last post by:
I'm compiling a C program that is using Interbase 6.0 APIS. Getting the following errors at the time of linking. Linking test.exe: Linker Warning: No module definition file specified: using...
2
by: Terry Lee Tucker | last post by:
Let me explain: I have written a "C" function which contains calls to other functions, all of which work with an API to a mileage database product called PCMiler. These functions make...
3
by: walkeraj | last post by:
I'm trying to compile an open source game called IVAN , and I'm able to compile it from a makefile, but not from an IDE. I have attempted to recreate the way the makefile compiles the project as...
2
by: Manuel T | last post by:
Hello everybody, I'm trying to port a project from Windows+Cygwin to Linux(i'm working on a Debian-like: Kubuntu), but I'm facing a lot of linking problems. This project needs libraries xerces...
13
by: 7stud | last post by:
test1.py: -------------------- import shelve s = shelve.open("/Users/me/2testing/dir1/aaa.txt") s = "red" s.close() --------output:------ $ python test1.py
2
by: pssraju | last post by:
Hi, At present application was built on solaris 9 using sun studio 9 (Sun C++ 5.6) & rouguewave sorce pro 5. We are planning to port the same application onto SuSE Linux 9.5.0 using GCC 3.3.3 & RW...
0
by: cresloga | last post by:
im trying a simple C program to create table in db2 database named sample. the 1st 4 steps are fine....precompile,bind,compilation are fine. but im getting the following error wen i try to link ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.