LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General > LinuxAnswers Discussion
User Name
Password
LinuxAnswers Discussion This forum is to discuss articles posted to LinuxAnswers.

Notices

Reply
 
Search this Thread
Old 06-04-2004, 03:46 PM   #1
hylke
Member
 
Registered: Apr 2004
Location: the Netherlands
Distribution: Ubuntu 7.04
Posts: 329

Rep: Reputation: 30
Post DISCUSSION: Building C++ programs on Linux


This thread is to discuss the article titled: Building C++ programs on Linux
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 07-09-2004, 05:41 PM   #2
the_gripmaster
Member
 
Registered: Jul 2004
Location: VIC, Australia
Distribution: RHEL, CentOS, Ubuntu Server, Ubuntu
Posts: 356

Rep: Reputation: 38
This article does not say how you execute the binary "HelloWorld". You do it by typing the following in the shell (dont type %, it is the shell prompt) and hitting enter or return:

% ./HelloWorld
 
Old 09-30-2004, 10:42 AM   #3
johnnyICON
Member
 
Registered: Aug 2004
Posts: 32

Rep: Reputation: 15
I have heard of Oracle 9, not too sure what it is but from what I've read it's a C++ developer application right?

What other C++ applications are available, and which would you suggest?
 
Old 09-30-2004, 06:23 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,974
Blog Entries: 11

Rep: Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879
Oracle is a database engine/server that happens to have
APIs ... it's not a C++ development tool.


Cheers,
Tink
 
Old 10-01-2004, 05:39 AM   #5
Donkey3000
LQ Newbie
 
Registered: Oct 2004
Location: Netherlands,Hilversum
Distribution: Ubuntu
Posts: 5

Rep: Reputation: 0
Yeah, Oracle is a database like mysql and ms access. However there is some higher level (4gl) development tool for and by Oracle. So maybe that got you confused.
---

I think this article or how to was a bit short. I clicked on it to find information on how to start programming for Linux.

I would have like to read not a simple sample of hello world as that's basically the same on any platform. But I wanted to know whats better KDE(QT) or GNOME (GTK) and what frameworks and libs are good and from a developers point of view but also from a end users point of view.

Basically what I need to start working on a modern application for Linux and the pro's and cons of certain frameworks.
 
Old 12-03-2004, 06:31 AM   #6
cryptowicked
LQ Newbie
 
Registered: Dec 2004
Distribution: Mandrake
Posts: 8

Rep: Reputation: 0
how do you exit out of the edit file? I write the source and then i save it, but how do i exit back into the user shell?
--noob tryin to rtfm--
cryptowicked-
 
Old 12-12-2004, 07:58 AM   #7
beliavsky
LQ Newbie
 
Registered: Dec 2004
Posts: 7

Rep: Reputation: 8
please fix spelling and grammar mistakes

The description of your tutorial says:

"I've seen the howto of crabboy so i thought, maybe its fun to make one in c++. This is just some verry basics of c++. Suchs ass printing text, some variables and stuff like that."

There are many English mistakes in this. "its" should be "it's". "This is" should be "These are". "verry" should be "very". "suchs" should be "such". "ass" should definitely be "as"! "c++" should be "C++". Here is a more concise and correct version:

"I've seen the howto of crabboy and thought it would be fun to make one in C++. These are just some basics of C++, such as printing text, some variables and stuff like that."

I am trying to be helpful. People are more likely to spend time on your content when your grammar, spelling, and general usage of English are adequate.
 
2 members found this post helpful.
Old 01-18-2005, 02:04 AM   #8
akhot
LQ Newbie
 
Registered: Jan 2005
Location: Bangalore,India
Posts: 1

Rep: Reputation: 0
One quick way to build is ( given the source file is tst.cpp )

$ make tst

g++ tst.cpp -o tst

make is intelligent about what to do now ( it will invoke the g++ compiler ).
This works on almost all unix platforms.

If you want to pass options use the CXXFLAGS make variable

$ make tst CXXFLAGS=-g
g++ -g tst.cpp -o tst

Now if you are using vim for editing the files, this becomes even simpler:

$ vim tst.cpp

:make tst

this invokes the compiler for you.

To run it just come out of vim with a Ctrl-Z

./tst

$ fg

takes you back to your editing session.
 
Old 11-01-2005, 10:39 AM   #9
partha6794
LQ Newbie
 
Registered: Oct 2005
Location: calcutta , India
Distribution: RED HAT/FC
Posts: 5

Rep: Reputation: 0
"C" PROGRAMMING IN RHL9.0/F.C

There is a easy method to bulid "C" & "C ++ " programming:

There are three methods to bulid "C" & "C++" programming in RHL 9.0 & FC .by using GNOME desktop & another in KDE .
There are mainly two editor in GNOME , viz. vi- editor & another is emacs editor.I will discuss both here.



using VI-editor:

1. open terminal .
2. type for C programming
vi <filename>.c

for C++
vi <filename>.cpp

e.g:

vi hello.c { for C}
vi hello. cpp { for C++}

