473,387 Members | 1,779 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to read errors?

Each time I compile my program I get something like this:

g++ -trigraphs -o draw main.cpp -lGL -lGLU -lglut -lX11 -lm -I../src
In file included from solution/print.h:6,
from solution/rasterizer.h:10,
from main.cpp:26:
solution/rasterizer.h:328:7: warning: no newline at end of file
In file included from main.cpp:26:
solution/rasterizer.h:328:7: warning: no newline at end of file
In file included from main.cpp:30:
solution/fragment_program.h:38:7: warning: no newline at end of file
solution/rasterizer.h: In member function ‘void
graphics::MyRasterizer<math_types>::init(const typename
math_types::vector3_type&, const typename math_types::vector3_type&,
const typename math_types::vector3_type&, const typename
math_types::vector3_type&, const typename math_types::vector3_type&,
const typename math_types::vector3_type&, const typename
math_types::vector3_type&, const typename math_types::vector3_type&,
const typename math_types::vector3_type&)’:
solution/rasterizer.h:145: error: expected `)' before ‘{’ token
solution/rasterizer.h: In member function ‘void
graphics::MyRasterizer<math_types>::init(const typename
math_types::vector3_type&, const typename math_types::vector3_type&,
const typename math_types::vector3_type&, const typename
math_types::vector3_type&, const typename math_types::vector3_type&,
const typename math_types::vector3_type&, const typename
math_types::vector3_type&, const typename math_types::vector3_type&,
const typename math_types::vector3_type&) [with math_types =
graphics::MyMathTypes]’:
main.cpp:200: instantiated from here
solution/rasterizer.h:136: warning: converting to ‘int’ from ‘float’
solution/rasterizer.h:137: warning: converting to ‘int’ from ‘float’
solution/rasterizer.h:138: warning: converting to ‘int’ from ‘float’
main.cpp:200: instantiated from here
solution/rasterizer.h:140: warning: converting to ‘int’ from ‘float’
solution/rasterizer.h: In member function ‘Line
graphics::MyRasterizer<math_types>::createLine(typ ename
math_types::vector3_type, typename math_types::vector3_type,
std::string) [with math_types = graphics::MyMathTypes]’:
solution/rasterizer.h:115: instantiated from ‘void
graphics::MyRasterizer<math_types>::init(const typename
math_types::vector3_type&, const typename math_types::vector3_type&,
const typename math_types::vector3_type&, const typename
math_types::vector3_type&, const typename math_types::vector3_type&,
const typename math_types::vector3_type&, const typename
math_types::vector3_type&, const typename math_types::vector3_type&,
const typename math_types::vector3_type&) [with math_types =
graphics::MyMathTypes]’
main.cpp:200: instantiated from here
solution/rasterizer.h:171: warning: converting to ‘int’ from ‘float’
solution/rasterizer.h:172: warning: converting to ‘int’ from ‘float’
solution/rasterizer.h:173: warning: converting to ‘int’ from ‘float’
solution/rasterizer.h:174: warning: converting to ‘int’ from ‘float’
make: *** [main] Error 1

In this case I got an error because of a missing matching parenthesis.
But each time I use a rather large amount of time finding the above
errormessage.

Is there someway to compile with the option that only errormessages will
be shown?
Sep 29 '07 #1
6 1256
On Sat, 29 Sep 2007 19:40:22 +0200, desktop <ff*@sss.comwrote:
>Each time I compile my program I get something like this:
[~50 lines snipped]
>In this case I got an error because of a missing matching parenthesis.
But each time I use a rather large amount of time finding the above
errormessage.

Is there someway to compile with the option that only errormessages will
be shown?
Avoid templates (templated libraries) and the error messages will
become civilized again.
--
Roland Pibinger
"The best software is simple, elegant, and full of drama" - Grady Booch
Sep 29 '07 #2
use -w option.

Sep 29 '07 #3
On 2007-09-29 20:06, Roland Pibinger wrote:
On Sat, 29 Sep 2007 19:40:22 +0200, desktop <ff*@sss.comwrote:
>>Each time I compile my program I get something like this:

[~50 lines snipped]
>>In this case I got an error because of a missing matching parenthesis.
But each time I use a rather large amount of time finding the above
errormessage.

Is there someway to compile with the option that only errormessages will
be shown?

Avoid templates (templated libraries) and the error messages will
become civilized again.
Or (if running Windows) use VC++ 8 or better, it produces much better
error messages for templates. Though it still can spew out lots of lines
at least it is a lot more readable than what g++ will give you.

Another tips to the OP, if you get many error messages just fix the
first and compile again. Often most of the error messages are because
the compiler never really "recovered" from the first error.

--
Erik Wikström
Sep 29 '07 #4
ya*********@gmail.com wrote:
use -w option.
Thanks, that helped even though it did not completely eliminate all the
template garbage when an error is made.
Sep 29 '07 #5
... if you get many error messages just fix the
first and compile again.
That is excellent advice. Also Item 49 in Scott Meyers' wonderful book
"Effective STL" is "Learn to decipher STL-related compiler diagnostics." It
helped me immensely.

--
Chuck
Sep 30 '07 #6
desktop wrote:
Each time I compile my program I get something like this:

g++ -trigraphs -o draw main.cpp -lGL -lGLU -lglut -lX11 -lm -I../src
In file included from solution/print.h:6,
from solution/rasterizer.h:10,
from main.cpp:26:
solution/rasterizer.h:328:7: warning: no newline at end of file
In file included from main.cpp:26:
solution/rasterizer.h:328:7: warning: no newline at end of file
In file included from main.cpp:30:
solution/fragment_program.h:38:7: warning: no newline at end of file
solution/rasterizer.h: In member function ‘void
graphics::MyRasterizer<math_types>::init(const typename
math_types::vector3_type&, const typename math_types::vector3_type&,
const typename math_types::vector3_type&, const typename
math_types::vector3_type&, const typename math_types::vector3_type&,
const typename math_types::vector3_type&, const typename
math_types::vector3_type&, const typename math_types::vector3_type&,
const typename math_types::vector3_type&)’:
solution/rasterizer.h:145: error: expected `)' before ‘{’ token
solution/rasterizer.h: In member function ‘void
graphics::MyRasterizer<math_types>::init(const typename
math_types::vector3_type&, const typename math_types::vector3_type&,
const typename math_types::vector3_type&, const typename
math_types::vector3_type&, const typename math_types::vector3_type&,
const typename math_types::vector3_type&, const typename
math_types::vector3_type&, const typename math_types::vector3_type&,
const typename math_types::vector3_type&) [with math_types =
graphics::MyMathTypes]’:
main.cpp:200: instantiated from here
solution/rasterizer.h:136: warning: converting to ‘int’ from ‘float’
solution/rasterizer.h:137: warning: converting to ‘int’ from ‘float’
solution/rasterizer.h:138: warning: converting to ‘int’ from ‘float’
main.cpp:200: instantiated from here
solution/rasterizer.h:140: warning: converting to ‘int’ from ‘float’
solution/rasterizer.h: In member function ‘Line
graphics::MyRasterizer<math_types>::createLine(typ ename
math_types::vector3_type, typename math_types::vector3_type,
std::string) [with math_types = graphics::MyMathTypes]’:
solution/rasterizer.h:115: instantiated from ‘void
graphics::MyRasterizer<math_types>::init(const typename
math_types::vector3_type&, const typename math_types::vector3_type&,
const typename math_types::vector3_type&, const typename
math_types::vector3_type&, const typename math_types::vector3_type&,
const typename math_types::vector3_type&, const typename
math_types::vector3_type&, const typename math_types::vector3_type&,
const typename math_types::vector3_type&) [with math_types =
graphics::MyMathTypes]’
main.cpp:200: instantiated from here
solution/rasterizer.h:171: warning: converting to ‘int’ from ‘float’
solution/rasterizer.h:172: warning: converting to ‘int’ from ‘float’
solution/rasterizer.h:173: warning: converting to ‘int’ from ‘float’
solution/rasterizer.h:174: warning: converting to ‘int’ from ‘float’
make: *** [main] Error 1

