小编Tat*_*ana的帖子

Swift 项目中包含 C++ 静态库的编译错误

我创建了一个包含以下 C++ 文件的静态库:

//TestClass.h File:
#ifndef TESTCLASS_H_
#define TESTCLASS_H_

using namespace std;
#include <string>

class TestClass
{
public:
   TestClass();

   virtual ~TestClass();

   int sum(int x, int y) const;
   string chain(const string& x, const string& y) const;
};


#endif /* TESTCLASS_H_ */




//TestClass.cpp File:
#include<iostream>
#include "TestClass.h"

TestClass::TestClass()
{
}

TestClass::~TestClass()
{
}

int TestClass::sum(int x, int y) const
{
   return x+y;
}

//Test.cpp File:
string TestClass::chain(const string& x, const string& y) const
{
   return x+y;
}

int main(int argc, char* argv[]) …
Run Code Online (Sandbox Code Playgroud)

c++ objective-c static-libraries ios swift

2
推荐指数
1
解决办法
3008
查看次数

标签 统计

c++ ×1

ios ×1

objective-c ×1

static-libraries ×1

swift ×1