LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 03-11-2005, 04:42 PM   #1
tsubasa
LQ Newbie
 
Registered: Mar 2005
Posts: 1

Rep: Reputation: 0
Cool Problems compiling in g++


hello, i'm using the g++ compiler but i can't run my programs.

i do this:

for example,

g++ -c helloworld.cpp

then:

g++ -static helloworld.o -o helloworld

this creates a program in binary format called helloworld but when write helloworld in command line, it throws 'bash: helloworld: command not found'.

please help me
 
Old 03-11-2005, 05:00 PM   #2
snecklifter
Member
 
Registered: Mar 2004
Location: UK/West Yorkshire/Huddersfield
Distribution: Fedora 7
Posts: 982

Rep: Reputation: 30
Probably one to get shunted by a mod to the programming forum but anyway, dont you need to compile/make this before you can run it?
 
Old 03-11-2005, 05:53 PM   #3
misc
Senior Member
 
Registered: Apr 2003
Distribution: Red Hat + Fedora
Posts: 1,084

Rep: Reputation: 54
Run it as ./helloworld because current working directory is not in standard search PATH.
 
  


Reply



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
Compiling problems jwilcox09 Linux - Software 7 03-19-2005 07:11 PM
Problems Compiling Problems With GCC And C++ phnxbn Linux - Software 0 11-02-2004 05:49 PM
Problems installing amsn (TK compiling problems) JNewton Linux - Software 0 05-24-2004 12:07 PM
Problems compiling! akasantos Fedora 8 11-13-2003 03:10 PM
Problems Compiling QT-3.0.3 X11 Linux - Software 3 06-11-2002 02:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 08:12 PM.

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
Open Source Consulting | Domain Registration