473,325 Members | 2,860 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,325 software developers and data experts.

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<char>, 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 2857
we*****@yahoo.com 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<char>, 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.com 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<char>, 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.com wrote in message
<11**********************@h48g2000cwc.googlegroups .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
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...
121
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...
24
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...
13
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
by: hsharsha | last post by:
Consider the below code: int main(void) { class inner {}; friend class inner; /* what does this signify???? */ return 0; }
669
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...
4
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++,...
13
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...
4
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 =...
32
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...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
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
1
by: Shllpp 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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.