home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / cplus / 19729 < prev    next >
Encoding:
Text File  |  1993-01-22  |  1.1 KB  |  34 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!haven.umd.edu!news.umbc.edu!gmuvax2!mbenson
  3. From: mbenson@gmuvax2.gmu.edu (Michael Benson)
  4. Subject: Help with the linking of C and C++ files.
  5. Message-ID: <1993Jan22.053408.14225@gmuvax2.gmu.edu>
  6. Keywords: C++ object C link
  7. Organization: George Mason University, Fairfax, Virginia, USA 
  8. Date: Fri, 22 Jan 1993 05:34:08 GMT
  9. Lines: 23
  10.  
  11. I need some help.
  12.  
  13. I have a piece of code which I know compiles correctly into an object
  14. file.  The code is in the Microsoft C language.  It has a header file
  15. that properally defines the prototypes.  
  16.  
  17. I include the header  file in a new program that is written in Borland
  18. C++ (version 3.1).  It compiles fine, but fails to link.  It gives the
  19. error "undefined symbol xxxxx in module xxx.cpp"  I know that for some
  20. reason the linker doesn't want to recognize the code in the c routine.
  21. I have tried (maybe naively) to use extern "C" with the header file, but
  22. that failed.  
  23.  
  24. The C code is just a standard function:
  25. int function ()
  26. { (somecode) };
  27.  
  28. and the CPP code just calls it.  
  29.  
  30. Any ideas?  I have already wasted 12 hours today alone.
  31.  
  32. Michael
  33.  
  34.