I'm afraid that doesn't work (it may be a problem with Xcode). For example, suppose my two new files are
Testclass.cpp
//
// Testclass.cpp
// agkinterpreter
//
// Created by Jerry on 6/12/17.
//
//
#include "Testclass.hpp"
#include "agk.h"
void Testclass::print_test_number(){
agk::Print(test_number);
}
and
Testclass.hpp
//
// Testclass.hpp
// agkinterpreter
//
// Created by Jerry on 6/12/17.
//
//
#ifndef Testclass_hpp
#define Testclass_hpp
class Testclass {
private:
int test_number=111;
public:
void print_test_number();
};
#endif /* Testclass_hpp */
Then Xcode will throw the following buildtime messages:
agk_interpreter Group
Lexical or Preprocessor Issue Group
/Users/Jerry/AGK/C++Libraries_Apple/apps/template_ios_lite copy/Classes/Core.m:2:9: Non-portable path to file '"Core.h"'; specified path differs in case from file name on disk
Semantic Issue Group
/Users/Jerry/AGK/C++Libraries_Apple/apps/template_ios_lite copy/Classes/UntitledViewController.m:83:1: Method possibly missing a [super awakeFromNib] call
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:494:9: Unknown type name 'NSString'
/Users/Jerry/AGK/C++Libraries_Apple/apps/template_ios_lite copy/Classes/Testclass.cpp:10:10: In file included from /Users/Jerry/AGK/C++Libraries_Apple/apps/template_ios_lite copy/Classes/Testclass.cpp:10:
/Users/Jerry/AGK/C++Libraries_Apple/common/include/agk.h:8:11: In file included from /Users/Jerry/AGK/C++Libraries_Apple/apps/template_ios_lite copy/../../common/include/agk.h:8:
/Users/Jerry/AGK/C++Libraries_Apple/common/include/Common.h:74:10: In file included from /Users/Jerry/AGK/C++Libraries_Apple/apps/template_ios_lite copy/../../common/include/Common.h:74:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:8:9: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:8:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:495:9: Unknown type name 'NSString'
/Users/Jerry/AGK/C++Libraries_Apple/apps/template_ios_lite copy/Classes/Testclass.cpp:10:10: In file included from /Users/Jerry/AGK/C++Libraries_Apple/apps/template_ios_lite copy/Classes/Testclass.cpp:10:
/Users/Jerry/AGK/C++Libraries_Apple/common/include/agk.h:8:11: In file included from /Users/Jerry/AGK/C++Libraries_Apple/apps/template_ios_lite copy/../../common/include/agk.h:8:
/Users/Jerry/AGK/C++Libraries_Apple/common/include/Common.h:74:10: In file included from /Users/Jerry/AGK/C++Libraries_Apple/apps/template_ios_lite copy/../../common/include/Common.h:74:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:8:9: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:8:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:497:19: Unknown type name 'NSString'
/Users/Jerry/AGK/C++Libraries_Apple/apps/template_ios_lite copy/Classes/Testclass.cpp:10:10: In file included from /Users/Jerry/AGK/C++Libraries_Apple/apps/template_ios_lite copy/Classes/Testclass.cpp:10:
/Users/Jerry/AGK/C++Libraries_Apple/common/include/agk.h:8:11: In file included from /Users/Jerry/AGK/C++Libraries_Apple/apps/template_ios_lite copy/../../common/include/agk.h:8:
/Users/Jerry/AGK/C++Libraries_Apple/common/include/Common.h:74:10: In file included from /Users/Jerry/AGK/C++Libraries_Apple/apps/template_ios_lite copy/../../common/include/Common.h:74:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:8:9: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:8:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:498:44: Unknown type name 'NSString'
/Users/Jerry/AGK/C++Libraries_Apple/apps/template_ios_lite copy/Classes/Testclass.cpp:10:10: In file included from /Users/Jerry/AGK/C++Libraries_Apple/apps/template_ios_lite copy/Classes/Testclass.cpp:10:
/Users/Jerry/AGK/C++Libraries_Apple/common/include/agk.h:8:11: In file included from /Users/Jerry/AGK/C++Libraries_Apple/apps/template_ios_lite copy/../../common/include/agk.h:8:
/Users/Jerry/AGK/C++Libraries_Apple/common/include/Common.h:74:10: In file included from /Users/Jerry/AGK/C++Libraries_Apple/apps/template_ios_lite copy/../../common/include/Common.h:74:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:8:9: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:8:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:500:19: Unknown type name 'NSString'
/Users/Jerry/AGK/C++Libraries_Apple/apps/template_ios_lite copy/Classes/Testclass.cpp:10:10: In file included from /Users/Jerry/AGK/C++Libraries_Apple/apps/template_ios_lite copy/Classes/Testclass.cpp:10:
/Users/Jerry/AGK/C++Libraries_Apple/common/include/agk.h:8:11: In file included from /Users/Jerry/AGK/C++Libraries_Apple/apps/template_ios_lite copy/../../common/include/agk.h:8:
/Users/Jerry/AGK/C++Libraries_Apple/common/include/Common.h:74:10: In file included from /Users/Jerry/AGK/C++Libraries_Apple/apps/template_ios_lite copy/../../common/include/Common.h:74:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:8:9: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:8:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:501:53: Unknown type name 'NSString'
/Users/Jerry/AGK/C++Libraries_Apple/apps/template_ios_lite copy/Classes/Testclass.cpp:10:10: In file included from /Users/Jerry/AGK/C++Libraries_Apple/apps/template_ios_lite copy/Classes/Testclass.cpp:10:
/Users/Jerry/AGK/C++Libraries_Apple/common/include/agk.h:8:11: In file included from /Users/Jerry/AGK/C++Libraries_Apple/apps/template_ios_lite copy/../../common/include/agk.h:8:
/Users/Jerry/AGK/C++Libraries_Apple/common/include/Common.h:74:10: In file included from /Users/Jerry/AGK/C++Libraries_Apple/apps/template_ios_lite copy/../../common/include/Common.h:74:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:8:9: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:8:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:503:19: Unknown type name 'NSString'
/Users/Jerry/AGK/C++Libraries_Apple/apps/template_ios_lite copy/Classes/Testclass.cpp:10:10: In file included from /Users/Jerry/AGK/C++Libraries_Apple/apps/template_ios_lite copy/Classes/Testclass.cpp:10:
/Users/Jerry/AGK/C++Libraries_Apple/common/include/agk.h:8:11: In file included from /Users/Jerry/AGK/C++Libraries_Apple/apps/template_ios_lite copy/../../common/include/agk.h:8:
/Users/Jerry/AGK/C++Libraries_Apple/common/include/Common.h:74:10: In file included from /Users/Jerry/AGK/C++Libraries_Apple/apps/template_ios_lite copy/../../common/include/Common.h:74:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:8:9: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:8:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:503:50: Unknown type name 'Protocol'
/Users/Jerry/AGK/C++Libraries_Apple/apps/template_ios_lite copy/Classes/Testclass.cpp:10:10: In file included from /Users/Jerry/AGK/C++Libraries_Apple/apps/template_ios_lite copy/Classes/Testclass.cpp:10:
/Users/Jerry/AGK/C++Libraries_Apple/common/include/agk.h:8:11: In file included from /Users/Jerry/AGK/C++Libraries_Apple/apps/template_ios_lite copy/../../common/include/agk.h:8:
/Users/Jerry/AGK/C++Libraries_Apple/common/include/Common.h:74:10: In file included from /Users/Jerry/AGK/C++Libraries_Apple/apps/template_ios_lite copy/../../common/include/Common.h:74:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:8:9: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:8:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:504:19: Unknown type name 'Protocol'
/Users/Jerry/AGK/C++Libraries_Apple/apps/template_ios_lite copy/Classes/Testclass.cpp:10:10: In file included from /Users/Jerry/AGK/C++Libraries_Apple/apps/template_ios_lite copy/Classes/Testclass.cpp:10:
/Users/Jerry/AGK/C++Libraries_Apple/common/include/agk.h:8:11: In file included from /Users/Jerry/AGK/C++Libraries_Apple/apps/template_ios_lite copy/../../common/include/agk.h:8:
/Users/Jerry/AGK/C++Libraries_Apple/common/include/Common.h:74:10: In file included from /Users/Jerry/AGK/C++Libraries_Apple/apps/template_ios_lite copy/../../common/include/Common.h:74:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:8:9: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:8:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:504:61: Unknown type name 'NSString'
/Users/Jerry/AGK/C++Libraries_Apple/apps/template_ios_lite copy/Classes/Testclass.cpp:10:10: In file included from /Users/Jerry/AGK/C++Libraries_Apple/apps/template_ios_lite copy/Classes/Testclass.cpp:10:
/Users/Jerry/AGK/C++Libraries_Apple/common/include/agk.h:8:11: In file included from /Users/Jerry/AGK/C++Libraries_Apple/apps/template_ios_lite copy/../../common/include/agk.h:8:
/Users/Jerry/AGK/C++Libraries_Apple/common/include/Common.h:74:10: In file included from /Users/Jerry/AGK/C++Libraries_Apple/apps/template_ios_lite copy/../../common/include/Common.h:74:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:8:9: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:8:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:508:30: Unknown type name 'NSString'
/Users/Jerry/AGK/C++Libraries_Apple/apps/template_ios_lite copy/Classes/Testclass.cpp:10:10: In file included from /Users/Jerry/AGK/C++Libraries_Apple/apps/template_ios_lite copy/Classes/Testclass.cpp:10:
/Users/Jerry/AGK/C++Libraries_Apple/common/include/agk.h:8:11: In file included from /Users/Jerry/AGK/C++Libraries_Apple/apps/template_ios_lite copy/../../common/include/agk.h:8:
/Users/Jerry/AGK/C++Libraries_Apple/common/include/Common.h:74:10: In file included from /Users/Jerry/AGK/C++Libraries_Apple/apps/template_ios_lite copy/../../common/include/Common.h:74:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:8:9: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:8:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:508:53: Format argument not an NSString
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:509:31: Unknown type name 'NSString'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:509:63: Format argument not an NSString
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSZone.h:18:63: Unknown type name 'NSString'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSZone.h:19:19: Unknown type name 'NSString'
Parse Issue Group
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:492:1: Expected unqualified-id
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSZone.h:8:1: Expected unqualified-id
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:10:1: Expected unqualified-id
Apple LLVM 8.1 Error Group
Too many errors emitted, stopping now
Apple Mach-O Linker Error Group
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Dsymutil Error Group
(null): error: cannot parse the debug map for "/Users/Jerry/Library/Developer/Xcode/DerivedData/agkinterpreter-flpkfpwtekzndrhdhhnrpuflauxa/Build/Products/Debug/AGK 2 Template Lite.app/AGK 2 Template Lite": No such file or directory
It all boils down to some
Unknown type name 'NSString' error message.
I have tried all inclusions of
"agk.h" in both the header file
Testclass.hpp and the implementation file
Testclass.cpp . I have also tried the
using namespace AGK in the header and cpp files, and all possible permutations thereof; and still, Xcode will throw buildtime errors usually related to this
Unknown type name 'NSString' message.
Any other suggestions to fix this?
Or must I give up using cpp --other than template.cpp-- files in Xcode?
iMac Book Pro, MacOS 10.12.4, Xcode 8.3.3;
iPhone 6, iOS 9.35; iPhone 5s, iOS 9.35; iPad (3rd gen), iOS 9.35;
Dell Precision T7400, Windows 7 Professional 64bit, Visual Studio Community 2015;