0

I want to build a little project that utilizes the QR Encoder. I simply used Cocoapods to install it within my project and included the QREncoder.h file within my bridging-header, which works just fine for a couple of other Objective-C resources. My problem occurs because I am including the QREncoder.h file which the includes the QR_Encode.h file. This file uses a pretty standard C++ class definition class CQR_Encode{...};, but when I'm trying to compile my code now, I get the following error /PATH_GOES_HERE/Pods/QR-Code-Encoder-for-Objective-C/QRCodeEncoderObjectiveCAtGithub/QR_Encode.h:81:1: Unknown type name 'class'; did you mean 'Class'?. Looking for that error on the internet got me the information, that I need a Objective-C wrapper class for that file, but I thing QREncoder{.h,.mm} should do the job. I also changed file type within the attributes inspector to either 'objective-c++ source' or 'c++ header' but that did not change the error. I also tried setting the 'compile sources as'-setting in build settings, but of course this didn't work since it sets the compile type for all files and since there are Objective-C classes, it won't work. Does anyone have an answer to help me out?

Geru
  • 624
  • 1
  • 7
  • 20
  • 1
    It seems like you need a header that contains just the Objective-C wrapper class and none of the C++ code. You might need to craft that yourself. This is the header to include in the bridging-header. – Gary Makin Oct 17 '15 at 02:20
  • The problem is that the header file of the actual Objective-C wrapper class includes the C++ header class. So by including this header file I would always include the problem causing C++ header file too. – Geru Oct 17 '15 at 02:23
  • That's why I suggested crafting a new header, removing all the C++ code. – Gary Makin Oct 17 '15 at 02:26

0 Answers0