LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 10-30-2003, 05:38 PM   #1
neozero62
Member
 
Registered: Oct 2003
Distribution: Red Hat 9
Posts: 103

Rep: Reputation: 15
Lightbulb 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
 
Old 10-30-2003, 05:59 PM   #2
uteck
Member
 
Registered: Oct 2003
Location: Elgin,IL,USA
Distribution: Sidux, LinHES, and Mythbuntu
Posts: 209

Rep: Reputation: 32
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.
 
Old 10-30-2003, 05:59 PM   #3
LogicG8
Member
 
Registered: Jun 2003
Location: Long Island, NY
Distribution: Gentoo Unstable (what a misnomer)
Posts: 380

Rep: Reputation: 30
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
 
Old 10-30-2003, 06:01 PM   #4
LogicG8
Member
 
Registered: Jun 2003
Location: Long Island, NY
Distribution: Gentoo Unstable (what a misnomer)
Posts: 380

Rep: Reputation: 30
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
 
Old 10-30-2003, 06:08 PM   #5
neozero62
Member
 
Registered: Oct 2003
Distribution: Red Hat 9
Posts: 103

Original Poster
Rep: Reputation: 15
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!
 
Old 10-30-2003, 09:33 PM   #6
neozero62
Member
 
Registered: Oct 2003
Distribution: Red Hat 9
Posts: 103

Original Poster
Rep: Reputation: 15
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!!
 
  


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
Question of SHELL programing frankli Programming 11 07-01-2005 08:39 PM
Newbie programing question matthewa Programming 4 03-20-2005 04:37 PM
C programing question israel Programming 2 11-29-2004 06:05 AM
newbie kernel module programing question djgerbavore Programming 4 08-01-2004 04:38 PM
Question on programmERS, not programING MasterC Programming 5 09-01-2002 04:13 AM


All times are GMT -5. The time now is 01:06 AM.

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