home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- 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
- From: hclam@cuse1.se.cuhk.hk (LAM Ho Cheong)
- Subject: Linking C++ and C
- Message-ID: <1992Nov11.141726.22547@cucs5.cs.cuhk.hk>
- Sender: news@cucs5.cs.cuhk.hk
- Organization: Faculty of Engineering, The Chinese U. of Hong Kong
- Date: Wed, 11 Nov 1992 14:17:26 GMT
- Lines: 24
-
- I got a problem of linking C & C++ programs using the Turbo C++ for
- Windows on PC. I'm going to link some C source codes and some C++
- source codes. I need to invoke certain C-like functions defined in a C++
- codes in a C codes. However, the linker replies me that no such functions
- have been declared. That means the functions defined in the C++ codes are
- not accessable from the C codes. Can anyone give me some advice?
-
- test1.cpp test2.c
- ... main()
- void f(void) {
- { ...
- printf("Hello, World\n"); f();
- } ...
- ... }
-
- linker error: "function _f is not declared in module "test2.c""!
-
- It's natural because I'm using some more advanced stuff (C++) by a less
- advanced stuff (C). But, I need to solve this ...
-
- I'll appreciate any advice sent to me at hclam@se.cuhk.hk
-
- Thanks in advance.
-
-