Pre loader

iOS Objective-C++ linker error

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

Answered
0
0

The SciChartDemo compiles and runs just fine out of the box. If I change any of the .m files from “Objective-C” to “Objective-C++” and try to compile I have a linker error:

No matching function for call to ‘SCI_constructGenericType’
Expanded from macro ‘SCIGeneric’
Candidate function not viable: no known conversion from ‘const char [2]’ to ‘char *’ for 2nd argument

If I cast 2nd argument in the macro to (char *) I get the following error:

“SCI_constructGenericType(void*, char*)”
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Am I mistaken if I believe that this has to do something with C++ name mangling? More specifically: how can I use SCIGeneric(x) macro in Objective-C++ file?

Thanks.

Version
1.2.3
  • You must to post comments
Best Answer
3
0

Hi, Igor. I’ve fixed the problem with objective-c++. You can find the fix in new version of our framework.
http://www.scichart.com/Downloads/iOS/v1.2/SciChart_iOS_v1.2.4.1268_SDK.zip

  • You must to post comments
0
0

Promising results when wrapping include statement for SciChart headers this way:

extern "C"
{
#import <SciChart/SciChart.h>
};

Besides this, SCIGeneric ( x ) macro in SCIGenericType.h had to be changed from this:

#define SCIGeneric(x) ({ typeof(x) _x = (x); SCI_constructGenericType( &_x, @encode( typeof (_x) ) ); })

to this:

#define SCIGeneric(x) ({ typeof(x) _x = (x); SCI_constructGenericType( &_x, (char*)@encode( typeof (_x) ) ); })
  • Andrew Burnett-Thompson
    Hi Igor, I believe Mykola on our team is working to integrate a fix to the v1.x and v2.x branches of SciChart iOS. Thanks for notifying us and for your contribution. We’ll update you once this is published.
  • Igor Peric
    Hi Andrew, I have been using fix by Mykola in 1.x version. Today I switched to 2.0 and it seems to me you didn’t include this macro fix (cast to char*) in 2.0 branch.
  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies