[Your First Cross-Platform Djinni App: Part 2, iOS][1]我遵循这个指导原则,如果我使用Object-C项目创建新项目,一切都会正常工作。但是,我想使用Swift项目,所以我更改了项目语言,并创建了一个连接Swift与Object-C的桥梁。但它不能工作。
如果我尝试调用此函数,则会发生错误
let hw = LipHelloWorld.create()
Undefined symbols for architecture x86_64:
"std::__1::__shared_weak_count::__get_deleter(std::type_info const&) const", referenced from:
vtable for std::__1::__shared_ptr_emplace<personalapp::HelloWorldImpl, std::__1::allocator<personalapp::HelloWorldImpl> > in libpersonalapp_objc.a(HelloWorldImpl.o)
"std::__1::__next_prime(unsigned long)", referenced from:请帮帮我!
hello_world.hpp
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from personalapp.djinni
#pragma once
#include <memory>
#include <string>
namespace personalapp {
class HelloWorld {
public:
virtual ~HelloWorld() {}
static std::shared_ptr<HelloWorld> create();
virtual std::string get_hello_world() = 0;
};
} // namespace personalappHelloWorldImpl.hpp
#pragma once
#include "hello_world.hpp"
namespace personalapp {
class HelloWorldImpl : public personalapp::HelloWorld{
public:
HelloWorldImpl();
std::string get_hello_world() override;
};
}PersonalApp-Bridging-Header.h
#pragma once
#include "LipHelloWorld.h"发布于 2016-04-26 09:31:22
最后,我找到了答案,单击我的项目-> Build Settings --> All --> Linking --> Other Linker Flags,将其值设置为-lc++
https://stackoverflow.com/questions/36837237
复制相似问题