Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Porting WIN32 to Linux

Status
Not open for further replies.

Iceman2005

Programmer
May 6, 2005
22
0
0
US
guys,,.... i am trying to port a windows code to linux.

i nailed it down to ONE last error i cant seem to fix,
because of this...nothing works.

the windows version had poart of the code that does this...

class ClassName : public std::_Ranit<_Ty, _D>
.....


but it does not compile in linux... gives me error with...

error: no class template named `_Ranit' in `std'

how do i fix it?

thanks,
iceman
 
There shouldn't be any classes or functions in the std namespace that start with an underscore. Names with leading underscores are reserved for implementation specific code that is private.
Where is _Ranit defined on Windows?
 
cpjust.....

well... if you copy/paste this code in windows...
it will work.. but not in linux....

template <class _Ty, class _Diff, class _Pointer, class _Reference>

class MyClass : public std::_Ranit<_Ty, _Diff, _Pointer, _Reference>
{
};

int main()
{
return 0;
}
 
I tried this on VC++ 6.0 and got one error:
error C2977: '_Ranit' : too many template arguments
Code:
#include <iterator>

template <class _Ty, class _Diff, class _Pointer, class _Reference>

class MyClass : public std::_Ranit<_Ty, _Diff, _Pointer, _Reference>
{
};

int main()
{
    return 0;
}
The reason it doesn't work on Linux is because it uses a completely different STL implementation than VC++. You are using private implementation specific code.

Try using something standard like this:
Code:
template <class Ty, class TDiff, class TPointer, class TReference>
	class MyClass : public iterator<random_access_iterator_tag, Ty, TDiff> {};
 
I am using Visual C and I get an error with that code also. Just thought you might want to know that cpjust isn't the only one. I haven't tried his code yet though.

MuthuIVS
 
Don't transfer ATL/STL headers from Windows to Linux - Linux already has STL. Just use the ones provided by g++.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top