LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 07-17-2009, 09:49 PM   #1
SolitudeSensus
Member
 
Registered: May 2009
Posts: 73

Rep: Reputation: 15
Question c++ and g++


I tried to compile c++ source. By doing this:
g++ Example_1.cpp -o Example_1

It says that:
Example_1.cpp:9:2: warning: no newline at end of file

What does it mean?
My executable file runs even there is error but only in terminal.

If I click the file it doesn't open

I Opened the file in an editor, at the last line of the file,enserted enter to add a blank line to the end of the file.

Now there is no warning message.
But now also it doesn't open when I click it.

Is terminal only the option to execute it?

Last edited by SolitudeSensus; 07-17-2009 at 10:12 PM.
 
Old 07-18-2009, 12:10 AM   #2
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Quote:
Originally Posted by SolitudeSensus View Post
I tried to compile c++ source. By doing this:
g++ Example_1.cpp -o Example_1

It says that:
Example_1.cpp:9:2: warning: no newline at end of file

What does it mean?
My executable file runs even there is error but only in terminal.
Warnings are less severe than errors and don't usually prevent the code from being compiled. It means what it says - that you don't have a new line at the end of your source file. Perhaps it's set out in the standard that there should be a new line at the end of all source files, but I don't know.

Quote:
Is terminal only the option to execute it?
I assume the answer to this is yes, if all your program uses for "communication" is stdout, stdin and stderr. If you had some kind of GUI, perhaps then you'd be able to click on it and run it.
 
  


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



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

All times are GMT -5. The time now is 03:53 AM.

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