I'm trying to make a c++ library work under Swift. I'm a noob in both, so I could be doing something completely stupid but do appreciate all the feedback. I have the following setup:
AnswerToEverything.cpp:
#include "AnswerToEverything.h"
#include <iostream>
class Everything{
int answerToEverything()
{
return 42;
}
};
AnswerToEverything.h:
#include <stdio.h>
#ifdef __cplusplus
extern "C" {
#endif
int answerToEverything();
#ifdef __cplusplus
}
#endif
Answer-Bridging-Header.h:
#include "AnswerToEverything.h"
GameScene.swift:
...
override func didMoveToView(view: SKView) {
/* Setup your scene here */
println("C++ call: \(answerToEverything())")
}
...
The Result is:
So what am I missing? All help Appreciated!