I’m banging my head for a while with how to return a value from some C++ into Obj-C. Here are my files:
XMLParsing.h
#include <iostream>
#include <libxml/xmlreader.h>
#include <string>
#include <stdlib.h>
using namespace std;
class XMLParsing {
int i;
public:
int outputAnArray();
};
XMLParsing.cpp
#include "XMLParsing.h"
int outputAnArray() {
return 1;
}
MyTest.mm
XMLParsing *parser = new XMLParsing();
parser->outputAnArray();
This raises:
Undefined symbols for architecture i386:
ld: symbol(s) not found for architecture i386
Any hint would be greatly appreciated.
The XMLParsing.cpp should be like:
Sorry for the late answer.