Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 11-08-2003, 12:51 AM   #1
LQ Newbie
Registered: Nov 2003
Location: St. Louis, MO
Distribution: remote connection to linux server
Posts: 2

Rep: Reputation: 0
adding new line at end of file

I am trying to add a new line at the end of my main.cpp file. This is a result of a compiler error that says i do not have a new line at the end of the file. What code do I add to my file to make it complile?
Old 11-08-2003, 02:53 AM   #2
Registered: Sep 2003
Distribution: Slackware 10 w/ Kernel 2.6.8
Posts: 176

Rep: Reputation: 30
try checking your brackets "{}" make shure they all have matchs
Old 11-08-2003, 04:45 AM   #3
Senior Member
Registered: Nov 2002
Location: Silly Con Valley
Distribution: Red Hat 7.3, Red Hat 9.0
Posts: 2,054

Rep: Reputation: 46
it's not a compiler error but a warning (at least for me). gcc seems to like having a newline at the end of source files but it doesn't affect the compilation. just open up your source file in an editor and set the cursor to the end of the file and press the enter key. that should get rid of that warning.
Old 11-08-2003, 05:27 AM   #4
Registered: Sep 2003
Distribution: Slackware 10 w/ Kernel 2.6.8
Posts: 176

Rep: Reputation: 30
well you file is *.cpp try using g++ instead


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
No new line at end of file? What does this mean? BajaNick Programming 12 05-19-2014 09:39 PM
Deleting empty line at end of text file in BASH human2.0 Linux - General 8 04-01-2009 03:44 AM
C: fread to read a file line by line until the end Blue_muppet Programming 2 09-19-2008 10:42 AM
[SOLVED] delete the end of each line in a file with sed angel115 Linux - Newbie 3 11-16-2005 05:41 PM
read the input file from the specified line no till end suchi_s Programming 5 09-09-2004 05:36 AM > Forums > Non-*NIX Forums > Programming

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

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration