Skip to main content
GameDev.net gamedev.net
🔒 Locked

Visual Studio 2003 Problem and Solution

Started by meson81 Aug 22, 2006 at 10:28 PM 1 replies 700+ views
Original Post
meson81
meson81
Hi, I just upgraded to MSVS 2003 from gcc. Whilst trying to implement HelloWorld with iostream I kept coming up against compiler errors: (caused by the inclusion of )


#include <iostream> 
using namespace std;

int main(void) {
      cout << "Hello World!";
      return 0;
}
produced: c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\exception(55): error C2039: 'terminate' : is not a member of 'operator``global namespace''' c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\exception(55): error C2873: 'terminate' : symbol cannot be used in a using-declaration My (rather unsatisfying) solution was to hack the "include\exception" file and remove the reference to using ::terminate; included as part of the definition of _USE_EX This works, but two questions: Has anyone else ever seen this problem and are there any better was to fix it? Regards, Stuart
yadango
yadango
are C++ Exceptions enabled in your project settings? an error like this can be caused if eh.h is not included in . check your project settings->C/C++->Code Generation->Enable C++ Exceptions (or something like that) and make sure it is enabled. otherwise, i would do a reinstall if that's really all the code you are trying to compile.
meson81
meson81
Hi yadango,
No, hello world is not the only piece of code I am trying to compile, it was just a nice simple example to demonstrate the bug.

I have checked the points you mentioned, and exceptions were enabled in the project and also eh.h is being included (after then mention of "using ::terminate", but I have confirmed that that is not the problem).

Since I also had VS .NET 2005 on this machine, it could well be an inconsistency between the two, and reinstalling might be the best option.

Thanks,
Stuart

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.