Hello,
While compiling a file, I get following error ....
=============== =============== ===
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.3/include/g++/type_traits.h:1 4
2: redefinition of `struct __type_traits<s hort int>'
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.3/include/g++/type_traits.h:1 0
2: previous definition here
=============== =============== ===
If I open file
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.3/include/g++/type_traits.h,
the source code looks like below,
=============== =============== ===
94 #ifndef __STL_NO_BOOL
95
96 __STL_TEMPLATE_ NULL struct __type_traits<b ool> {
97 typedef __true_type has_trivial_def ault_constructo r;
98 typedef __true_type has_trivial_cop y_constructor;
99 typedef __true_type has_trivial_ass ignment_operato r;
100 typedef __true_type has_trivial_des tructor;
101 typedef __true_type is_POD_type;
102 };
103
104 #endif /* __STL_NO_BOOL */
....
<snip>
....
142 __STL_TEMPLATE_ NULL struct __type_traits<s hort> {
143 typedef __true_type has_trivial_def ault_constructo r;
144 typedef __true_type has_trivial_cop y_constructor;
145 typedef __true_type has_trivial_ass ignment_operato r;
146 typedef __true_type has_trivial_des tructor;
147 typedef __true_type is_POD_type;
148 };
=============== =============== ===
The macro __STL_NO_BOOL is NOT defined in my environment.
If I pass the file through the precompiler (using command gcc -E <file name,
inc paths etc.>), output shows above two templates as .....
=============== =============== ===
template<> struct __type_traits< short > {
typedef __true_type has_trivial_def ault_constructo r;
typedef __true_type has_trivial_cop y_constructor;
typedef __true_type has_trivial_ass ignment_operato r;
typedef __true_type has_trivial_des tructor;
typedef __true_type is_POD_type;
};
....
<snip>
....
template<> struct __type_traits<s hort> {
typedef __true_type has_trivial_def ault_constructo r;
typedef __true_type has_trivial_cop y_constructor;
typedef __true_type has_trivial_ass ignment_operato r;
typedef __true_type has_trivial_des tructor;
typedef __true_type is_POD_type;
};
=============== =============== ===
These two templates are causing the redefinition problem and it is clear
that keyword "bool" is being resolved as "short".
I am using GCC 2.95.3 on RedHat 8.0 on Intel PIII.
- Can anyone give any directions regarding what could cause this problem?
- Secondly, though in my opinion bool is being resolved as short, the error
flagged by compiler says "redefiniti on of `struct __type_traits<s hort
int>'". As a result, I am not sure if what I think is incorrect or "short"
is same as "short int"?
Thanks,
Loma 5 5005
lomat wrote: I am using GCC 2.95.3 on RedHat 8.0 on Intel PIII.
- Can anyone give any directions regarding what could cause this problem?
Get a later version of the compiler. The latest (and best) version is
gcc 3.3.1 and is significantly better than 2.9x .
lomat wrote: These two templates are causing the redefinition problem and it is clear that keyword "bool" is being resolved as "short".
I am using GCC 2.95.3 on RedHat 8.0 on Intel PIII.
- Can anyone give any directions regarding what could cause this problem?
Look for a header, included before that with "#define bool short".
--
Attila aka WW
"Gianni Mariani" <gi*******@mari ani.ws> wrote in message
news:bk******** @dispatch.conce ntric.net... lomat wrote:
I am using GCC 2.95.3 on RedHat 8.0 on Intel PIII.
- Can anyone give any directions regarding what could cause this
problem? Get a later version of the compiler. The latest (and best) version is gcc 3.3.1 and is significantly better than 2.9x .
Thanks Gianni
I can't use the latest GCC version 3.3, as the name mangling sheme it uses
is different from the 2.95.x scheme.
I tried using 3.3 but then I get zillions of linkage errors as the symbols
from the libraries I use (which are built using 2.95.x) can't be resolved.
The libraries that I use are non-open source (third party) and I can't build
them using 3.3 as I don't have shource.
As a result, I must use 2.95.x. Any suggestions?
lomat wrote: "Gianni Mariani" <gi*******@mari ani.ws> wrote in message news:bk******** @dispatch.conce ntric.net...
lomat wrote:
I am using GCC 2.95.3 on RedHat 8.0 on Intel PIII.
- Can anyone give any directions regarding what could cause this
problem?
Get a later version of the compiler. The latest (and best) version is gcc 3.3.1 and is significantly better than 2.9x .
Thanks Gianni
I can't use the latest GCC version 3.3, as the name mangling sheme it uses is different from the 2.95.x scheme. I tried using 3.3 but then I get zillions of linkage errors as the symbols from the libraries I use (which are built using 2.95.x) can't be resolved. The libraries that I use are non-open source (third party) and I can't build them using 3.3 as I don't have shource. As a result, I must use 2.95.x. Any suggestions?
No easy ones.
a) Time to go back to the supplier and get 3.3.1 binaries ?
b) Stick to a subset of C++ that 2.95.x is happy with.
c) Get the functionality from a different source that supplies 3.3.1
binaries.
On Mon, 22 Sep 2003 21:05:23 +0530, "lomat" <at****@ideas.c om> wrote: "Gianni Mariani" <gi*******@mari ani.ws> wrote in message news:bk******* *@dispatch.conc entric.net... lomat wrote:
> > I am using GCC 2.95.3 on RedHat 8.0 on Intel PIII. > > - Can anyone give any directions regarding what could cause this problem? Get a later version of the compiler. The latest (and best) version is gcc 3.3.1 and is significantly better than 2.9x .
Thanks Gianni
I can't use the latest GCC version 3.3, as the name mangling sheme it uses is different from the 2.95.x scheme. I tried using 3.3 but then I get zillions of linkage errors as the symbols from the libraries I use (which are built using 2.95.x) can't be resolved. The libraries that I use are non-open source (third party) and I can't build them using 3.3 as I don't have shource. As a result, I must use 2.95.x. Any suggestions?
Try adding
#define __STL_NO_BOOL 1
to your project defines.
Tom This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Massimiliano Alberti |
last post by:
Can I specialize a template function in a subclass without overriding
it? (the main template function is defined in a base class).
Now I'm doing something like that:
(in base class)
template<class X>
void myfunc(X par1) { }
(in derived class)
template<class X>
|
by: Robbie Hatley |
last post by:
I'd always thougth that a C++ compiler/linker should be able to
instantiate a template in mulitple places (say, in two different
translation units), even using the same template parameters so
that the resulting functions or classes are identical, without
causing any errors. Or so I thought.
But a few days ago, I added a couple of new template functions
to one of my personal library modules, and I got this linker
error message (from...
|
by: Robbie Hatley |
last post by:
I asked about this yesterday, but no one bit. So I'll ask
again. I can be a persistant cuss. :-)
I ran into a problem a few days ago when I added a couple of
template functions to one of my personal library headers.
My library, librh.a, has these objects:
rhutil.o rhdir.o rhmath.o rhbitmap.o
and matching headers:
rhutil.h rhdir.h rhmath.h rhbitmap.h
|
by: Robbie Hatley |
last post by:
"Victor Bazarov" <v.Abazarov@comAcast.net> wrote:
> Robbie Hatley wrote:
> >
> > I ran into a problem a few days ago when I added a couple of
> > template functions to one of my personal library headers.
> >
> > My library, librh.a
>
> Linking is not defined by C++ .
|
by: Alex |
last post by:
Hello all,
I have a very stupid problem that is driving me crazy...so plz if
anyone ever saw this, I would like him to help me :)
I have static MFC application in MSVC++ 6.0 (named Example). That
application is built by one company and its usage is to show
functionality of their static libraries.
Now I created dynamic link library CoreLibrary and I want to integrate
it into this example. CoreLibrary worked properly with win32...
| |
by: anto.anish |
last post by:
Hi ,
Since, i did not want to write all instantiations in Source file of
all template methods for various different datatypes that my client
might use, Instead, i choose to write implementation of template
methods along with their declarations in the header file. Well, there
are also other files in the project, which include this header file as
well, which all gets compiled, linked and tested well.
#ifndef __ATT_H__
|
by: anto.anish |
last post by:
Hi ,
Since, i did not want to write instantiations in Source file of all
template methods for various different datatypes that my client might
use, i choose to write implementation of template methods along with
their declarations in the header file. Well, there are also other
files in the project, which include this header file as well, which
all gets compiled, linked and tested well.
#ifndef __ATT_H__
|
by: anto.anish |
last post by:
Hi ,
Since, i did not want to write explicit instantiations in Source file
of all template methods for various different datatypes that my client
might use, i choose to write implementation of template methods along
with their declarations in the header file. Well, there are also other
files in the project, which include this header file as well, which
all gets compiled, linked and tested well.
#ifndef __ATT_H__
|
by: Ioannis Gyftos |
last post by:
Hello,
First the code :)
///////////////////////////////////////////////////////////////////////////////////
// in another header file
namespace LJC{
|
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,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
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...
|
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...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
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...
| |
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...
| |