How do I get XCode to build a project with Objective-C++ in it? -


i added scintilla framework xcode project (i.e. finds header files correctly), because written in objective-c++ doesn't compile. 8 syntax errors because of ::s. found can't include objective-c++ pure objective-c file, changed file extension mm. still gives me same 8 errors.
changed file type (of importing file) sourcecode.cpp.objcpp.

the relevant lines of code (with errors in comments - line numbers original file, without errors in comments):

scintillaview.h

// line 47-49 @protocol scintillanotificationprotocol  - (void)notification: (scintilla::scnotification*)notification; // 4 errors on line:                                                                 //   1. expected type-specifier                                                                 //   2. expected ')'                                                                 //   3. expected identifier                                                                 //   4. expected ';' @end // [snip] // line 131 - (void) notification: (scintilla::scnotification*) notification;   // exact same errors. 

when copying code noticed :: operator used few more times in file, somehow parser able match succesfully in places.

once more, code not mine, taken scintilla cocoa library.
(see here more info: http://www.scintilla.org/)

xcode 3.2.6, mac os x 10.6.8

adding

typedef tdscnotification scintilla::scnotification 

before first offending line revealed there no type called scnotification in namespace. searched through included header files (which, luckily, count three) namespace scintilla {. in first included header file, scintilla.h. looked this:

#ifdef sci_namespace namespace scintilla { #endif 

and

#ifdef sci_namespace } #endif 

so assumed sci_namespace wasn't defined. added #define sci_namespace scintilla.h somewhere online 45 , worked. almost. got error message:

framework not found scintilla
command /developer/usr/bin/llvm-g++-4.2 failed exit code 1

i think has how added framework project, should separate question.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -