home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / next / programm / 8040 < prev    next >
Encoding:
Text File  |  1993-01-08  |  4.6 KB  |  95 lines

  1. Newsgroups: comp.sys.next.programmer
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!The-Star.honeywell.com!umn.edu!csus.edu!netcom.com!vin
  3. From: vin@netcom.com (Vin Locke)
  4. Subject: c++ and Project Builder (was: Problems using gcc 2.3.3)
  5. Message-ID: <1993Jan8.214931.4958@netcom.com>
  6. Keywords: c++, g++, Objective-C++, Project Builder
  7. Organization: Netcom Online Communications Services (408-241-9760 login: guest)
  8. Date: Fri, 8 Jan 1993 21:49:31 GMT
  9. Lines: 84
  10.  
  11. [preamble:
  12. I had finished composing the following message, then found the thread 
  13. "Problems using gcc 2.3.3" which told me that I am not the first person
  14. to notice this.  However, someone mentioned that NeXT does contain a 
  15. "non-ansi c++" -- where is that?  Then again, what is this message in the
  16. release notes pertaining to? 
  17.  
  18. I am in the process of trying to build an application in NS3.0,
  19. via the AppKit/Project Builder, and including a C++ class.
  20.  
  21. First off, a little verbatim (via cut & paste) from the 
  22. NS3.0 release notes file "C++.rtf":
  23.  
  24. ---------------------------------------------------------------
  25. The Release 3.0 compiler driver /bin/cc handles C, Objective-C, C++ and 
  26. Objective-C++ source files.  The C++ compiler driver program /bin/cc++ is 
  27. no longer needed (but is still poresent for compatibility).  The compiler 
  28. driver determines the appropriate language from the suffix of the source 
  29. files or command line options.  Files ending in .c are taken to be C source 
  30. files, .m indicates an Objective-C source file, and .cc, .cxx, and .C are 
  31. recognized as C++ source files.  The -ObjC flag specifies that source files 
  32. should be considered to be Objective-C source files regardless of their 
  33. extension.  Similarly, the -ObjC+ flag specifies that source files should 
  34. be considered to be Objective-C++ source files.  The /bin/cc++ driver is 
  35. simply a shell script which calls the /bin/cc driver with the -ObjC+ flag.
  36. ---------------------------
  37.  
  38. Maybe I take too much for granted, but this paragraph gave me the
  39. impression that NS3.0 was all set up for compiling c++.  I was rudely 
  40. awakened when I tried to compile a c++ version of "hello, world" to check
  41. out the compiler, and though I used the above-mentioned switches, I was 
  42. informed that it couldn't find iostream.h (c++ equivalent to stdio.h).
  43. A search of the file system revealed no such file.  (BTW, the extension on
  44. my source file is cc) 
  45.  
  46. Well, my quest led me to downloading the g++ compiler, libs and includes
  47. from the archives (my thanks to the person who put that package together).
  48. Via the g++ compiler and a Makefile (defining my include path and lib path),
  49. I was able to successfully compile a c++ program.   I then switched the compiler name ONLY, g++ to cc, the compiler bundled with NS3.0, all else 
  50. (include and libs) intact.  I then get the message:  
  51.     cppt.cc:4: iostream.h: No such file or directory
  52.  
  53. Strange, because g++ was able to follow the same path and find it.
  54. (also, it compiled with gcc, part of the same bundle on the archives)
  55. Does the bundled compiler expect the includes to be in a specific
  56. (that is, pre-defined/hard-coded) spot?
  57.  
  58. Anyway, I've come to terms with the fact that I must compile my c++ code
  59. with a different compiler.  Now, I would like a NeXT app, created via 
  60. Project Builder, to contain both Objective C and c++ code.  If I were 
  61. using a makefile, I would know how to do it.  But now, I must tell PB 
  62. to use a different compiler to create the .o file for the c++ source and
  63. link it in to the app being created.  I used Makefile.preamble to define
  64. the compile of the .cc file, which succeeds in creating the .o file.
  65. However, I'm not doing enough here: it's not able to link it to the rest of 
  66. the app.
  67.  
  68. To summarize, my goal is to use both c++ and Objective C in the same app;
  69. I must be able to do one of the following:
  70.     1) find a way to get the compiler bundled with NS3.0 to compile my 
  71.             c++ code and link it with the rest of the app
  72.     2) get PB to know how to compile the c++ code with the g++ compiler 
  73.             AND link it with the app.
  74.         
  75. I would much appreciate hearing from anyone who has succeeded with such.
  76. (please, no flames about using c++ )
  77. Also, if anyone from NeXT would care to expand upon the quoted release notes,
  78. I would very much like to hear it.  Is Objective-C++ (mentioned in 
  79. release notes) NeXT's dialect of c++?
  80.  
  81.  
  82.        
  83.    
  84. -- 
  85.                                          --vin
  86. vin@netcom.com
  87. ------------------------------------------------------------------------
  88. If productivity can really be measured as the rate at which lines of
  89. code are produced, why not just use a tight loop to spew code as fast
  90. as possible, and send the programmers home?
  91.                                             --Brad Cox
  92.  
  93.  
  94.