Difference between Windows and Linux GCC compiler

  • Follow


Hi all,

I'm interested to know what is the difference in programming using MS
Visual C++ on Windows and using the GCC compiler on Linux, i.e. what
are some of the things I can do on Visual C++ that won't compile/run
on Linux, and vice versa.

For example, I know that Windows uses the LLP64 model, while Linux
uses the LP64 model, so I can't use the long long data type when
programming on Linux. Also, the windows.h file is only available in
Windows, and can't be used on Linux. I've also read that there is also
some differences in network programming, since winsock, and especially
the underlying ip headers are much different in Windows than Unix/
Linux gcc. Is this true?

Thank you.
0
Reply lancer6238 (9) 7/31/2009 4:22:37 AM

Rayne said:

> Hi all,
> 
> I'm interested to know what is the difference in programming using
> MS Visual C++ on Windows and using the GCC compiler on Linux, i.e.
> what are some of the things I can do on Visual C++ that won't
> compile/run on Linux, and vice versa.

Tricky one. You see, Wine (WINdows Emulator) muddies the water 
somewhat! But setting Wine aside for now...

Basically, anything hardwary is going to be different on the two 
systems.

> For example, I know that Windows uses the LLP64 model, while Linux
> uses the LP64 model, so I can't use the long long data type when
> programming on Linux. Also, the windows.h file is only available in
> Windows, and can't be used on Linux.

Well, duh! :-)  Similarly, you're unlikely to find <unistd.h> on a 
typical Windows implementation.

> I've also read that there is
> also some differences in network programming,

Less than you'd think.

> since winsock, and
> especially the underlying ip headers are much different in Windows
> than Unix/ Linux gcc. Is this true?

Put it this way: in just a few lines of C it is easy to abstract away 
enough differences between Winsock and Berkeley Sockets to make it 
possible to write code that will compile and work under either of 
them.

-- 
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
"Usenet is a strange place" - dmr 29 July 1999
This line unintentionally left unblank
0
Reply rjh (10789) 7/31/2009 5:11:26 AM


Excuse me, but can GCC (for Windows) use Microsoft PSDK without any 
adjustments except compiler parameters and/or directives?
0
Reply jaejunks1 (4) 7/31/2009 7:04:29 AM

Jaelani said:

> Excuse me, but can GCC (for Windows) use Microsoft PSDK without any
> adjustments except compiler parameters and/or directives?

Personally, I have no idea. You'll likely get the best response in 
either comp.os.ms-windows.programmer.win32 or perhaps a GCC 
newsgroup.

-- 
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
"Usenet is a strange place" - dmr 29 July 1999
This line unintentionally left unblank
0
Reply rjh (10789) 7/31/2009 7:39:19 AM

On Jul 31, 3:04=A0am, Jaelani <jaeju...@googlemail.com> wrote:
> Excuse me, but can GCC (for Windows) use Microsoft PSDK without any
> adjustments except compiler parameters and/or directives?

MinGW is a gcc based Win32 cross-development system. http://www.mingw.org
0
Reply toby23 (1080) 8/1/2009 4:10:21 AM

4 Replies
38 Views

(page loaded in 0.129 seconds)

Similiar Articles:













7/13/2012 2:22:38 PM


Reply: