home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / cplus / 13127 < prev    next >
Encoding:
Text File  |  1992-08-31  |  1.3 KB  |  49 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!usc!zaphod.mps.ohio-state.edu!moe.ksu.ksu.edu!hobbes.physics.uiowa.edu!news.iastate.edu!moharil
  3. From: moharil@cs.iastate.edu (Vinay Arvind Moharil)
  4. Subject: Problem with CC 3.0
  5. Message-ID: <moharil.715318065@judy.cs.iastate.edu>
  6. Sender: news@news.iastate.edu (USENET News System)
  7. Organization: Iowa State University, Ames IA
  8. Date: Tue, 1 Sep 1992 03:27:45 GMT
  9. Lines: 38
  10.  
  11. Hi Netters!
  12. I am new to the world of C++. I am trying to use the CC 3.0 for Sun SPARC.
  13. Here is the code in C and C++. The code in C can be compiled with the C 
  14. compiler happily without any problems. However when I try to compile the
  15. C++ code using CC 3.0 I get lot of errors in the files like sys/stat.h,
  16. X11/Intrinsic.h. I did the extern "C" ... part because some one suggested that
  17. as a solution to get rid of the syntax errors (in the X11/Intrinsic.h file) I 
  18. was facing. In my opinion, The CC 3.0 should compile the #include portion as a 
  19. C code and should not give errors as is the case with the C compiler.
  20.  
  21. Please HELP!
  22. Thanks
  23. bye
  24. vinay
  25.  
  26. main(argc,argv)
  27. int argc;
  28. char *argv[];
  29. {
  30. #include <X11/Intrinsic.h>
  31. #include <stdio.h>
  32. typedef char *String1;
  33. String1 xyz;
  34. printf("Hi!\n");
  35. }
  36.  
  37. main(argc,argv)
  38. int argc;
  39. char *argv[];
  40. {
  41. extern "C" {
  42. #include <X11/Intrinsic.h>
  43. #include <stdio.h>
  44. }
  45. typedef char *String1;
  46. String1 xyz;
  47. printf("Hi!\n");
  48. }
  49.