LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-28-2004, 05:13 PM   #1
PhuckFonix
Member
 
Registered: Mar 2004
Location: United States of Bush
Distribution: Knoppix 3.7, Debian Sarge
Posts: 297

Rep: Reputation: 30
C++ or Java compiler for Linux


The course I'm taking currently requires me to code in C++ and use C++ methods from classes provided by the instructor. I also have some experience writing Java and will be heavily using that language in a course next year.

I'm running MDK 10.0CE and will soon be running MDK 10.0 Official. What can I do?
 
Old 04-28-2004, 05:24 PM   #2
Inexactitude
Member
 
Registered: Oct 2003
Distribution: Slackware 12.2, Ubuntu 9.04
Posts: 477

Rep: Reputation: 30
For cpp, there's g++, which should work fine. I'm not sure, but there may be java extensions for gcc or g++ also, you may want to look into that. I'll take a look at it and see what I can get.
 
Old 04-28-2004, 05:33 PM   #3
Mega Man X
LQ Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Rep: Reputation: 64
Hi PhuckFonix!!!

As Inexactitude suggested, g++ does the job greatly. However, beware that some headers in g++ are different from a windows compiler. For example, the header conio.h is included in Borland, VC++, DevC and a hole bunch of C++ compilers for Win/DOS and it's not part of gcc/g++. Some books, as the the one I read at school, uses intensively the function getch()(from conio.h header file) for either wait the user to press a key or for key events. There're ways around it, but if you are totally new to g++ and C++ itself, it can be a pain. You'll face also a lot of differences like that as well.

Java, the best way is to grab Sun's J2SDK for Linux. It works just like Windows and it's pretty easy to install. There's an extension for gcc called gcj that can compile Java byte code in Linux native code. You gain a hell lot of speed (important, since Java is the slowest thing I've worked with) but you won't be able to compile anything from graphical interfaces, as Swing.

So, maybe, it's better to learn C++ with the softwares they offer at school and the books. Java won't matter, grab J2SDK from Sun and happy coding

Last edited by Mega Man X; 04-28-2004 at 05:34 PM.
 
Old 05-01-2004, 08:04 PM   #4
PhuckFonix
Member
 
Registered: Mar 2004
Location: United States of Bush
Distribution: Knoppix 3.7, Debian Sarge
Posts: 297

Original Poster
Rep: Reputation: 30
I have a copy of borland's include folder now if I need any header files, and I have noticed difference between same language compilers before.

But my problem now is: I run "gcc" in the run command GUI but nothing comes up.
 
Old 05-01-2004, 09:50 PM   #5
blinux1
Member
 
Registered: Nov 2002
Location: Pennsylvania
Distribution: Mandrake 9.1 and Redhat 9
Posts: 144

Rep: Reputation: 15
I would recommend using KDevelop for developing C++ code, because of its relatively ease of use to create projects--i think its in Mandy 10.
 
Old 05-02-2004, 12:55 AM   #6
Inexactitude
Member
 
Registered: Oct 2003
Distribution: Slackware 12.2, Ubuntu 9.04
Posts: 477

Rep: Reputation: 30
You have to run gcc from the command line. Just pop up a console or whatever and you should be ready to run.
 
Old 05-02-2004, 12:59 AM   #7
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,284

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
Headers such as conio.h are nonstandard anyhow. That is, they implement operations specific to the Windows platform (there are other headers that provide prototypes for cuntions only available on *nix). I am pretty sure that g++ implements most all of the ANSI standard C++ library and STL. But be sure to get a distro with a newer gcc (GNU Compiler Collection, of which g++ is part), since the g++ with version 2 gcc s was missing some amount of functionality.

As for Java, the Java Development Kit from Sun Microsoft installs perfectly fine under Linux, as Megaman X said. You can even get a copy of Borland's JBuilder Community Edition as freeware.
 
Old 05-03-2004, 08:32 PM   #8
PhuckFonix
Member
 
Registered: Mar 2004
Location: United States of Bush
Distribution: Knoppix 3.7, Debian Sarge
Posts: 297

Original Poster
Rep: Reputation: 30
Kdevelop is working fine! Though, the speed it builds apps is very slow compared to Windows compilers. On a side note: I hope the KDE team fixes whatever is making things slow.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Java c compiler corbis_demon Linux - Newbie 2 08-11-2004 11:14 PM
java compiler athenerx Programming 33 06-30-2004 04:21 PM
Java Compiler? Alinuxnoob Programming 9 02-15-2004 11:00 PM
java compiler shamz Programming 2 10-26-2003 05:35 PM
Java and C compiler Eros_ Linux - Software 4 07-22-2003 07:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration