Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

my fist lesson in C++ programing

Status
Not open for further replies.
hey guys i was talking to my cousin last night about computer and electronics and what not. and he asked me if he could teach me C++ i he wrote a simple "hello world" code. now all i have to do is compile it right.........well not i have this test.cpp and i dont know how to compile it. i am using linux mint (same thing as ubuntu) and i dont know how to compile it. i have tried some "tuts" on some website but it is very hard to write the command to compile it when they have different names and what not. does any one know what it would be.

i think is somthing like
gss test.cpp...................................... iv got nothing more

please help. and he made the .cpp file in nano ( to get to it you just type nano in the terminal)



thank you
 
Last edited:
Hmmm ?

hey guys i was talking to my cousin last night about computer and electronics and what not. and he asked me if he could teach me C++ i he wrote a simple "hello world" code. now all i have to do is compile it right.........well not i have this test.cpp and i dont know how to compile it. i am using linux mint (same thing as ubuntu) and i dont know how to compile it. i have tried some "tuts" on some website but it is very hard to write the command to compile it when they have different names and what not. does any one know what it would be.

i think is somthing like
gss test.cpp...................................... iv got nothing more

please help. and he made the .cpp file in nano ( to get to it you just type nano in the terminal)



thank you

So, when you got the lesson did you really have to use your fist. Would this involve Boxing or Karate.


C++ this Whack ! :D

Keep up the good work. David Good Luck !

kv :D

Edit: Wish I could help. I know zero about C++.
 
Last edited:
Maybe you should speak to Torben, PM him. He's linux fundi.

Oh heck, I hope he will not be angry with me for that.
 
So, when you got the lesson did you really have to use your fist. Would this involve Boxing or Karate.


C++ this Whack ! :D

Keep up the good work. David Good Luck !

kv :D

Edit: Wish I could help. I know zero about C++.

oh i get it fist i am wrote fist when i ment first............man iv been out of school for too long
 
Last edited:
Maybe you should speak to Torben, PM him. He's linux fundi.

Oh heck, I hope he will not be angry with me for that.

Hey, I still use XP. Er. . .sometimes. OK, so I hardly ever boot it up anymore. Oh well. It's still on the hard drive. Does that count? ;)

@David: Try this if you haven't already:

% apt-get install g++

That should install the C++ backend for gcc.

Note that I use Ubuntu, not Mint, but if the repositories are compatible that should do the trick.


Good luck,

Torben
 
Hey, I still use XP. Er. . .sometimes. OK, so I hardly ever boot it up anymore. Oh well. It's still on the hard drive. Does that count? ;)

@David: Try this if you haven't already:

% apt-get install g++

That should install the C++ backend for gcc.

Note that I use Ubuntu, not Mint, but if the repositories are compatible that should do the trick.


Good luck,

Torben

Ahhhhh, the grand master got wind of the situation. I never programmed in C. I'm not proud of that fact, just never got around to it I guess. I'm all assembler here.
 
Hey, I still use XP. Er. . .sometimes. OK, so I hardly ever boot it up anymore. Oh well. It's still on the hard drive. Does that count? ;)

@David: Try this if you haven't already:

% apt-get install g++

That should install the C++ backend for gcc.

Note that I use Ubuntu, not Mint, but if the repositories are compatible that should do the trick.


Good luck,

Torben

yeah i did that now its just the
g++ -o helloworld helloworld.cpp
 
David, it sounds like the g++ install might not have completed.

Can you post the results of the following commands?

% ls -l `which g++`

Note that the quotes in the line above are actually backticks, not quotes. On American keyboards it should be on the ~ key (upper left corner of the keyboard).

% dpkg --search g++.real

Also it might be helpful if you can post the contents of /etc/apt/sources.list so we can check that the repositories are set up right.


Torben
 
david@david-laptop ~ $ ls -l `which g++`
lrwxrwxrwx 1 root root 11 2008-08-15 13:11 /usr/bin/g++ -> builder-c++
david@david-laptop ~ $


david@david-laptop ~ $ dpkg --search g++.real
diversion by pentium-builder from: /usr/bin/g++
diversion by pentium-builder to: /usr/bin/g++.real
david@david-laptop ~ $
 
Last edited:
this is my sourses.list





