473,387 Members | 1,785 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,387 software developers and data experts.

template troubles

Hi,
When porting application to linux we get
compilation errors (undefined variable p in function GetValue())
from gcc 3.4.1 but it compiles well on windows with msvc 7.1
what is problem here ?

template<class Tclass A
{
public:
T p;
};

template<class Tclass B : public A<T>
{
public:
T GetValue() const {return p;}
};
Jul 19 '06 #1
2 1074
Nikolay Moskvichev wrote:
When porting application to linux we get
compilation errors (undefined variable p in function GetValue())
from gcc 3.4.1 but it compiles well on windows with msvc 7.1
what is problem here ?

template<class Tclass A
{
public:
T p;
};

template<class Tclass B : public A<T>
{
public:
T GetValue() const {return p;}
};
See this FAQ:

http://parashift.com/c++-faq-lite/te...html#faq-35.18

Cheers! --M

Jul 19 '06 #2
Nikolay Moskvichev schrieb:
Hi,
When porting application to linux we get
compilation errors (undefined variable p in function GetValue())
from gcc 3.4.1 but it compiles well on windows with msvc 7.1
what is problem here ?

template<class Tclass A
{
public:
T p;
};

template<class Tclass B : public A<T>
{
public:
T GetValue() const {return p;}
};
Look here:

http://www.parashift.com/c++-faq-lit...html#faq-35.18

/S
--
Stefan Naewe
naewe.s_AT_atlas_DOT_de
Jul 19 '06 #3

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

Similar topics

0
by: lmckaha | last post by:
Hi, Mysql version: 3.23.49 Solaris version: 2.7 gcc compiler version: 2.95.2 Python : 2.2.2 I'm evaluating the C and C++ API to decide which one to bye but I have many troubles.
12
by: Steven T. Hatton | last post by:
In the following code, the class B will not compile if the function da is uncommented. I took exactly the same code, and turned it into templates. Never used the template parameter in anything but...
7
by: Thomas Lorenz | last post by:
Hello, a standard template singleton looks basically like this: template<class T> class Singleton1 { private: Singleton1(); static Singleton1* m_Instance; public:
18
by: Erik Arner | last post by:
Hi, I really need some help here. After upgrading to g++ 3.4 I have run into all sorts of troubles that I'm sure depends on my lack of proper understanding of C++. I would now like to get it right...
13
by: Atlas | last post by:
Hi, I implemented a template as: template <int L, int M, int T> class Quantity { ..... public: friend Quantity operator*(const Quantity& q1,const Quantity& q2); ..... };
0
by: Michal | last post by:
I have troubles with instaling .Net Framework 2.0 (Beta 2 - 2.0.50215). The main instalation went just fine, troubles begin with my attemt to run aspnet_regiss.exe -i. Asp.Net is instaled into IIS...
1
by: amparikh | last post by:
I have something like this. typedef enum TYPES{ X =0, Y, Z, MAX}; template <typename T> class A { public:
0
by: JohnIdol | last post by:
VC++6 to VC++2003 - linking troubles -------------------------------------------------------------------------------- Hi All, I successfully ported an application from VC++6 to VS2003. Solved...
1
by: tQtP8Ecy3dqNkbVp | last post by:
Hi, I'd like to point out this post on the comp.lang.c++ newsgroup in which I present some code that I've been told is perfectly legitimate and standard-compliant. The problem I'm having with vc++...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
Oralloy
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,...
0
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...

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.