-
Help!! VC++ Problems
I'm trying to do a project and we have to implement the matrix library newmat. I put all the required files we were given into my VC98 subfolders. Now I getting 46 errors, essentially this block repeated 3 times:
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\fstream.h(8 : error C2872: 'streambuf' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\fstream.h(89) : error C2872: 'streampos' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\fstream.h(89) : error C2872: 'streamoff' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\fstream.h(106) : error C2872: 'streambuf' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\fstream.h(107) : error C2872: 'filebuf' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\fstream.h(126) : error C2872: 'streambuf' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\fstream.h(127) : error C2872: 'filebuf' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\fstream.h(146) : error C2872: 'streambuf' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\fstream.h(147) : error C2872: 'filebuf' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\fstream.h(159) : error C2872: 'ios' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\fstream.h(159) : error C2872: 'ios' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\fstream.h(160) : error C2872: 'filebuf' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\fstream.h(161) : error C2872: 'ios' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\fstream.h(161) : error C2872: 'ios' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\fstream.h(162) : error C2872: 'filebuf' : ambiguous symbol
I did some searching on google and some people had this problem when they had the lines "using namespace std" before a #include so I put all mine after the #include. I have namespace in 3 files:
Twice like this:
using namespace std;
using namespace NEWMAT;
And once like this:
using namespace NEWMAT;
Any idea what these errors mean?
-
I'm not famaliar with the matrix library your using, though if their are multiple definitions in different namespaces, this will help. You shouldn't dump entire namespaces like that unless if your refactoring old code to us namespaces. I'm used to writing std::cout << "hello world" << std::end etc., you can also put using directives at the top such as using std::cout;
-
> I put all the required files we were given into my VC98 subfolders
Bad move.
Put them somewhere else, and configure the project search paths to include the location where you put them.