VC 5.0 strange error

here are the snippets involved (dots to maintain indenting):

namespace ZData
{
class ChannelData
{
//snip
protected:
...friend class ZFile::RawDataFile;
...std::vector<short> horz, vert;
//snip
};
}

namespace XPlat
{
class File
{
//snip
...void read(void* dest, size_type unit_size, size_type num_vals) throw(BadReadWrite);
...template <typename T>
...void read(T& val) throw(BadReadWrite);
//snip
};
}

namespace ZFile
{
class RawDataFile
{
//snip
...std::vector<ZData::ChannelData> data_channels;
//snip
};
}

ZFile::RawDataFile(const std::string& path)
{
...XPlat::File file;
//snip
...try {
......for (unsigned i = 0; i < num_slices; i++)
.........for(unsigned j = 0; j < data_channels.size(); j++)
.........{
............file.read(data_channels[i].horz[i]);  //error
............file.read(data_channels[i].vert[i]);  //error
.........}
...}
//snip
}

Anyway, I am getting an error at each of the lines noted above:
error 2661: 'read' : no overloaded function takes 2 parameters

I'm really not sure what is going on here.  I've tried putting an extra pair of parens in the read, but I'm coming up with nothing.
LVL 1
sosedadaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

nietodCommented:
Is this for VC 6?  VC 5 does not support template member functions.

You might try renaming the non-template read() function and seeing if the problem goes away.
0
sosedadaAuthor Commented:
Well, I guess I'm wasting my time of VC5, tried changed the template read to readVal and now it says readVal doesn't take 1 argument.

So I took my code to a friends machine (VC6 sp3) and when I rely on type deduction I get:
RawDataFile.cpp(82) : error C2893: Failed to specialize function template 'void __thiscall XPlat::SwapFile::readVal(T &)'
        With the following template arguments:
        'short'

Naturally, 2893 is one of the errors not documented in the help.  Not that it would do any good.

So I tried making it
file.readVal<short>(...);
and get:
RawDataFile.cpp(81) : error C2062: type 'short' unexpected


And to top it all off in another file I got an internal compiler error on:
template <typename HeaderClass, unsigned long DataType>
class TemplateHeaderMaker: public HeaderMaker

I don't know why I agreed to work on this project with this non-conforming compiler.  Help, please!
0
nietodCommented:
>> non-conforming compiler
There isn't one yet that conforms intirely to the standard.  Gcc is close, but still not intirely there.

Wait a second, what is

ZFile::RawDataFile(const std::string& path)
{
....XPlat::File file;
//snip
....try {
.......for (unsigned i = 0; i < num_slices; i++)
..........for(unsigned j = 0; j < data_channels.size(); j++)
..........{
.............file.read(data_channels[i].horz[i]);  //error
.............file.read(data_channels[i].vert[i]);  //error
..........}
....}
//snip
}

ZFile:: is a namespace, not a class name.  so RawDataFile() presented there is a global function inside the namespace, not the class.  That's nt what you want, right?
0
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

sosedadaAuthor Commented:
sorry, that is the contructor, I left out a RawDataFile::

Since VC 5 doesn't support member function templates, I can settle for read(<handwritten data type>).  But I need to be able to compile this on VC 6.  Am I going to have to use a support call on that ICE?  Or does anyone know anything about whats going on there?
0
nietodCommented:
Its hard to tell what the problem is with this little code snippet.  From what I can see, it should work fine, but I can't say for sure.
0
sosedadaAuthor Commented:
All I know is the code with the ICE works on VC5
0
nietodCommented:
I don't understand.  I thought you said it doesn't work.
0
sosedadaAuthor Commented:
The template function doesn't work.  I have given up on that for now.  However, I discovered an Internal Compiler Error when I built using VC6.  This happens on the class declaration noted above with unsigned long DataType as one of the template parameters.
0
nietodCommented:
The compiler errors are usually caused by syntax errors that the compiler can't handle.  You cna usually track them down by commenting out large portions of the code until the problem goes away, then bring back peices of code until it returns, and continue this process until you narrow in on the section that is causing the problem.   Its a big pain to do this, but fortunately they don't happen often.  (I don't think I've seen one in more than a year.)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sosedadaAuthor Commented:
We may not have gotten the results I hoped for, but things are working and I got rid of that ICE also.  Thanks.
0
nietodCommented:
You're welcome.  but I really didn't think I did anything, otherwise I would have answered.
0
sosedadaAuthor Commented:
I understand, but I you helped me enough that I didn't want to delete the question.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C++

From novice to tech pro — start learning today.