473,657 Members | 2,530 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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=0 x501
-D_WIN32_IE=0x60 0 -c common_dialogs. cpp
g++ -Wall -W -ansi -pedantic -g3 -O0 -D_WIN32_WINNT=0 x501
-D_WIN32_IE=0x60 0 -c crc32.cpp
g++ -Wall -W -ansi -pedantic -g3 -O0 -D_WIN32_WINNT=0 x501
-D_WIN32_IE=0x60 0 -c globals.cpp
g++ -Wall -W -ansi -pedantic -g3 -O0 -D_WIN32_WINNT=0 x501
-D_WIN32_IE=0x60 0 -c main_window_pro cedure.cpp
g++ -Wall -W -ansi -pedantic -g3 -O0 -D_WIN32_WINNT=0 x501
-D_WIN32_IE=0x60 0 -c sfv_list_view.c pp
In file included from
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/sstream:640,
from sfv_list_view.c pp:8:
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/sstream.tcc: In
member function `virtual typename std::basic_stri ngbuf<_CharT, _Traits,
_Alloc>::int_ty pe std::basic_stri ngbuf<_CharT, _Traits,
_Alloc>::overfl ow(typename _Traits::int_ty pe)':
/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.c pp: At global scope:
sfv_list_view.c pp: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.c pp 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 6254

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=0 x501
-D_WIN32_IE=0x60 0 -c common_dialogs. cpp
g++ -Wall -W -ansi -pedantic -g3 -O0 -D_WIN32_WINNT=0 x501
-D_WIN32_IE=0x60 0 -c crc32.cpp
g++ -Wall -W -ansi -pedantic -g3 -O0 -D_WIN32_WINNT=0 x501
-D_WIN32_IE=0x60 0 -c globals.cpp
g++ -Wall -W -ansi -pedantic -g3 -O0 -D_WIN32_WINNT=0 x501
-D_WIN32_IE=0x60 0 -c main_window_pro cedure.cpp
g++ -Wall -W -ansi -pedantic -g3 -O0 -D_WIN32_WINNT=0 x501
-D_WIN32_IE=0x60 0 -c sfv_list_view.c pp
In file included from
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/sstream:640,
from sfv_list_view.c pp:8:
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/sstream.tcc: In
member function `virtual typename std::basic_stri ngbuf<_CharT, _Traits,
_Alloc>::int_ty pe std::basic_stri ngbuf<_CharT, _Traits,
_Alloc>::overfl ow(typename _Traits::int_ty pe)':
/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.c pp: At global scope:
sfv_list_view.c pp: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.c pp 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.c pp: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.c pp: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_S UBSTITUTION
int n = my::min PREVENT_MACRO_S UBSTITUTION (); // OK
}

The boost version in <boost/config.hppis called
BOOST_PREVENT_M ACRO_SUBSTITUTI ON 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
13786
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 named textOrigin.txt in which I store the text to search in. I would like my prog to check if a certain word appears in the text and than to tell me what line it found it in (if it did...). My problem is that the script can't find the words I'm...
0
3940
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 version of this document can be found at: http://prdownloads.sourceforge.net/souptonuts/README_mysql.txt?download
2
5735
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. -- Panchi51<et>pacbell.net LP64 Gotcha List ----------------
7
2395
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
1160
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 reasons: 1 - I cannot use XEmacs find-file-at-point to find the file in which the error is occurring 2 - I am not really sure where the source file is that is causing problems because tha path could be relative to anything.
3
1392
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 changed the look and feel. I would just like some futher comments\tips\hints or feedback The site is http://www.quiznetonline.com
31
3181
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 some of the most powerful programming tools I have found. Often times as my program grows so do my objects. Often times I look back and see that my objects could be broken down int several smaller more re-usable module pieces of code. Is it a...
10
3695
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 locate the postion and determine the size fo the white rectangle and then crop the image to leave only the white rectangle remaining. I'm very new to GDI+ and have really no idea where to start. Can anyone suggest a good way to accomplish this? ...
0
6799
NeoPa
by: NeoPa | last post by:
Table of Contents - Previous Chapter - ----------------------------------------------------------------------------------------------- 3) General Tips. The first and most important tip is always to work with a compiled project. Many of the problems you're likely to come across are identified during the compile process. Compile from the VBA IDE (Integrated Development Environment) by selecting Debug | Compile {Project name}. If you...
0
8421
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8844
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8621
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7354
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6177
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2743
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1971
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.