paragui-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [paragui-users] pg 1.0.4 patches (Mac OS X)


From: Ulf Lorenz
Subject: Re: [paragui-users] pg 1.0.4 patches (Mac OS X)
Date: Thu, 28 Aug 2003 23:21:17 +0200
User-agent: Mutt/1.4i

On Wed, Aug 20, 2003 at 10:41:58AM +0300, Asko Kauppi wrote:
> 
> Needed to make two modifications to ParaGui 1.0.4 sources, in order to 
> make it compile on OS X.
> I'm not using the regular auto* tools, but my own building engine.
> 
> If anyone knows, which compiler flags etc. could be used to make these 
> changes unnecessary, please tell. AFIK it's a matter of some gcc (or 
> library) bugs of some kind.
> 
> My OS X is 10.2.6 and gcc is:
>       Apple Computer, Inc. GCC version 1151, based on gcc version 3.1 
> 20020420 (prerelease)
> 
> Here goes:
> 
> (pglog.cpp):
>       PG_LogMessage_t(PG_LOG_LEVEL _id, const char* txt)
> //            : Id(_id), TimeStamp(time(0)) {Text = txt;}
>               : Id(_id), TimeStamp(time(0)), Text(txt) { }  //AKP(20-Aug-03)
> 
> The assign() method of 'basic_string' gets "multiple definitions" 
> otherwise.. weird?
> 
>       ld: multiple definitions of symbol std::basic_string<char, 
> std::char_traits<char>,       std::allocator<char> >::assign(char const*, 
> unsigned long)
>       temp/darwin/pglog.os definition of std::basic_string<char, 
> std::char_traits<char>,       std::allocator<char> >::assign(char const*, 
> unsigned long) in section (__TEXT,__text)
>       /usr/lib/gcc/darwin/3.1/libstdc++.a(string-inst.o) private external 
> definition of         std::basic_string<char, std::char_traits<char>, 
> std::allocator<char> >::assign(char const*, unsigned long) in section 
> (__TEXT,__text)
>       /usr/bin/libtool: internal link edit command failed
And if you change the code like above it works ???
My knowledges are a bit limited, but would the following scenario be possible?
AFAIK, normally STL is a header library. However, some (all?) implementations
place parts of the code in a shared library. Now imagine you have two
implementations, one which has std::string::assign() in a header and one which
places the code itsef in a lib. The compiler won't complain, but the linker
suddenly finds two instances of std::string::assign(); the one from the
header, which has been compiled together with pglog.cpp and the other one in
the shared lib. 


> 
> 
> (stretch.cpp):
> /*inline*/ double B_spline_filter(double t)   /* box (*) box (*) box (*) 
> box */
> 
> Otherwise i get this:
> 
>       ld: common symbols not allowed with MH_DYLIB output format
>       temp/darwin/stretch.os definition of common 
>       _ZZ15B_spline_filterdE2tt (size 8)
>       /usr/bin/libtool: internal link edit command failed
And this affects only this single function?

Ulf

-- 
'Oh, I never play to win.' She smiled. 'But I do play not to lose.'
(Interesting Times)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]