## -----------------------
## LINUX MINT REPOSITORIES
## -----------------------

## +++ Linux Mint 5 Elyssa (stable) +++
deb **broken link removed** elyssa main upstream import

## +++ Backports (not as stable) +++
## deb **broken link removed** elyssa backport

## +++ Community (not as stable) +++
## deb **broken link removed** elyssa community

## +++ Romeo (unstable) +++
## deb **broken link removed** elyssa romeo

## +++ Source Repositories +++
## deb-src **broken link removed** elyssa main upstream import
## deb-src **broken link removed** elyssa community
## deb-src **broken link removed** elyssa backport
## deb-src **broken link removed** elyssa romeo

## -------------------
## UBUNTU REPOSITORIES
## -------------------

## +++ Ubuntu 8.04 Hardy (stable) +++
deb http://archive.ubuntu.com/ubuntu hardy main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu hardy-updates main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu hardy-security main restricted universe multiverse

## +++ Backports & Proposed (not as stable) +++
## deb http://archive.ubuntu.com/ubuntu hardy-backports main restricted universe multiverse
## deb http://archive.ubuntu.com/ubuntu hardy-proposed main restricted universe multiverse

## +++ Source Repositories +++
## deb-src http://archive.ubuntu.com/ubuntu hardy main restricted universe multiverse
## deb-src http://archive.ubuntu.com/ubuntu hardy-updates main restricted universe multiverse
## deb-src http://security.ubuntu.com/ubuntu hardy-security main restricted universe multiverse
## deb-src http://archive.ubuntu.com/ubuntu hardy-backports main restricted universe multiverse
## deb-src http://archive.ubuntu.com/ubuntu hardy-proposed main restricted universe multiverse

## ------------------
## OTHER REPOSITORIES
## ------------------

## +++ Canonical (stable) +++
deb http://archive.canonical.com/ubuntu hardy partner

## +++ Medibuntu (stable) +++
deb http://packages.medibuntu.org/ hardy free non-free
 
david@david-laptop ~ $ % ls -l `which g++`
bash: fg: %: no such job
david@david-laptop ~ $

david@david-laptop ~ $ % dpkg --search g++.real
bash: fg: %: no such job
david@david-laptop ~ $

Oh, sorry--the '%' is not part of the command; it's just the typical prompt indicator used in writing. You don't type it; just the stuff after it. It's like the 'C:\>' in DOS.


Torben
 
yeah.....i figured it out and edited it. so whats the problem

Not sure just yet but it looks like a broken installation of the pentium-builder package. How did you install it? Personally if it was my machine I'd uninstall pentium-builder and just install g++ instead, at least just to make sure it works.

There are some issues related to your problem listed in the Ubuntu bug database but they were supposedly fixed a year ago.


Torben
 
Not sure just yet but it looks like a broken installation of the pentium-builder package. How did you install it? Personally if it was my machine I'd uninstall pentium-builder and just install g++ instead, at least just to make sure it works.

There are some issues related to your problem listed in the Ubuntu bug database but they were supposedly fixed a year ago.


Torben

ok. i forgot how to do the uninstall code.
yeah i am just waiting for the next version of ubuntu to come out. olng story made short. there was a video card problem with my T41. and i just got really frustrated and just put mint on it. some one told me on the ubuntu forums that the problem would be fixed in the next version.

so if you could give me the code to uninstall pentium -builder and the installer for g++
 
ok. i forgot how to do the uninstall code.
yeah i am just waiting for the next version of ubuntu to come out. olng story made short. there was a video card problem with my T41. and i just got really frustrated and just put mint on it. some one told me on the ubuntu forums that the problem would be fixed in the next version.

so if you could give me the code to uninstall pentium -builder and the installer for g++

Hi David:

This should do it:

% apt-get remove pentium-builder

% apt-get install g++


Torben
 
No wonder I loved Turbo Pascal for DOS :D

:) Yeah, I used to have my programming environment on one 1.44MB floppy and my code tree on another. Moving from machine to machine was a total snap.


Torben
 
Hi David:

This should do it:

% apt-get remove pentium-builder

% apt-get install g++


Torben

david@david-laptop ~ $ apt-get remove pentium-builder
E: Could not open lock file /var/lib/dpkg/lock - open (13 Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
david@david-laptop ~ $
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top