Thread: linking C++ to C

  1. #1
    Registered User
    Join Date
    Sep 2001
    Posts
    10

    linking C++ to C

    Hi,

    I have just joined an existing coding project which is essentially complete, to add some new functionality to it.

    The whole source is in plain C with .c file extensions. I have added
    some new modules which used some linked lists and stuff, so i have used C++ and (obviously) the .cpp file extension.

    The functions which interface with the existing code is plain C, but in the .cpp files. Now the problem is, the .c files cannot find the functions which are in the .cpp files!

    I know I can link C to C++ with extern "C", but is there anything I can do in this situation, short of changing all the file names ??

    Thanks for any advice...
    rob
    www.goldroad.co.uk
    freeware ARM assembler
    dynarec gameboy advance emulator
    try them now!

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660

  3. #3
    Registered User
    Join Date
    Sep 2001
    Posts
    10
    fantastic, i'm back on track now. Thanks Salem :-)
    www.goldroad.co.uk
    freeware ARM assembler
    dynarec gameboy advance emulator
    try them now!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problems linking with g++
    By Just in forum Linux Programming
    Replies: 11
    Last Post: 07-24-2006, 01:35 AM
  2. strange linking error -- can not find shared library
    By George2 in forum C Programming
    Replies: 2
    Last Post: 07-10-2006, 10:51 PM
  3. Replies: 8
    Last Post: 04-27-2006, 10:39 AM
  4. Grrr.... SDL Linking Problem
    By 7EVEN in forum Game Programming
    Replies: 5
    Last Post: 08-12-2005, 08:44 PM
  5. Linking error with DirectDrawCreateEx
    By jjj93421 in forum Game Programming
    Replies: 6
    Last Post: 04-06-2004, 03:57 PM