Code Comments
Programming Forum and web based access to our favorite programming groups.I have some c code that I would like to compile with visual studio, and retain c compatibility. IOW, converting it to c++ is not an option. Is there a way to configure the project to be compatible with c code? I can compile the code just fine with gcc, so I believe the code is ok, but I get numerous errors with visual studio. I'm using Visual Studio 2005
Post Follow-up to this messageOn Sat, 12 Apr 2008 11:56:38 -0700, "Zootal" <msnews@zootal.nospam.com> wrote: >I have some c code that I would like to compile with visual studio, and >retain c compatibility. IOW, converting it to c++ is not an option. Is ther e >a way to configure the project to be compatible with c code? I can compile >the code just fine with gcc, so I believe the code is ok, but I get numerou s >errors with visual studio. I'm using Visual Studio 2005 By default, files that end with the extension .c are compiled as C. You can also force the issue with the /Tc and /TC compiler options (and vice versa with /Tp and /TP). -- Doug Harrison Visual C++ MVP
Post Follow-up to this message"Doug Harrison [MVP]" <dsh@mvps.org> wrote in message news:5m2204l59gvoobfa5etpo9j88bmbqalk89@ 4ax.com... > On Sat, 12 Apr 2008 11:56:38 -0700, "Zootal" <msnews@zootal.nospam.com> > wrote: > > > By default, files that end with the extension .c are compiled as C. You > can > also force the issue with the /Tc and /TC compiler options (and vice versa > with /Tp and /TP). > > -- > Doug Harrison > Visual C++ MVP Thanks - I didn't know that. I'm finding there are issues with some of the syntax, enough that I'm not sure it's worth the trouble to get it to work with Visual Studio. It works with gcc, but I'm not sure if gcc has some non-ansi c extensions that VS doesn't have <sigh>.
Post Follow-up to this messageZootal wrote: > Thanks - I didn't know that. I'm finding there are issues with some of the > syntax, enough that I'm not sure it's worth the trouble to get it to work > with Visual Studio. It works with gcc, but I'm not sure if gcc has some > non-ansi c extensions that VS doesn't have <sigh>. Zootal: The problem with some C code is that it is C99, which VC does not support (a nd last time I heard is not going to support). For C++, in recent years I have found excellent compatibility between VC and gcc, and it is very easy to produce code that will compile under either. -- David Wilkinson Visual C++ MVP
Post Follow-up to this message"David Wilkinson" <no-reply@effisols.com> wrote in message news:OEQTknNnIHA.1680@TK2MSFTNGP06.phx.gbl... > Zootal wrote: > > Zootal: > > The problem with some C code is that it is C99, which VC does not support > (and last time I heard is not going to support). > > For C++, in recent years I have found excellent compatibility between VC > and gcc, and it is very easy to produce code that will compile under > either. > > -- > David Wilkinson > Visual C++ MVP Ahh...it's GNU C, and VS definitely is not 100% compatible. It's code that emulates parts of the linux kernel, and some of the libraries it links in is actual kernel code - that is the actual problem, not the code I'm working with. <sigh>....debugging with gcc is a pain....
Post Follow-up to this messageZootal wrote: > "David Wilkinson" <no-reply@effisols.com> wrote in message > news:OEQTknNnIHA.1680@TK2MSFTNGP06.phx.gbl... > > Ahh...it's GNU C, and VS definitely is not 100% compatible. It's code > that emulates parts of the linux kernel, and some of the libraries it > links in is actual kernel code - that is the actual problem, not the > code I'm working with. <sigh>....debugging with gcc is a pain.... There is gcc for windows. I don't think it generates debug information in the Windows format though, so you may not get what you want. Googling, I see some suggestions that windbg supports the COFF format still but VS dropped support at version 7, so you can probably get source level debugging using windbg.
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.