Compiling error while compiling VC++ code on Ubuntu using GCC

Andy Falanga (afalanga) afalanga@micron.com
Wed Aug 7 15:10:00 GMT 2013


> -----Original Message-----
> From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On
> Behalf Of Raman
> Sent: Wednesday, August 07, 2013 12:14 AM
> To: gcc-help@gcc.gnu.org
> Subject: Compiling error while compiling VC++ code on Ubuntu using GCC
> 
> Hi i develop a program on c using VSTS2010. it is compiling fine on
> window.
> bt with the same code whwn i am compiling it on linux it through error
> 
> 
> expected constructor, destructor, or type conversion before â(â token
> In file included from CRuntimeDll.cpp:13:
> CRuntime.h:5: error: expected constructor, destructor, or type
> conversion before â(â token
> 


Not sure if this one was answered but one thing I now know to look for is that the Microsoft compiler will often times allow much that GCC will not.  For example, on the project I'm working on now, our team was oft doing things like:

throw std::exception("Something went wrong")

For kicks and giggles one day I decided to try an idea using GCC and did something similar.  I then found out that the STL *doesn't* define a ctor for std::exception which takes a string (either a char* or std::string) object.  Microsoft's implementation of the STL allowed for such (I word it this way because I don't think it's something that was put into their compiler per se).  Your problem referenced there may be nothing more than a generous allowance from Microsoft that isn't standard and, thus, not portable.  The error message provided sounds similar: i.e. whatever is on line #5 of that file is probably code that isn't standard conforming but Microsoft helps you in doing what you're after  (I'm not sure if that's the file you provided, and one of those you provided was poorly formatted, probably Outlook's fault not yours).

Andy


More information about the Gcc-help mailing list