LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How do I run C++? (https://www.linuxquestions.org/questions/linux-newbie-8/how-do-i-run-c-132167/)

laceupboots 01-06-2004 04:24 PM

How do I run C++?
 
I got a new computer and Mandrake 9.2 for Christmas. I have a dual boot, because the new comp came with a LT winmodem. Haven't made it to figuring out how to install drivers yet but I will.
I would like to use the C++ that came with Linux. I installed gcc2.96 and glibc. How do I run it? I would like to add it to the menu. I tried Menudrake but the software doesn't show up. I'm very new to Linux and any help would be appreciated. Then we can talk about drivers.........:confused:

Tinkster 01-06-2004 04:28 PM

You don't run gcc from a menu.... it's a command-line
tool.
you do
g++ <cpp source filename> -o <name of binary execuatable>

There are, however, graphical frontends to it .... kdevelop,
anjuta, ... have a look at http://freshmeat.net to find more.

Or, you can use emacs (vim) and compile from within it.


Cheers,
Tink

laceupboots 01-06-2004 08:25 PM

Thanks Tink. emacs does have a compiler, I don't know how to use it yet but it is there. I tried to install QT but I get an error message that says it cant be installed. I will post the message tomorrow.

Tinkster 01-06-2004 08:36 PM

Quote:

Originally posted by laceupboots
Thanks Tink. emacs does have a compiler, I don't know how to use it yet but it is there. I tried to install QT but I get an error message that says it cant be installed. I will post the message tomorrow.
Try <alt>+x compile :} and then tackle it from there.
I'd recommend using a Makefile, btw.


Cheers,
Tink

laceupboots 01-06-2004 08:57 PM

Quote:

Try <alt>+x compile :} and then tackle it from there.

I will try this. Can you tell me what this does? Does it create the object and Makefile create the executable?

Tinkster 01-06-2004 09:05 PM

Alt+x compile just opens a shell window within
emacs that will then execute the command you
type in. It defaults to make -f (which is why I
suggested to use a Makefile) ... emacs doesn't
create a Makefile for you. If you only enter
g++ <filename> g++ will create a file named
a.out in the same directory. gcc (g++) by default
doesn't create intermediate files like .o
man gcc
for more detail.


Cheers,
Tink


All times are GMT -5. The time now is 11:14 PM.