Use of inline

Discussion in 'Mac Programming' started by eddyq, Sep 15, 2009.

  1. eddyq macrumors member

    Joined:
    Jun 10, 2009
    #1
    I have included a lot of C source with a CPP project. The C source uses inline in many of the .h files. When I made a project of only C it didn't give any errors but when I added the C files to the CPP project it gave "multiple definitions of symbol xxxx" for each case where it encounters the inline.

    I assume this is because the CPP project has different settings and this is not allowed in CPP. Does anyone know how to change the settings so my C files will not cause this linker error?
     
  2. eddyq thread starter macrumors member

    Joined:
    Jun 10, 2009
    #2
    I found out something. You have to use "static inline". I guess that is a C++ thing and once some of the files were C++ then it added that requirement to my C files.
     

Share This Page