Couple of questions about compilers on linux

B

Bonj

Hi
What is a good C/C++ compiler for a 64-bit linux system?
I'm thinking of building a new PC and want to put an AMD64 in it. Since
I've already got one windows PC, windows isn't free, and isn't even past
beta in 64-bit, I thought I'd go for a fedora linux box.

But I've no idea what compiler to use - presumably it'd be gcc, but which?
Do I need cygwin or anything if I'm on linux, or does gcc "just work" on
linux because it's its native environment?
Is it possible to compile a GUI app on 64-bit linux that will be (*fairly*
easily) portable to windows? (using C - not java)
 
J

jacob navia

Bonj said:
Hi
What is a good C/C++ compiler for a 64-bit linux system?
I'm thinking of building a new PC and want to put an AMD64 in it. Since
I've already got one windows PC, windows isn't free, and isn't even past
beta in 64-bit, I thought I'd go for a fedora linux box.

But I've no idea what compiler to use - presumably it'd be gcc, but which?
Do I need cygwin or anything if I'm on linux, or does gcc "just work" on
linux because it's its native environment?
Is it possible to compile a GUI app on 64-bit linux that will be (*fairly*
easily) portable to windows? (using C - not java)

I am using debian 64 bits with gcc installed.
There are no problems at all with gcc, it works, and generates
64 bit code of course, in a 64 bit system.

Notice the sizeof(long) == 8, and sizeof(int) == 4. This is
not portable to windows 64 bits where sizeof(long) == 4 and
sizeof(int) == 4

I am porting lcc-win32 to linux, and I would love to tell you that
lcc64 is a better system but I will need some years of work
before it runs smoothly...

You do not of course need cygwin, since cygwin is a unix
emulator for windows. If you run unix natively, the simulator
just doesn't make any sense. Of course you could run an
Unix simulator using the windows emulation available under
unix, specially if you find that your new machine is just
too fast for your taste and you need to slow it down. :)

Software ports easily in C, but you should beware of the
change in the long data type.

jacob
 
B

Bonj

Thanks
Do you know if the code to create GUI components in linux are totally
different to windows, or largely the same? e.g. does linux have
"CreateWindow" et al. ?
Notice the sizeof(long) == 8, and sizeof(int) == 4. This is
not portable to windows 64 bits where sizeof(long) == 4 and
sizeof(int) == 4

That's even better! My existing machine is Win32, so porting to linux-64 I
can just use long...
 
G

Gregory Toomey

Bonj said:
Thanks
Do you know if the code to create GUI components in linux are totally
different to windows, or largely the same? e.g. does linux have
"CreateWindow" et al. ?


That's even better! My existing machine is Win32, so porting to linux-64 I
can just use long...

In unix/linux the windowing systems is separate and independent from the
operating system.
You can run unix/linux with NO gui.

The most common window system is X windows. Qt made by
http://www.trolltech.com/ can build the one gui application that runs on
both X Windows/Microsoft platforms.

(In fact X windows is just a user-space program like any other user program.
Its a very clean interface, unlike the mess that Microsoft created).

gtoomey
 
L

Lawrence Kirby

On Wed, 29 Dec 2004 12:28:23 +0000, jacob navia wrote:

....
Notice the sizeof(long) == 8, and sizeof(int) == 4. This is
not portable to windows 64 bits where sizeof(long) == 4 and
sizeof(int) == 4

It is portable as long as program code doesn't make invalid assumptions
about type sizes and ranges.

Lawrence
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,157
Messages
2,570,879
Members
47,413
Latest member
KeiraLight

Latest Threads

Top