public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* 4301:test: /sbin/loader: Warning: Can't find strong symbol for _XXXXX
@ 2002-11-03 22:57 tom jun
  0 siblings, 0 replies; only message in thread
From: tom jun @ 2002-11-03 22:57 UTC (permalink / raw)
  To: gcc-help

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=gb2312, Size: 2619 bytes --]

Hi,
   I encountered a trouble while I build my c++ code
with gcc.3.0.2 in Tru64 V4.
There had not gcc compiler in the alpha computer
before I installed it by using a 
binary package gcc-3.0.2.setld.tar.Z downloaded from
ftp.thewrittenword.com.
   My c++ code had been compiled and linked to a
progrm by gcc.2.95.3 in Solaris8 
for intel. Now, when I compile the code in Tru64, some
warnings will appeare such 
as following:
./obj/test.o: std::ostream::write(char const*, long):
weak symbol multiply defined
./obj/test.o: std::basic_ios<char,
std::char_traits<char> >::setstate std::_Ios_Iostate):
weak symbol multiply defined
......
Subsequently, while running the program, there will
also appear so many warning 
such as following:
4301:test: /sbin/loader: Warning: Can't find strong
symbol for _ZTIt
4301:test: /sbin/loader: Warning: Can't find strong
symbol for _ZTSPKs
4301:test: /sbin/loader: Warning: Can't find strong
symbol for _ZTSPs
4301:test: /sbin/loader: Warning: Can't find strong
symbol for _ZTSs
4301:test: /sbin/loader: Warning: Can't find strong
symbol for _ZTIs
......
Finally, the correct result of progam is obtained.
I know that the first kind of warning may be cleaned
by add a compile flag 
-fno-weak. But I fail to clear the second  kind of
warning, and as we know, 
it is the more important.

Any thoughts about?
Thanks,
Tomjun.

The following are the relational codes:
1, test.cpp

#include <iostream>
#include "sparseM.h"
#include <vector>
#include <utility>
int main(void)
{
	dataT<int> one(1,1,9);
	sparseM<dataT<int> > oneM(2,2);
	oneM.addElement(one);
	dataT<int> *temp=oneM.getElement(1,1);
	if(temp==NULL)
		cout<<"0"<<endl;
	else
		cout<<temp->element<<endl;
	
	cout<<"This is a test program for fork"<<endl;
	return 1;
}
2, sparseM.h

#ifndef __SPARSEM_H__
#define __SPARSEM_H__
#include <iostream.h>
#include <fstream.h>
#include <string>
#include <cassert>
using namespace std;

template <class Type>
class dataT{
...
};
template <class T>
class sparseM{
...
};
// the template class implemental code
#endif
3, Makefile

CC   = alpha-dec-osf4.0d-g++
RES  = 
OBJ  = test.o  $(RES)
LIBS =  -L/opt/TWWfsw/gcc302/lib -L/usr/lib
INCS =  -I"/usr/opt/TWWfsw/gcc302/include/g++-v3" 
-I/usr/include
BIN  = test
CFLAGS = $(INCS) -fno-weak
.PHONY: all  clean 
all: test
clean: 
	rm -f $(OBJ) 
$(BIN): $(OBJ) 
	$(CC) $(OBJ) -o "test" $(LIBS) $(CFLAGS)
test.o: test.cpp
	$(CC) -c test.cpp -o test.o $(CFLAGS)





_________________________________________________________
Do You Yahoo!? 
"ÊÇIT¾«Ó¢Âð£¿Ð¡ÊÔÅ£µ¶»ñʱÉд󽱣¡"
http://cn.promo.yahoo.com/cgi-bin/udb/u

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-11-04  6:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-03 22:57 4301:test: /sbin/loader: Warning: Can't find strong symbol for _XXXXX tom jun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).