473,387 Members | 1,757 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.

Any tips on finding the problematic line of code?

Hello, when I compile my project I get this (after doing a complete
clean first):
$ make
g++ -Wall -W -ansi -pedantic -g3 -O0 -D_WIN32_WINNT=0x501
-D_WIN32_IE=0x600 -c common_dialogs.cpp
g++ -Wall -W -ansi -pedantic -g3 -O0 -D_WIN32_WINNT=0x501
-D_WIN32_IE=0x600 -c crc32.cpp
g++ -Wall -W -ansi -pedantic -g3 -O0 -D_WIN32_WINNT=0x501
-D_WIN32_IE=0x600 -c globals.cpp
g++ -Wall -W -ansi -pedantic -g3 -O0 -D_WIN32_WINNT=0x501
-D_WIN32_IE=0x600 -c main_window_procedure.cpp
g++ -Wall -W -ansi -pedantic -g3 -O0 -D_WIN32_WINNT=0x501
-D_WIN32_IE=0x600 -c sfv_list_view.cpp
In file included from
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/sstream:640,
from sfv_list_view.cpp:8:
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/sstream.tcc: In
member function `virtual typename std::basic_stringbuf<_CharT, _Traits,
_Alloc>::int_type std::basic_stringbuf<_CharT, _Traits,
_Alloc>::overflow(typename _Traits::int_type)':
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/sstream.tcc:102:
error: expected unqualified-id before '(' token
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/sstream.tcc:104:
error: expected unqualified-id before '(' token
sfv_list_view.cpp: At global scope:
sfv_list_view.cpp:184: warning: unused parameter 'arg'
make: *** [sfv_list_view.o] Error 1

It seems to be a problem involving how stringstreams are used in
sfv_list_view.cpp but all error messages point to the implementation
files of the standard library. Any tips on finding the offending line
of code that triggers all these obscure error messages deep inside
libstdc++ other than commenting things out (which may or may not be
easy to do)?

/ E

Jul 1 '06 #1
3 6233

Eric Lilja wrote:
Hello, when I compile my project I get this (after doing a complete
clean first):
$ make
g++ -Wall -W -ansi -pedantic -g3 -O0 -D_WIN32_WINNT=0x501
-D_WIN32_IE=0x600 -c common_dialogs.cpp
g++ -Wall -W -ansi -pedantic -g3 -O0 -D_WIN32_WINNT=0x501
-D_WIN32_IE=0x600 -c crc32.cpp
g++ -Wall -W -ansi -pedantic -g3 -O0 -D_WIN32_WINNT=0x501
-D_WIN32_IE=0x600 -c globals.cpp
g++ -Wall -W -ansi -pedantic -g3 -O0 -D_WIN32_WINNT=0x501
-D_WIN32_IE=0x600 -c main_window_procedure.cpp
g++ -Wall -W -ansi -pedantic -g3 -O0 -D_WIN32_WINNT=0x501
-D_WIN32_IE=0x600 -c sfv_list_view.cpp
In file included from
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/sstream:640,
from sfv_list_view.cpp:8:
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/sstream.tcc: In
member function `virtual typename std::basic_stringbuf<_CharT, _Traits,
_Alloc>::int_type std::basic_stringbuf<_CharT, _Traits,
_Alloc>::overflow(typename _Traits::int_type)':
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/sstream.tcc:102:
error: expected unqualified-id before '(' token
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/sstream.tcc:104:
error: expected unqualified-id before '(' token
sfv_list_view.cpp: At global scope:
sfv_list_view.cpp:184: warning: unused parameter 'arg'
make: *** [sfv_list_view.o] Error 1

It seems to be a problem involving how stringstreams are used in
sfv_list_view.cpp but all error messages point to the implementation
files of the standard library. Any tips on finding the offending line
of code that triggers all these obscure error messages deep inside
libstdc++ other than commenting things out (which may or may not be
easy to do)?

/ E


Ok, this particular problem was caused by include order...

Jul 1 '06 #2
Eric Lilja wrote:
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/sstream.tcc:102:
error: expected unqualified-id before '(' token


Next time, look that line up and paste it into this post.

The line contains std::max(

Some systems also define max as a macro.

Go to sfv_list_view.cpp:7:, above the #include <sstream>, and add this:

#undef max

That's just a guess, so report back if it doesn't work.

--
Phlip
http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!!
Jul 1 '06 #3

Phlip wrote:
Eric Lilja wrote:
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/sstream.tcc:102:
error: expected unqualified-id before '(' token

Next time, look that line up and paste it into this post.

The line contains std::max(

Some systems also define max as a macro.

Go to sfv_list_view.cpp:7:, above the #include <sstream>, and add this:

#undef max

That's just a guess, so report back if it doesn't work.
FWIW the *acceptable* way to deal with this situation (courtesy of the
gurus at http://www.boost.org) is as follows:

// crappy hackers macro
#define min(a,b) (((a) < (b)) ? (a) : (b))

struct my{
typedef int min;
};

int main()
{
//###################################
// int n = my::min(); // Error
//###################################
#define PREVENT_MACRO_SUBSTITUTION
int n = my::min PREVENT_MACRO_SUBSTITUTION (); // OK
}

The boost version in <boost/config.hppis called
BOOST_PREVENT_MACRO_SUBSTITUTION and is worth using so the gurus
understand what you mean when they read your code.

regards
Andy Little

Jul 1 '06 #4

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

Similar topics

3
by: Noam Dekers | last post by:
Hi all, I would like to find a word stored in a text file. Structure: I have one file named keyWords.txt that stores some key words I'm interested in finding. In addition I also have a file...
0
by: Mike Chirico | last post by:
Interesting Things to Know about MySQL Mike Chirico (mchirico@users.sourceforge.net) Copyright (GPU Free Documentation License) 2004 Last Updated: Mon Jun 7 10:37:28 EDT 2004 The latest...
2
by: Panchi51 | last post by:
Hi, Below is a collection of tips/tricks/caveats for LP64 c coding, full text is at http://www.cs.albany.edu/~mosh/Text/c-ref.txt. Hope it helps, corrections welkome. --...
7
by: Cheryl Langdon | last post by:
Does anyone know if there is a way to globally turn off ALL control tips in Access 2003 using VBA code? Thanks. --- CL
1
by: metaperl.etc | last post by:
In this traceback, the path to 3 different SQL Alchemy source files is a relative directory. However, no such directory is below my current working directory. This is problematic for two...
3
by: Mark C | last post by:
Hi I was in the progress of developing a web site whereby developers can do free online tests on various programming languages. After initial feedback I managed to fix quite a few issues and...
31
by: JoeC | last post by:
I have read books and have ideas on how to create objects. I often create my own projects and programs. They end up getting pretty complex and long. I often use objects in my programs they are...
10
by: sklett | last post by:
I have a situation where I'm getting in Image that has a gray (solid, same color) background with a smaller white rectangle inside. The position is not always the same. What I need to do is...
0
NeoPa
by: NeoPa | last post by:
Table of Contents - Previous Chapter - ----------------------------------------------------------------------------------------------- 3) General Tips. The first and most important tip is...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.