473,657 Members | 2,479 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

what does compiler error mean?

Hi all,

I got following error when compiling a rogram:
prelink: ERROR: operator <<<T1, T2, T3>(ostream &, const
basic_string<T1 , T2, T3&) [with T1=char, T2=char_traits< char>,
T3=allocator<ch ar>, return type=ostream &] assigned to a.o and b.o
prelink: ERROR: bad instantiation request file -- instantiation
assigned to more than one file
UX:CC: ERROR: Pre-linker failed

In both places, I use cout as ostream, not sure why it happen. I build
with make clean, it disappeared. But I change one component, e.g., a.C,
then when linking, I got the error.
thx

Oct 3 '06 #1
4 2872
we*****@yahoo.c om posted:
Hi all,

I got following error when compiling a rogram:
prelink: ERROR: operator <<<T1, T2, T3>(ostream &, const
basic_string<T1 , T2, T3&) [with T1=char, T2=char_traits< char>,
T3=allocator<ch ar>, return type=ostream &] assigned to a.o and b.o
prelink: ERROR: bad instantiation request file -- instantiation
assigned to more than one file
UX:CC: ERROR: Pre-linker failed

In both places, I use cout as ostream, not sure why it happen. I build
with make clean, it disappeared. But I change one component, e.g., a.C,
then when linking, I got the error.

Might I suggest you post a small sample of code which produces the same
error.

--

Frederick Gotham
Oct 3 '06 #2
I hope I can. But 2 components each has 1000 lines of code, it is hard.
Frederick Gotham wrote:
we*****@yahoo.c om posted:
Hi all,

I got following error when compiling a rogram:
prelink: ERROR: operator <<<T1, T2, T3>(ostream &, const
basic_string<T1 , T2, T3&) [with T1=char, T2=char_traits< char>,
T3=allocator<ch ar>, return type=ostream &] assigned to a.o and b.o
prelink: ERROR: bad instantiation request file -- instantiation
assigned to more than one file
UX:CC: ERROR: Pre-linker failed

In both places, I use cout as ostream, not sure why it happen. I build
with make clean, it disappeared. But I change one component, e.g., a.C,
then when linking, I got the error.


Might I suggest you post a small sample of code which produces the same
error.

--

Frederick Gotham
Oct 3 '06 #3
I need suggestion where I should look for. Why "make clean" can sovle
the problem, while it will not work if not "make clean", do I have
build env issue? or something funny here?

Oct 3 '06 #4

we*****@yahoo.c om wrote in message
<11************ **********@h48g 2000cwc.googleg roups.com>...
>I need suggestion where I should look for. Why "make clean" can sovle
the problem, while it will not work if not "make clean", do I have
build env issue? or something funny here?
[OT]

Let's say you have three files in your project - A.h, A.cpp, Main.cpp:
[assume you are using an IDE that runs 'make' on a makefile.]

// A.h
int SomeFunc();

// A.cpp
int SomeFunc(){ return 50000 * 60000; }

// Main.cpp
#include A.h

int main(){
int Anumber = SomeFunc();
return 0;
}

Assume it compiles and runs.
Now you decide that SomeFunc() should return an long instead of an int, so
you change it:

// A.h
long SomeFunc();

// A.cpp
long SomeFunc(){ return 50000 * 60000; }

....and compile the project again. It compiles, but won't 'build'. What
happened?

The first time it took A.cpp and Main.cpp and produced A.o (or A.obj) and
Main.o and then 'linked' the two together to 'Main' (or 'Main.exe').
Then you changed A.cpp, and tried to build it. The 'make' re-built A.o, but
noticed that Main.cpp and Main.o had the SAME time/date, so, it did NOT
rebuild it! Then the 'linker' tried to match the 'int' call to SomeFunc()
[which now returns an long]. The linker pukes!!

Doing 'make clean' deletes ALL the *.o files so that ALL files are rebuilt
and linked.

MY explaination may not be correct or complete; but I hope it showed enough
for you to see why 'make clean' is needed (in this case, the compiler would
quit at the long to int problem, and never make it to the link stage.).

Does that clear up anything for you?
Since the subject is Off Topic in this NG, we can't discuss it much further,
you'll have to read your docs or ask in an NG specific to your
compiler/make/linker.

[/OT]

--
Bob R
POVrookie
Oct 4 '06 #5

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

Similar topics

72
5833
by: E. Robert Tisdale | last post by:
What makes a good C/C++ programmer? Would you be surprised if I told you that it has almost nothing to do with your knowledge of C or C++? There isn't much difference in productivity, for example, between a C/C++ programmers with a few weeks of experience and a C/C++ programmer with years of experience. You don't really need to understand the subtle details or use the obscure features of either language
121
10025
by: typingcat | last post by:
First of all, I'm an Asian and I need to input Japanese, Korean and so on. I've tried many PHP IDEs today, but almost non of them supported Unicode (UTF-8) file. I've found that the only Unicode support IDEs are DreamWeaver 8 and Zend PHP Studio. DreamWeaver provides full support for Unicode. However, DreamWeaver is a web editor rather than a PHP IDE. It only supports basic IntelliSense (or code completion) and doesn't have anything...
24
2949
by: Romeo Colacitti | last post by:
Hi, Does anyone here have a strong understanding for the meanings of the terms "lvalue" and "rvalue" as it pertains to C, objects, and different contexts? If so please share. I've been reading several old posts/threads on the subject, and they never end with a conclusion (people keep correcting each other and disagreeing).
13
5035
by: Jason Huang | last post by:
Hi, Would someone explain the following coding more detail for me? What's the ( ) for? CurrentText = (TextBox)e.Item.Cells.Controls; Thanks. Jason
2
2422
by: hsharsha | last post by:
Consider the below code: int main(void) { class inner {}; friend class inner; /* what does this signify???? */ return 0; }
669
25860
by: Xah Lee | last post by:
in March, i posted a essay “What is Expressiveness in a Computer Language”, archived at: http://xahlee.org/perl-python/what_is_expresiveness.html I was informed then that there is a academic paper written on this subject. On the Expressive Power of Programming Languages, by Matthias Felleisen, 1990. http://www.ccs.neu.edu/home/cobbe/pl-seminar-jr/notes/2003-sep-26/expressive-slides.pdf
4
4745
by: huguogang | last post by:
Just curious, any one know what the 3 part parameter "class CString filename" would mean. The code: int TestFunc(class CString filename) { fopen(filename, "w"); } Compile using Visaul C++, there is no complain about the defintion. But
13
520
by: Protoman | last post by:
I'm getting an error: 10 C:\Dev-Cpp\Enigma.cpp no match for 'operator<' in 'i < (+cleartext)->std::basic_string<_CharT, _Traits, _Alloc>::end ()' Code: Enigma.hpp -------------------------- #pragma once
4
6682
by: grizggg | last post by:
I have searched and not found an answer to this question. I ran upon the following statement in a *.cpp file in a member function: static const char * const pacz_HTMLContentTypeHeader = "Content-Type: text/html\r\n"; Why is the second const needed and what does it do? Thanks
32
2714
by: Stephen Horne | last post by:
I've been using Visual C++ 2003 for some time, and recently started working on making my code compile in GCC and MinGW. I hit on lots of unexpected problems which boil down to the same template issue. A noddy mixin layer example should illustrate the issue... class Base { protected: int m_Field;
0
8421
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
8325
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8742
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8621
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6177
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2743
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1971
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1734
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.