LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   LinuxAnswers Discussion (https://www.linuxquestions.org/questions/linuxanswers-discussion-27/)
-   -   DISCUSSION: Building C++ programs on Linux (https://www.linuxquestions.org/questions/linuxanswers-discussion-27/discussion-building-c-programs-on-linux-189760/)

hylke 06-04-2004 03:46 PM

DISCUSSION: Building C++ programs on Linux
 
This thread is to discuss the article titled: Building C++ programs on Linux

the_gripmaster 07-09-2004 05:41 PM

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

johnnyICON 09-30-2004 10:42 AM

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?

Tinkster 09-30-2004 06:23 PM

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


Cheers,
Tink

Donkey3000 10-01-2004 05:39 AM

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.

cryptowicked 12-03-2004 06:31 AM

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-

beliavsky 12-12-2004 07:58 AM

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.

akhot 01-18-2005 02:04 AM

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.

partha6794 11-01-2005 10:39 AM

"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

Ygrex 11-04-2005 04:53 AM

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).

fakie_flip 01-17-2006 06:12 PM

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?

swodniw 02-24-2006 12:16 PM

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,

Ygrex 02-24-2006 12:32 PM

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.

gemini728 06-14-2006 11:43 AM

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.

h3x0r 04-20-2007 06:43 AM

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!


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