home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / cplus / 12294 < prev    next >
Encoding:
Text File  |  1992-08-12  |  1.6 KB  |  50 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!mcsun!news.funet.fi!funic!nntp.hut.fi!lesti.hut.fi!jkokko
  3. From: jkokko@lesti.hut.fi (Jari Kokko)
  4. Subject: Borland C++ 3.0: Using ifstream
  5. Message-ID: <1992Aug12.170957.11478@nntp.hut.fi>
  6. Summary: Novice Alert!
  7. Keywords: Problem with 'const unsigned char far*'
  8. Sender: usenet@nntp.hut.fi (Usenet pseudouser id)
  9. Nntp-Posting-Host: lesti.hut.fi
  10. Reply-To: jkokko@lesti.hut.fi (Jari Kokko)
  11. Organization: Helsinki University of Technology
  12. Date: Wed, 12 Aug 1992 17:09:57 GMT
  13. Lines: 35
  14.  
  15. I'm fairly new to C++, so bear with me.
  16. I'm sure this is a problem with some silly option:
  17.  
  18. Here is the code (part) that I've been working on for app. 30 hours ;<
  19. (I'm trying to open a file and output it to stdout).
  20. #include <iostream.h>
  21. #include <fstream.h>
  22.  
  23. main() {
  24.   ifstream inFile;
  25.   inFile.open("file.txt");
  26.   // Linker Error:
  27.   // Undef'd symbol fstreambase::open(const unsigned char far*,int,int)
  28.   // in module HUU.CPP
  29.   // Memory model Large, Source Ansi C++
  30.   cout << inFile;
  31.   inFile.close();
  32.   return 0;
  33. }
  34.  
  35. So, what is going on in here !
  36.  
  37. I've resorted to editing <fstream.h> because of the _FAR and _Cdecl
  38. things in there. Taking out _FAR or replacing it with far won't help,
  39. replace it with near I haven't tried !
  40.  
  41. I've been running Borland C++ 3.0 under OS/2 2.0 and under DOS with
  42. most memory models. I see in _defs.h file that when __OS2__ is def'd
  43. _FAR is empty.
  44.  
  45. Any help is welcome, reply by email, I'll post the answers I get when
  46. I get this to work.
  47. -- 
  48. //jkokko // Email: Jari.Kokko@hut.fi \\ (358)(0) 8794431 \\
  49. ------------------------------------------------------------
  50.