LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Simple programing question (https://www.linuxquestions.org/questions/linux-newbie-8/simple-programing-question-110582/)

neozero62 10-30-2003 05:38 PM

Simple programing question
 
Ok, I have written several small c++ programs in Windows, and compiled them to .exe files. Now then, I made the big switch to linux! (redhat 9) I am using the Qt Designer and it looks very much like Visual C++. I have input code in the API, but I cant find a "compile" button. I got to thinking that maybe you don't compile code in the API because there is no .eve files in linux. So I guess the question is, How do you "pack" the code to run in linux? Maybe I save it as the .cpp file and can compile from terminal? If anyone has any ideas or help please reply, Thanks!

-Randy
:newbie:

uteck 10-30-2003 05:59 PM

I have never written my own code, but I have compiled enough to know that you need a Makefile, which is just a text file that 'make' reads. If you have one, then type 'make' and see what happens, but usually you need to run './configure" first, but that requires a configuration file.
I found a few how-to's
Makefile
http://vertigo.hsrl.rutgers.edu/ug/make_help.html
http://www.opussoftware.com/tutorial/TutMakefile.htm
http://www.eng.hawaii.edu/Tutor/Make/
http://geosoft.no/javamake.html

autoconf
http://www.murrayc.com/learning/linu...automake.shtml


Hope this helps some. :D

LogicG8 10-30-2003 05:59 PM

Try using a more simplistic IDE. Anjuta is good.
Qt Designer is more for building GUI programs.

There are executables in linux but they don't
depend on extensions like '.exe' or '.bat' or '.com'
they are marked with an attribute that says they
are executable

try running this from a console:
cd /usr/bin
ls -l

those funny strings that look like -rwxr-xr-x
tell you what "permissions" the file has set

r = read
w = write
x = executable

LogicG8 10-30-2003 06:01 PM

uteck is wrong, you do not need a makefile

g++ -o programname programname.cpp

will work just fine outputting a program
but most people prefer working in an IDE
Makefiles are great for larger programs,
but most simple programs don't need one

neozero62 10-30-2003 06:08 PM

Thanks Both of you!, I have ground to grow on now. The attributes you are talking about I have never heard about, but I see them now, and Its making more sence. And Thanks for the links uteck. Good reading. Thanks for your time!

neozero62 10-30-2003 09:33 PM

Ok, If anyone else is wondering this, KDevelop is The best way to go for a newbie, It is almost exacly like Visual C++ by that crazy microsoft company that likes to charge way to much for there programs. It has a compile and build menu, and is good to start with, I have compiled my .cpp's with it and all is going good. I could not have done it without your help though, Thank God for this Forum!!


All times are GMT -5. The time now is 08:06 PM.