home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / cplus / 16140 < prev    next >
Encoding:
Text File  |  1992-11-11  |  1.4 KB  |  35 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!lambda.msfc.nasa.gov!saimiri.primate.wisc.edu!hp9000.csc.cuhk.hk!cucs5.cs.cuhk.hk!hclam
  3. From: hclam@cuse1.se.cuhk.hk (LAM Ho Cheong)
  4. Subject: Linking C++ and C
  5. Message-ID: <1992Nov11.141726.22547@cucs5.cs.cuhk.hk>
  6. Sender: news@cucs5.cs.cuhk.hk
  7. Organization: Faculty of Engineering, The Chinese U. of Hong Kong
  8. Date: Wed, 11 Nov 1992 14:17:26 GMT
  9. Lines: 24
  10.  
  11. I got a problem of linking C & C++ programs using the Turbo C++ for
  12. Windows on PC. I'm going to link some C source codes and some C++ 
  13. source codes. I need to invoke certain C-like functions defined in a C++
  14. codes in a C codes. However, the linker replies me that no such functions
  15. have been declared. That means the functions defined in the C++ codes are
  16. not accessable from the C codes. Can anyone give me some advice?
  17.  
  18. test1.cpp                          test2.c
  19. ...                                main()
  20. void f(void)                       {
  21. {                                     ...
  22.     printf("Hello, World\n");         f();
  23. }                                     ...
  24. ...                                }
  25.  
  26. linker error: "function _f is not declared in module "test2.c""!
  27.  
  28. It's natural because I'm using some more advanced stuff (C++) by a less 
  29. advanced stuff (C). But, I need to solve this ...
  30.  
  31. I'll appreciate any advice sent to me at hclam@se.cuhk.hk
  32.  
  33. Thanks in advance.
  34.  
  35.