Archived

This topic is now archived and is closed to further replies.

neurokaotix

ios.h problems =(

Recommended Posts

I use functions from ios.h in sevel places in my project,my scripting engine and in my terrain engine. I''ve recently just added the terrain engine and it is called AFTER the scripting engine. The terrain class is betting errors saying this:
  
--------------------Configuration: DXProject - Win32 Release--------------------
Compiling...
DXMain.cpp
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ios.h(146) : error C2872: ''streambuf'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ios.h(159) : error C2872: ''ostream'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ios.h(159) : error C2872: ''ostream'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ios.h(160) : error C2872: ''ostream'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ios.h(180) : error C2872: ''streambuf'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ios.h(207) : error C2872: ''streambuf'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ios.h(210) : error C2872: ''streambuf'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ios.h(219) : error C2872: ''ostream'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\streamb.h(90) : error C2872: ''streampos'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\streamb.h(90) : error C2872: ''streamoff'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\streamb.h(91) : error C2872: ''streampos'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\streamb.h(91) : error C2872: ''streampos'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ios.h(258) : error C2872: ''ios'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ios.h(258) : error C2872: ''ios'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ios.h(259) : error C2872: ''ios'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ios.h(259) : error C2872: ''ios'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ios.h(260) : error C2872: ''ios'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ios.h(260) : error C2872: ''ios'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ios.h(272) : error C2872: ''ostream'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ios.h(272) : error C2872: ''ostream'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ios.h(272) : error C2872: ''ostream'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ios.h(273) : error C2872: ''ostream'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ios.h(290) : error C2872: ''streambuf'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream.h(67) : error C2872: ''streambuf'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream.h(74) : error C2872: ''ios'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream.h(74) : error C2872: ''ios'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream.h(90) : error C2872: ''streambuf'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream.h(102) : error C2872: ''streambuf'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream.h(117) : error C2872: ''streampos'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream.h(118) : error C2872: ''streamoff'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream.h(119) : error C2872: ''streampos'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream.h(126) : error C2872: ''streambuf'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream.h(132) : error C2872: ''ios'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream.h(139) : error C2872: ''istream'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream.h(140) : error C2872: ''istream'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream.h(140) : error C2872: ''ios'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream.h(140) : error C2872: ''ios'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream.h(142) : error C2872: ''istream'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream.h(143) : error C2872: ''istream'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream.h(145) : error C2872: ''istream'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream.h(146) : error C2872: ''istream'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream.h(148) : error C2872: ''istream'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream.h(149) : error C2872: ''istream'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream.h(150) : error C2872: ''istream'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream.h(152) : error C2872: ''istream'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream.h(153) : error C2872: ''istream'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream.h(155) : error C2872: ''istream'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream.h(156) : error C2872: ''istream'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream.h(157) : error C2872: ''istream'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream.h(159) : error C2872: ''istream'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream.h(161) : error C2872: ''istream'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream.h(162) : error C2872: ''istream'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream.h(167) : error C2872: ''streambuf'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream.h(169) : error C2872: ''istream'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream.h(169) : error C2872: ''istream'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream.h(170) : error C2872: ''istream'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream.h(170) : error C2872: ''streambuf'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream.h(175) : error C2872: ''istream'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream.h(175) : error C2872: ''istream'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream.h(177) : error C2872: ''ios'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream.h(177) : error C2872: ''ios'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream.h(178) : error C2872: ''ios'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream.h(178) : error C2872: ''ios'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream.h(179) : error C2872: ''ios'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream.h(179) : error C2872: ''ios'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ostream.h(62) : error C2872: ''streambuf'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ostream.h(70) : error C2872: ''ios'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ostream.h(70) : error C2872: ''ios'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ostream.h(87) : error C2872: ''streambuf'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ostream.h(94) : error C2872: ''streampos'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ostream.h(95) : error C2872: ''streamoff'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ostream.h(96) : error C2872: ''streampos'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ostream.h(101) : error C2872: ''streambuf'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ostream.h(107) : error C2872: ''ios'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ostream.h(112) : error C2872: ''ostream'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ostream.h(113) : error C2872: ''ostream'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ostream.h(113) : error C2872: ''ios'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ostream.h(113) : error C2872: ''ios'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ostream.h(115) : error C2872: ''ostream'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ostream.h(116) : error C2872: ''ostream'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ostream.h(118) : error C2872: ''ostream'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ostream.h(119) : error C2872: ''ostream'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ostream.h(121) : error C2872: ''ostream'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ostream.h(123) : error C2872: ''ostream'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ostream.h(124) : error C2872: ''ostream'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ostream.h(126) : error C2872: ''ostream'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ostream.h(127) : error C2872: ''ostream'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ostream.h(133) : error C2872: ''streambuf'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ostream.h(135) : error C2872: ''ostream'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ostream.h(135) : error C2872: ''ostream'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ostream.h(136) : error C2872: ''ostream'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ostream.h(136) : error C2872: ''streambuf'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ostream.h(143) : error C2872: ''ostream'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ostream.h(143) : error C2872: ''ostream'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ostream.h(144) : error C2872: ''ostream'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ostream.h(144) : error C2059: syntax error : ''string''
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ostream.h(144) : error C2872: ''ostream'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ostream.h(144) : error C2143: syntax error : missing '';'' before ''{''
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ostream.h(144) : error C2447: missing function header (old-style formal list?)
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ostream.h(145) : error C2872: ''ostream'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ostream.h(145) : error C2872: ''ostream'' : ambiguous symbol
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ostream.h(145) : fatal error C1003: error count exceeds 100; stopping compilation
Error executing cl.exe.
Creating browse info file...
BSCMAKE: error BK1506 : cannot open file ''.\Debug\DXMain.sbr'': No such file or directory
Error executing bscmake.exe.

DXProject.exe - 103 error(s), 0 warning(s)
  
Is there some way to be able to use ios.h twice in one project? Mindgamez Entertainment

Share this post


Link to post
Share on other sites
You should prefer the new-style headers such as <ios> to old-style <ios.h> since the old style is no longer standard or supported. With this in mind, it might be that part of your project uses the new style and part uses the old, which will lead to some things being declared twice.

[ MSVC Fixes | STL | SDL | Game AI | Sockets | C++ Faq Lite | Boost | Asking Questions | Organising code files | My stuff ]

Share this post


Link to post
Share on other sites
I got the same errors once because I was using both the old and new-style standard headers, i.e., I was using both #include <iostream.h> and #include <iostream>

Edit: beaten by 15 seconds

[edited by - ares32585 on August 17, 2002 9:46:58 PM]

Share this post


Link to post
Share on other sites