Platform independent library - Suggestions needed
-
Rajesh R Subramanian wrote:
Is there a specific reason to it? If you are using the VS, then why not use the Visual C++ compiler itself?
Correct. But this class should compile with other compilers which are in LINUX and MAC. So I think, using VC++ compiler won't allow me to compile the same code on other platforms. Correct me if I am wrong.
-
Rajesh R Subramanian wrote:
Is there a specific reason to it? If you are using the VS, then why not use the Visual C++ compiler itself?
Correct. But this class should compile with other compilers which are in LINUX and MAC. So I think, using VC++ compiler won't allow me to compile the same code on other platforms. Correct me if I am wrong.
Christian Flutcher wrote:
But this class should compile with other compilers which are in LINUX and MAC. So I think, using VC++ compiler won't allow me to compile the same code on other platforms.
Using the Visual C++ IDE necessarily not mean using the Windows API and Windows specific things like MFC, ATL, etc,. As another user pointed out, write plain and portable C++ code, which is standards-conformant and that should compile on any standard C++ compiler. Hope that helps. :)
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche .·´¯`·->Rajesh<-·´¯`·. [Microsoft MVP - Visual C++]
-
Using VC++ compiler on Windows has nothing to do with compiling on other platforms. If you write portable code, it will compile on any standard-conforming C++ compiler including VC++.
Okay. So I shoud not use any MFC classes. Use plain C++ classes for it, right?
-
Okay. So I shoud not use any MFC classes. Use plain C++ classes for it, right?
Christian Flutcher wrote:
Okay. So I shoud not use any MFC classes. Use plain C++ classes for it, right?
Right. Using the VC++ IDE not necessarily mean using MFC or ActiveX, which are specific to Windows. I just typed that out to you on another reply and you've posted it at the same time. :)
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche .·´¯`·->Rajesh<-·´¯`·. [Microsoft MVP - Visual C++]
-
Christian Flutcher wrote:
But this class should compile with other compilers which are in LINUX and MAC. So I think, using VC++ compiler won't allow me to compile the same code on other platforms.
Using the Visual C++ IDE necessarily not mean using the Windows API and Windows specific things like MFC, ATL, etc,. As another user pointed out, write plain and portable C++ code, which is standards-conformant and that should compile on any standard C++ compiler. Hope that helps. :)
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche .·´¯`·->Rajesh<-·´¯`·. [Microsoft MVP - Visual C++]
Rajesh R Subramanian wrote:
write plain and portable C++ code, which is standards-conformant and that should compile on any standard C++ compiler. Hope that helps
Indeed. I am cleared now. Thanks. BTW, all these C++ things are bit confusing compared to C#, isn't it?
-
Christian Flutcher wrote:
But this class should compile with other compilers which are in LINUX and MAC. So I think, using VC++ compiler won't allow me to compile the same code on other platforms.
Using the Visual C++ IDE necessarily not mean using the Windows API and Windows specific things like MFC, ATL, etc,. As another user pointed out, write plain and portable C++ code, which is standards-conformant and that should compile on any standard C++ compiler. Hope that helps. :)
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche .·´¯`·->Rajesh<-·´¯`·. [Microsoft MVP - Visual C++]
Last question, Is it possible to use reflection in standard C++? I need to invoke a class from it's name. It's trivial in C# .NET like
Activator.CreateInstance
will do, but what about C++? -
Rajesh R Subramanian wrote:
write plain and portable C++ code, which is standards-conformant and that should compile on any standard C++ compiler. Hope that helps
Indeed. I am cleared now. Thanks. BTW, all these C++ things are bit confusing compared to C#, isn't it?
Christian Flutcher wrote:
BTW, all these C++ things are bit confusing compared to C#, isn't it?
Definitely NO. The managed world is a much larger mess when compared. There is a new .NET framework for download, every couple of days. There is a new technology every fortnight. By the time you finish mastering a new feature related to C#, that becomes obsolete. But that's not the case with C++. It is an old-timer language and exists for a "different" purpose. By all means, we should not compare C++ and .NET. One is a language and another is a framework. They both serve for different purposes and as I've said several times, they cannot rival each other on what they were built to do. But to my fortune, .NET was built with C++. Or just to be rude, "My compiler compiled your compiler". :) C++ is just C++. Things like MFC, VCF, etc., are frameworks that are built with and built to work with C++, which might be confusing at the beginning. I suggest that you master the actual language itself first and then move on to technologies that were built with C++. I talked too much - but hey, that's your fault. :-D
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche .·´¯`·->Rajesh<-·´¯`·. [Microsoft MVP - Visual C++]
-
Last question, Is it possible to use reflection in standard C++? I need to invoke a class from it's name. It's trivial in C# .NET like
Activator.CreateInstance
will do, but what about C++?Christian Flutcher wrote:
Is it possible to use reflection in standard C++?
With standard C++, NO. Reflection is something that is within the managed (.NET) world. I would also recommend that you start a new thread if you have a "totally new" question. That would kinda fetch replies from more people and give more visibility to your query. :)
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche .·´¯`·->Rajesh<-·´¯`·. [Microsoft MVP - Visual C++]
-
Christian Flutcher wrote:
BTW, all these C++ things are bit confusing compared to C#, isn't it?
Definitely NO. The managed world is a much larger mess when compared. There is a new .NET framework for download, every couple of days. There is a new technology every fortnight. By the time you finish mastering a new feature related to C#, that becomes obsolete. But that's not the case with C++. It is an old-timer language and exists for a "different" purpose. By all means, we should not compare C++ and .NET. One is a language and another is a framework. They both serve for different purposes and as I've said several times, they cannot rival each other on what they were built to do. But to my fortune, .NET was built with C++. Or just to be rude, "My compiler compiled your compiler". :) C++ is just C++. Things like MFC, VCF, etc., are frameworks that are built with and built to work with C++, which might be confusing at the beginning. I suggest that you master the actual language itself first and then move on to technologies that were built with C++. I talked too much - but hey, that's your fault. :-D
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche .·´¯`·->Rajesh<-·´¯`·. [Microsoft MVP - Visual C++]
That's why I love C++ than anyother language and trying my best to learn it. People like you are a real inspiration.
Rajesh R Subramanian wrote:
I talked too much
:) I loved that.
-
Christian Flutcher wrote:
Is it possible to use reflection in standard C++?
With standard C++, NO. Reflection is something that is within the managed (.NET) world. I would also recommend that you start a new thread if you have a "totally new" question. That would kinda fetch replies from more people and give more visibility to your query. :)
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche .·´¯`·->Rajesh<-·´¯`·. [Microsoft MVP - Visual C++]
Okay. I should stop bothering you now. I will look into the reflection stuff later. Thanks for the help and have a great day.