LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   making your own programs for linux (https://www.linuxquestions.org/questions/linux-software-2/making-your-own-programs-for-linux-331668/)

linuxmandrake 06-08-2005 05:38 PM

making your own programs for linux
 
Hi
I have made prgrams for windows in java/vb. I was wondering what language do u use to make programs in linux. This is my first time making programs for linux so please assume i know nothing but oviously i have some programming knowledge.

Am using fedora 3 with the KDE desktop. Also I would need to know how wud i compile the program. Preferably I would like to make the it install via RPM but if u reckon it's to hard for a newbie then make scripts are fine.

juanbobo 06-08-2005 06:18 PM

The kernel is written in C and I would say most programs written for Linux are written in C or C++, but there is no reason to use only one language. The GNU compiler supports C, C++, Java, Fortran, and Ada. You can compile programs using the command "gcc" or "g++". Check out the man page for GCC by typing "man gcc" at the console. Making RPMs is not hard, type "man rpmbuild" to learn how.

sasho 06-08-2005 06:23 PM

You can program in Java just the same as you did in Windows. Others than the already mentioned are Perl and Python, most likely already installed with your distro,

Electro 06-08-2005 07:32 PM

Its hard for someone to switch from one programming language to another. I suggest searching for books that compares the basic code to C/C++ code. This way you can see the syntax in a new langauge from the langauge you already know. There is a lot of information on programming in Linux, so search the internet.

Python is a good language to quickly make a program.

A project like SWIG, programming langauge wrapper, can be helpful.

Use an IDE (Integrated Development Environment) to help you on big projects and GUI projects. I think eclipse looks good.

reddazz 06-09-2005 03:02 AM

You can use any language to write programs for Linux, but as mentioned above C and C++ tend to be more popular than others. I am not much of a programmer, but a lot of my own simple programs using Python and Perl. You can also create GUI programs using Python and Perl in KDE and GNOME.

LUB997 06-09-2005 05:34 AM

I have SuSE 9.1 Professional, and I can use just about every language under the sun if I have the time and patience to figure out how. I use C with gcc comiler, C++ with g++ compiler, Java with Sun's JDK for Linux, and C# with the Mono .NET platform for Unix-like operating systems. Mono would probably be good for you because you said you had some Visual Basic experience. Mono does not support Visual Basic yet, but I read in Linux Format that they are working on supporting it. Mono supports C# extremely well. I took Programming 1 at my Unversity last semester (I'm a computer programming major), and the teacher tried to tell me that I needed to put Windows XP back on my home computer to be able to use Visual Studio .NET to be able to do the class assignments in C#. I said I don't have Windows; I have Linux. He said I have free Windows XP CD's and free Visual Studio .NET CD's that you can take home, and I said there is a reason Windows has not been on my home computer in 5 years now. I don't like blue screens of death. He wasn't particularly pleased with my resistance to using Windows or Visual Studio and was very skeptical, but in the end what it came down to was that other people turned in a sheet with their C# code, another sheet with their output, and I turned in a sheet with my C# code, and another sheet with my output, only my output included Linux command line commands, as I compiled it manually on the command line, and Visual Studio users don't. That was last semester. This semester I completed every assignment I did in C# with the Mono compiler, as I did last semester, and was able to complete every assignment without doing any bit of the code any differently than I would have had to do with Visual Studio, and did it entirely on Linux, and got an A in the class. I did not do one assignment in Visual Studio this semester not including the required at school tests. Mono works that well. The only thing Mono is still lacking as far as C# is WindowForms. Without WindowsForms you can't do C# GUI programming; you have to keep it in the command prompt with no graphics. This has been gotten around though by GTK# which lets you use C# to do GTK/GNOME GUI programming. However, Linux Format magazine just had a big story on Mono and said that WindowForms is to be added to Mono by 2006, so then you won't even need GTK# anymore. Nothing will be any different than regular C# on Windows. What might apply to you out of this is that Mono developers are already working on including Visual Basic, though the addition of Visual Basic support is not yet complete. You can do Java on Linux exactly as you did in Windows.

For c:

gcc helloWorld.c -o helloWorld
./helloWorld

For c++:

g++ helloWorld.C -o helloWorld // Note the capital C since it is c++
./helloWorld

For Java:

javac helloWorld.java
java helloWorld

For C#:

mcs helloWorld.cs
mono HelloWorld.exe

You can do just about any programming language on linux!

sekelsenmat 06-09-2005 07:30 AM

You can program in Java just as you did in windows, but just in case you want to learn something different:

http://www.lazarus.freepascal.org/

a object pascal Rapid Application Development environment for linux


All times are GMT -5. The time now is 12:48 AM.