views:

68

answers:

2

I'm trying to port some old Linux code to run on Windows and am running into a whole bunch of compiler errors that seem to be stemming from the considerable use of template classes. Are there really any significant differences between how templates must be implemented for linux vs MSVC? If so, could someone give an overview of what's actually different? I've found lots of documentation, but nothing that actually lays down what the differences are.

+3  A: 

The C++ language is defined by the C++ Standard - it isn't an operating system specific thing. How well the Standard is implemented varies from compiler to compiler, not from OS to OS.

Having said that, if it is very old code, you will probably find that the modern compilers on both Windows and Linux won't compile it. This is because these modern compilers are much stricter in their adherence to the C++ Standard, and chuck out code that earlier and less compliant compilers would have let slide.

Bottom line - you need to address each error on its own terms. Or possibly junk the code, if it is really, really old.

anon
+1  A: 

It's going to depend a lot on the versions of compilers you are using both on Windows and on Linux. So I think the only way is to go through and fix the errors one by one.

Alex - Aotea Studios