Help with OBJC++

in Genius Bar edited January 2014
I have been working in Objective-C for my game. I have a class that is made with OBJC++ so that i can use fstream as well as the cocoa framework. the whole program compiles fine, but when ever I link to my Model header, all of a sudden fstream cannot be found and using namespace std; gives aparse error before namespace. Can ne1 help me out?


  • Reply 1 of 7
    kickahakickaha Posts: 8,760member
    It sounds like the linker is expecting Obj-C and getting Obj-C++.

    No, wait... you're getting a parse error on *LINKING*?? That makes zero sense.
  • Reply 2 of 7
    tell me about it. I think i might have found a way to go without using the C++ section. But that will require changing around a hundred lines or so. And I still wont be sure it works. Maybe I sould change the calling class to an OBJC++ class just to see what happenes. When I get back home I wil try it.
  • Reply 3 of 7
    check the extension of the source file

    eg if you have cpp code in a .c file most linkers

    will barf
  • Reply 4 of 7
    kickahakickaha Posts: 8,760member

    .c = C

    .cpp/C = C++

    .m = Obj-C

    .M = Obj-C++

    Sure that 'Obj-C++' file doesn't have a .m extension?
  • Reply 5 of 7
    c++ is .cc under unix/linux/solaris etc etc

    .cpp is also commonly used
  • Reply 6 of 7
    isn't Obj-C++ .mm files?
  • Reply 7 of 7
    chychchych Posts: 860member
    Yeah .mm is objc++

    .m is objc

    .m is also matlab...
Sign In or Register to comment.