@m4sterr0shi- tried that- still getting the same error...
@guestgulkan- fstream is in the iostream hierarchy- why include both? isn't fstream inherently included when iostream is?
Wouldn't have thought that it would have made any errors - you probably have other issues in your code which have now come to light.
but can you explain to me why it isn't included when iostream is?
iostream does not include the filestream stuff. It does include a number of forward declarations
which is why you get the 'incomplete type error ' rather than a 'undefined' error.
ya... the errors are in the code and unrelated, which is why I didn't mention them in any detail. So to get this right, by including fstream I inherently include iostream because fstream needs iostream but iostream DOES NOT need fstream?
There is no guarantee you will get all of iostream if you include fstream. The library producers may seek to keep the inclusions as efficient as possible.
Really, if you include a symbol from iostream then you should #include it and the same for fstream. You should never rely on one header including another.
Otherwise your code can break when you upgrade the libraries or move to a different vendor.
by including fstream I inherently include iostream
Actually, no. If you take a closer look in the link I pasted above, you'll see that the classes in <fstream> inherit from the classes found in <istream>, <ostream> and <streambuff>.