LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-11-2004, 05:30 AM   #16
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.3, Oracle Linux, Mint
Posts: 9,716

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422

Quote:
does anybody know what (no newline at end of file) means?
That means that there is no newline at the end of the source file compiled.

You are likely using a (buggy?) editor that doesn't finish the last line by a "newline" aka line-feed character under unix.

Use vi or one of its clones, and this will stop bothering you.
 
Old 09-11-2004, 10:43 AM   #17
kahn
Member
 
Registered: Feb 2004
Location: Seattle
Distribution: FC5
Posts: 109

Rep: Reputation: 15
i wrote a bunch of programs at work in notepad
then brought them home to compile them on my linux machine

can i get vi for windows? lol...

thanks satimis, i will have to try that

kahn
 
Old 09-11-2004, 10:49 AM   #18
itsme86
Senior Member
 
Registered: Jan 2004
Location: Oregon, USA
Distribution: Slackware
Posts: 1,246

Rep: Reputation: 59
You can get nano for Windows. I love nano

http://www.nano-editor.org/
 
Old 09-11-2004, 11:34 AM   #19
gr33ndata
Member
 
Registered: Aug 2003
Location: DMZ
Distribution: Ubuntu
Posts: 144

Rep: Reputation: 15
Hi pals

1- To be able to run a programme from anywhere, you myst add it's path into the environmental variable, or for simplisity copy your executable (a.out in your case) into /bin or /use/bin ... etc

2- You can order your compiler to rename your executable output to some meaningful name by the command -o So gcc main.c -o MyProggie will call your output MyProggie instead of a.out

3- -lm -> -l is used for linking with external libraries (something like dll, etc), So in your case I think m is a maths library and they used -lm to link to it.
 
Old 09-12-2004, 06:00 AM   #20
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.3, Oracle Linux, Mint
Posts: 9,716

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
Quote:
i wrote a bunch of programs at work in notepad
then brought them home to compile them on my linux machine

can i get vi for windows? lol...
Yes, notepad is one of these buggy editors that do not end the last line.

You can get a bunch of vi clones for windows.
 
Old 09-12-2004, 07:15 PM   #21
tim1235
Member
 
Registered: Aug 2004
Location: Melbourne, Australia
Distribution: fc5/Gentoo
Posts: 57

Rep: Reputation: 15
You can run your compiled programs with ./program_name If you are in the same directory as the executable.
This is needed for all executables unless a path is specified in you environment. i.e If you have all you compiled programs in:

/home/uname/bin/

and then set you path variables $PATH=/home/uname/bin

you could then run the executables by just the filename i.e helloworld

P.S

Check man gcc for the option -lm as well as various others
 
  


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
Ubuntu Fluxbox simple question, simple answer? generallimptoes Linux - Software 3 09-26-2005 03:03 PM
Installing Programs - A simple question from my simple mind jmp875 Linux - Newbie 6 02-18-2004 10:03 PM
Hopefully a Simple Question Arcane Kidd Linux - Newbie 5 01-17-2003 05:27 PM
Really Simple Question -- Please help! Cia420 Linux - General 3 05-07-2002 07:42 AM
simple question seeking simple answer enzo250gto Linux - Newbie 1 10-27-2001 05:08 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:09 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration