Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > throws different exceptions

Reply
Thread Tools

throws different exceptions

 
 
JohnC
Guest
Posts: n/a
 
      05-12-2008
Hello people...

Just for clarification, I'm a C++ newbie, and not really into
programming in C++. I was trying to get
an open source C++ program to compile (the author didn't respond yet)
and get the following problem:

In 'string.h' (included with the program):

line 47:
extern char *strcasestr(const char *haystack, const char *needle);

In 'string.cpp' (again, included)

line 30:
char *strcasestr(const char *haystack, const char *needle);

line 224:
char *strcasestr(const char *haystack, const char *needle)
{..code of the function... No exception is defined...}

Compiling this gives:

Compiling module string.o
string.cpp:30: error: declaration of ‘char* strcasestr(const char*,
const char*)’ throws different exceptions
../include/string.h:47: error: from previous declaration ‘char*
strcasestr(const char*, const char*) throw ()’
string.cpp: In function ‘char* strcasestr(const char*, const char*)’:
string.cpp:224: error: declaration of ‘char* strcasestr(const char*,
const char*)’ throws different exceptions
string.cpp:30: error: from previous declaration ‘char*
strcasestr(const char*, const char*) throw ()’


I'm guessing this is a compatibility problem with another definition
of strcasestr (probably in the C libraries), but I'm not sure... But
why isn't this signaled? The errors blame only internal declaration
conflicts...

Thanks for any suggestion!
John
 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Exceptions - How do you make it work like built-in exceptions? Lie Python 3 01-14-2008 06:45 PM
Exceptions + Performance on path without exceptions gratch06@gmail.com C++ 3 04-16-2007 08:52 PM
.NET 1.1 SP1 Datagrid throws exceptions where it didn't before! Urs Eichmann ASP .Net Web Services 1 09-10-2004 11:14 AM
Checked exceptions vs unchecked exceptions Ahmed Moustafa Java 5 07-14-2004 01:46 PM
Custom exceptions -- inherit from exceptions.Exception? Paul Miller Python 3 11-12-2003 09:24 AM



Advertisments