.NET Framework - Porting code from Linux to Windows

Asked By Rayne
20-Nov-09 07:57 AM
Hi all,

I am using Visual Studio .NET 2003, and I am trying to port code I have
written and compiled/run successfully in Linux GCC to Windows.

I am a newbie when using VS. I have created a new project, and added all
the .c and .h files I have into the project by Project -> Add Existing
Items, then chose all the .c and .h files.

I am not familiar with how exactly compilers and linkers etc work, but
is there a difference between how VS and gcc compile/link #include
files? My habit of programming in Linux has been to have one main.c
file, and #include all other .h or .c files that I need. Then I would
only compile the main.c file. But in VS, it seems as if the #include
files are not "seen" by the program, because I am getting errors that
tell me certain structures or variables were not declared, even though
they are in my user-defined header files.

I am also getting errors like DIR is an undeclared identifier. I have
included , so why cannot it recognize DIR?

Thank you.

Regards,
Rayne
Visual Studio .NET
(1)
Linux
(1)
Windows
(1)
Linkers
(1)
NIX
(1)
GCC
(1)
  Gerry Hickman replied to Rayne
20-Nov-09 05:13 PM
Hi,

You should be able to write cross-platform code with GCC. Visual Studio
is very much "Windows Only" and especially if you even think about using
the .NET framework.

However, if you only want to port one way, it is possible to compile
pure ANSI C code with standard libraries from *NIX to Windows and you
can compile such code inside Visual Studio. The main reason it does not
usually work, is because someone has used *NIX system calls in the C
code which Windows does not understand.

If you want a detailed answer, the best thing to do, is create a small
*NIX program in GCC, then add the source files to a new VS project, then
compile, then make a note of the errors, then post the source code here.
You'll get a quick answer as to why it did not work.



--
Gerry Hickman (London UK)
help
visual studio.net 2003 and Access 2007 database .NET Framework Hi I am currently using Visual Studio.Net 2003 running on Windows Server 2000 operating system. I have used Visual Studio.net 2003 connecting to Access 2002 databases in the pass with great success. Now
Is Visual Studio self-hosting ? .NET Framework Does Microsoft use Visual Studio IDE, Visual Studio Debugger, Visual Studio Linker and Visual Studio compiler for developing Visual Studio ? Or is Visual Studio not
Visual Studio .net .NET Framework Hi NG, ich habe vor längerer Zeit mit Visual Studio .Net 2003 gearbeitet und überlege momentan auf einen neueren Stand upzudaten. Ein Visual Studio .Net 2008 scheint es nicht zu geben. Habe zumindest mit googeln nichts gefunden. Was
Visual Studio versioning . . . . how to tell? .NET Framework To my knowledge, Visual studio 6 was released in 1998, then Visual Studio .NET 2002 is VS 7, then Visual Studio .NET 2003 is VS 7.1, then Visual
operating systems visual studio.net runs on .NET Framework Can Visual Studio.Net 2005 professional edition be installed on a Vista Home computer operating system? If so, is there anything I should be aware of? If not, can you tell me why Visual Studio.net 2005 professional edition does not run on a Vista Homer computer operating System