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

pbl when changing files from .inl to .cpp

Hi people,

I am a beginner for using templates in C++. I think the system is nice
but why using it when it is not necessary. Anyway, in my code I need to
remove the "template aspect" of a file for compatibility with other
parts of the code. That means, I had a file like that :
(in a file MyClass.inl)
template <class T>
MyClass<T>::MyMethod(...,...,...)
{
....
}

(in a file MyClass.hpp)
template <class T>
class MyClass
{
public:
MyClass2 MyObject2;
}
(not templated class in a file MyClass2.hpp)
class MyClass2
{
....
}
I wanted to change that by removing the templates in MyClass, so now I got:

(in a file MyClass.cpp)
MyClass::MyMethod(...,...,...)
{
....
}

(still the same, in a file MyClass.hpp)
class MyClass
{
public:
MyClass2 MyObject2;
}
(still the same, not templated class in a file MyClass2.hpp)
class MyClass2
{
....
}

My problem is that the second class (MyClass2) is not recognized anymore
by the new file MyClass.hpp and I got the following message:
error C2079: 'MyObject2' uses undefined class 'MyClass2'

Someone has an idea, please ?
May 2 '06 #1
1 1657
Christel Chamaret wrote:
[..]

My problem is that the second class (MyClass2) is not recognized
anymore by the new file MyClass.hpp and I got the following message:
error C2079: 'MyObject2' uses undefined class 'MyClass2'

Someone has an idea, please ?


Include 'MyClass2.hpp' in the 'MyClass.hpp'.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
May 2 '06 #2

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

Similar topics

7
by: lawrence | last post by:
2 Questions: 1.) Can anyone think of a way to speed up this function? It is terribly slow. I plan to reduce the number of directories to 3, which I guess will speed it up in the end. 2.) This...
7
by: LRW | last post by:
Sorry to crosspost, but I have no idea if this is more a PHP question of general Linux question. I have a script that makes changes to image files, montages them into a jpg, and creates a Web...
2
by: Satish Kumar Chimakurthi | last post by:
Hi all, An external solver program is dynamically producing files with different names 0000001.dat, 0000002.dat, 0000003.dat etc.....at regular intervals. These files contain all numeric data....
1
by: Darren | last post by:
When I do a final build I typically build all projects in debug mode first and then release mode and then copy all files to a builds folder. However I've noticed that the .pdb files in the debug...
5
by: John Pass | last post by:
I saved a project accepting the defaults name “ConsoleApplication2”. After adding the code, I changed the name using “Rename” in the file directory. After opening the file, the project name...
8
by: marcus.kwok | last post by:
I am having a weird problem and I have can't figure out why it is happening. I create an OpenFileDialog and set a filename filter. When the dialog first opens, the filter works correctly, and...
0
by: Rahul | last post by:
I have some resx files inside my Global Resources folder for the web and some other Resx files for the DataAccess layer project .For web project I am using Resx files for the Form control's...
1
by: mtp | last post by:
Hello, in several docbook XML files, i have: <mediaobject> <imageobject> <imagedata fileref="../images/pic1.png"/> </imageobject> </mediaobject>
4
by: Jay | last post by:
What's the recommended way to change file/folder names within a project? I want to change the solution name from (say) sol1.sln to sol2.sln, and also everything else named sol1.* (eg sol1.suo,...
9
by: silverburgh.meryl | last post by:
i am trying to use python to walk thru each subdirectory from a top directory. Here is my script: savedPagesDirectory = "/home/meryl/saved_pages/data" dir=open(savedPagesDirectory, 'r') ...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
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...
0
tracyyun
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...
0
isladogs
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...

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.