How to run C++ functions in iphone ?

Discussion in 'iOS Programming' started by lesliekkwu, Feb 1, 2009.

  1. lesliekkwu macrumors newbie

    Joined:
    Dec 28, 2008
    #1
    Hello all,

    I got 1 cpp files and 1 header file, namely xml.cpp and xml.h, which is a xml library. I tried to include in a c++ project in xcode and it is working perfectly.

    However, when I include the 2 files into my iphone project, I use the header xml.h in one of my objective c class, I immediately got the follow errors (please see below picture )


    Here I attach my source file and the screen cap of my errors. Help off any kind will be highly appreciate. Again, sorry for asking a noob question first !

    (Edit: many people has asked me why I don't use the NSXML...I know it is stupid to use another library..but this library allows me to use it on windows mobile too...so please help !!! )
     

    Attached Files:

  2. lazydog macrumors 6502a

    Joined:
    Sep 3, 2005
    Location:
    Cramlington, UK
    #2
    Hi,
    You need to run your controller file through the Objective-C++ compiler. Rename your file to have a .mm extension. I thnk that will sort out your problem.
    b e n
     

Share This Page