In this case I got an error because of a missing matching parenthesis.
But each time I use a rather large amount of time finding the above
errormessage.

Is there someway to compile with the option that only errormessages will
be shown?
uncomment the lines that likely to produce compile time error,
then you can locate the exact place where you write the code wrong.

so don't wait to compile until you write a lot of new complicated code.
Sep 30 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Sean | last post by:
The error message: 0x791f0d83 referenced memory at 0x0000000003. The memory could not be "read". Click OK to terminate and Cancel to debug. When I debug, it states that it is an unhandled...
0
by: James Hokes | last post by:
Hi All, We're using the 1.1. Framework against SQL Server 2000, and are having a strange issue where we don't get errors back from the stored procedure, i.e. the exception never gets thrown. ...
2
by: hvaisane | last post by:
Valgrind says ==11604== Invalid read of size 4 ==11604== at 0x8048ABB: main (foo.cc:36) ==11604== Address 0x1B92415C is 4 bytes inside a block of size 8 free'd ==11604== at 0x1B90514F:...
3
by: Dave Coate | last post by:
Hello again, I am going to re-post a question. I got some excellent suggestions from Rob and Mattias on this but their ideas did not solve the problem. Here is the original post: ...
8
by: dbuchanan | last post by:
Hello, What does this error mean? "The event click is read-only and cannot be changed" This is a design-time error. It is displayed instead of the form. Here is the full text \\ "One or...
2
by: Ilkka | last post by:
I have created an C++ application with Windows Forms, ADO and SQL server 2005. Now I need to change something and started debugging the code. Then suddenly I receive an error. "An unhandled...
9
by: Justme | last post by:
Novice programmer needs help with using fgets to read and ignore the first two lines of a file. I've gone thru the previous posting regarding fgets, but none of them seems to help my situation. I...
9
by: =?Utf-8?B?TWlrZQ==?= | last post by:
Hi. Is it programatically possible in VB.NET to read the contents of web.config's <customErrorselement? I looked at using ConfigurationSettings.AppSettings, but that doesn't work. I need to...
7
by: Igor | last post by:
1. In this topic...
2
by: brigitte | last post by:
I have installed the front end for my database on several machines (the front end is an mde), which links to a back end on a network drive all my users have access to. To prevent mapping errors,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.