hpple icon indicating copy to clipboard operation
hpple copied to clipboard

Compile issue when using Apple LLVM 5.1 - Language -> Compile Sources As -> Objective-C++

Open VaughanR0 opened this issue 11 years ago • 3 comments

For one of my projects I have a lot of C++ code which requires me to specify the Apple LLVM 5.1 - Language as 'Objective-C++' rather than leave it as 'According to file type'. This produces two compilation errors in XpathQuery.m XPathQuery.m:192:11: No matching function for call to 'htmlReadMemory' XPathQuery.m:218:11: No matching function for call to 'xmlReadMemory' where the detail is (for the first one): /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk/usr/include/libxml2/libxml/HTMLparser.h:206:3: Candidate function not viable: cannot convert argument of incomplete type 'const void *' to 'const char *' NB when I am able to leave the compiler setting as 'According to file type' I get no errors.

VaughanR0 avatar May 23 '14 01:05 VaughanR0

What are you trying to get by compiling Hpple as ObjC++? You can mix and match Objective-C and Objective-C++ in the same project without any problem.

zadr avatar May 23 '14 03:05 zadr

I am not sure that is the point. Hpple is not compiling with a valid LLVM setting even though that setting may lead to the complier using more fastidious code checking than other settings. This surely would lead one to suspect that there are some potential, if harmless, compliation issues with the code.

VaughanR0 avatar May 23 '14 06:05 VaughanR0

@VaughanR0 This isn't really a matter of being more or less fastidious in your warning flags.

Hpple was written in Objective-C, not Objective-C++. They are are two different languages, that just happen to be very, very similar. That goes back to C and C++ not quite being compatible with one another, and Apple wanting to be compatible with both of them.

zadr avatar May 23 '14 22:05 zadr