3. then type " i" ( i= insert)
4. then write source code . for details www.howstuffworks.com how to works "C" programming?
5. then press
esc : wq
it is save now.

6. now for comile the programme type,
cc <filename>
7. then for execute type
(dot)/a.out ( dot = . )

8. then it will see your screen.


USING EMACS EDITOR:

1.type emacs<file name> on terminal.
3. then type " i" ( i= insert)
4. then write source code . for details www.howstuffworks.com how to works "C" programming?
5. then press
esc : wq
it is save now.

6. now for comile the programme type,
cc <filename>
7. then for execute type
(dot)/a.out ( dot = . )

8. then it will see your screen.


USING KWRITE IN ( GNOME OR KDE DESKTOP)

1. Open terminal & type kwrite
2. then write source code
3. then click file .
4. then clck save as
5. save the file wtth extension .c/.cpp
now for comile the programme type,
cc <filename>
7. then for execute type
(dot)/a.out ( dot = . )


I hope it will helpful .


If you face any diffuculty u can email me
partha_26786794123@yahoo.com , ( for alert reply here)

partha
 
Old 11-04-2005, 04:53 AM   #10
Ygrex
Member
 
Registered: Nov 2004
Location: Russia (St.Petersburg)
Distribution: Debian
Posts: 666

Rep: Reputation: 68
IMHO this article is intended for complete newbies in the C++ development. So I
think it is good to explain how to create a Makefile and why almost any source
one can download will contain this file (sometimes after configure executing).
 
Old 01-17-2006, 06:12 PM   #11
fakie_flip
Senior Member
 
Registered: Feb 2005
Location: san antonio, texas
Distribution: Fedora 64 bit RAID0 + LUKS, CentOS (server), Backtrack, Gentoo Hardened
Posts: 1,440

Rep: Reputation: 80
Can someone tell me a guide or howto for making c++ programs in linux that use the qt library for graphics. I want to make some c++ programs in linux with gui. What are the commands to compile a c++ program that uses qt?
 
Old 02-24-2006, 12:16 PM   #12
swodniw
Member
 
Registered: Jan 2006
Posts: 35

Rep: Reputation: 16
Quote:
Originally Posted by Ygrex
IMHO this article is intended for complete newbies in the C++ development. So I
think it is good to explain how to create a Makefile and why almost any source
one can download will contain this file (sometimes after configure executing).
I don't have a problem writing C++ code but I was also looking for info on make files, Does anybody have any good links(i.e. for a linux noob)?
Thank you,
 
Old 02-24-2006, 12:32 PM   #13
Ygrex
Member
 
Registered: Nov 2004
Location: Russia (St.Petersburg)
Distribution: Debian
Posts: 666

Rep: Reputation: 68
Yes, making configure/Makifile is a complex task and I never saw a good
documentation for its solution. I learned it by examples. But if you take
Makefile, which was created by autoconf/automake, it is highly probable
you will understand nothing. A good way to learn Makefile is to read ready
handmade files.

Now I'm trying to conceive autotools and it is not well documented too. Alas.
These info pages are not tutorials.
 
Old 06-14-2006, 11:43 AM   #14
gemini728
Member
 
Registered: Sep 2003
Posts: 57

Rep: Reputation: 15
I kept getting an error when trying to compile the "Hello World" code. Then I read somewhere that there must be a library (or whatever it is called) listed after the include statement at the top of the code. When I added <iostream>, then it worked. It would be great if the tutorials were proofed by someone for errors.
 
Old 04-20-2007, 06:43 AM   #15
h3x0r
LQ Newbie
 
Registered: Mar 2007
Location: 10.1.1.1
Distribution: Crux[main],Gentoo[Experimental]
Posts: 28

Rep: Reputation: 15
yes indeed, you wrote:
"cin << name; means: Put the input of the user in the variable called name(we use created it)."
When using cin (pronounced see-in (for n00bs)) your extracting data from the keyboard (or watever input method the stdlib is handling) into the variable "name" (on the program stack), so you should be using the extractor (>>) instead of << although your code showed this your explanation didnt and might confuse alot of n00bs.

0th3w1z3 n1c3 w02K!

Last edited by h3x0r; 04-20-2007 at 06:45 AM.
 
  


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
DISCUSSION: Building C programs on Linux crabboy LinuxAnswers Discussion 29 09-04-2013 10:19 AM
DISCUSSION: Building a Slackware Wireless Access Point eric.r.turner LinuxAnswers Discussion 11 09-09-2006 01:36 AM
DISCUSSION: ssh w/ gtk programs (host-client display export) mrchaos LinuxAnswers Discussion 1 12-14-2005 01:50 PM
DISCUSSION: Compiling Programs from Source jeremy LinuxAnswers Discussion 51 11-21-2005 04:35 AM
DISCUSSION: Virtual Filesystem: Building a Linux Filesystem from an Ordinary File mchirico LinuxAnswers Discussion 0 10-28-2004 10:35 PM


All times are GMT -5. The time now is 08:23 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration