- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一些 iOS 项目使用的 C++ 代码。因此,我需要在 iOS 中为 C++ 代码提供 protobuf 支持。
我试过这个链接:https://developers.google.com/cardboard/develop/ios/protobuf ,还有这个要点:https://gist.github.com/eyeplum/ff0b76f70ca5b8d192cac0b52496433d .但是,它们都给出了以下错误:
...
CXX google/protobuf/compiler/csharp/csharp_reflection_class.lo
CXX google/protobuf/compiler/csharp/csharp_repeated_enum_field.lo
CXX google/protobuf/compiler/csharp/csharp_repeated_message_field.lo
CXX google/protobuf/compiler/csharp/csharp_repeated_primitive_field.lo
CXX google/protobuf/compiler/csharp/csharp_source_generator_base.lo
In file included from google/protobuf/compiler/csharp/csharp_source_generator_base.cc:39:
./google/protobuf/compiler/csharp/csharp_source_generator_base.h:62:25: warning: private field 'descriptor_' is not used [-Wunused-private-field]
const FileDescriptor* descriptor_;
^
1 warning generated.
CXX google/protobuf/compiler/csharp/csharp_wrapper_field.lo
CXXLD libprotoc.la
ar: `u' modifier ignored since `D' is the default (see `U')
CXXLD protoc
ld: warning: ignoring file ./.libs/libprotobuf.a, building for iOS-armv7 but attempting to link with file built for iOS-armv7
ld: warning: ignoring file /Users/tom/RefCode/protobuf/src/.libs/libprotobuf.a, building for iOS-armv7 but attempting to link with file built for iOS-armv7
ld: warning: ignoring file ./.libs/libprotoc.a, building for iOS-armv7 but attempting to link with file built for unknown-unsupported file format ( 0x21 0x3C 0x61 0x72 0x63 0x68 0x3E 0x0A 0x2F 0x20 0x20 0x20 0x20 0x20 0x20 0x20 )
Undefined symbols for architecture armv7:
"google::protobuf::compiler::objectivec::ObjectiveCGenerator::ObjectiveCGenerator()", referenced from:
google::protobuf::compiler::ProtobufMain(int, char**) in main.o
"google::protobuf::compiler::objectivec::ObjectiveCGenerator::~ObjectiveCGenerator()", referenced from:
google::protobuf::compiler::ProtobufMain(int, char**) in main.o
"google::protobuf::compiler::CodeGenerator::~CodeGenerator()", referenced from:
google::protobuf::compiler::js::Generator::~Generator() in main.o
google::protobuf::compiler::ruby::Generator::~Generator() in main.o
google::protobuf::compiler::php::Generator::~Generator() in main.o
"google::protobuf::compiler::CommandLineInterface::AllowPlugins(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
google::protobuf::compiler::ProtobufMain(int, char**) in main.o
"google::protobuf::compiler::CommandLineInterface::RegisterGenerator(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, google::protobuf::compiler::CodeGenerator*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
google::protobuf::compiler::ProtobufMain(int, char**) in main.o
"google::protobuf::compiler::CommandLineInterface::Run(int, char const* const*)", referenced from:
google::protobuf::compiler::ProtobufMain(int, char**) in main.o
"google::protobuf::compiler::CommandLineInterface::CommandLineInterface()", referenced from:
google::protobuf::compiler::ProtobufMain(int, char**) in main.o
"google::protobuf::compiler::CommandLineInterface::~CommandLineInterface()", referenced from:
google::protobuf::compiler::ProtobufMain(int, char**) in main.o
"google::protobuf::compiler::cpp::CppGenerator::CppGenerator()", referenced from:
google::protobuf::compiler::ProtobufMain(int, char**) in main.o
"google::protobuf::compiler::cpp::CppGenerator::~CppGenerator()", referenced from:
google::protobuf::compiler::ProtobufMain(int, char**) in main.o
"google::protobuf::compiler::java::JavaGenerator::JavaGenerator()", referenced from:
google::protobuf::compiler::ProtobufMain(int, char**) in main.o
"google::protobuf::compiler::java::JavaGenerator::~JavaGenerator()", referenced from:
google::protobuf::compiler::ProtobufMain(int, char**) in main.o
"google::protobuf::compiler::csharp::Generator::Generator()", referenced from:
google::protobuf::compiler::ProtobufMain(int, char**) in main.o
"google::protobuf::compiler::csharp::Generator::~Generator()", referenced from:
google::protobuf::compiler::ProtobufMain(int, char**) in main.o
"google::protobuf::compiler::python::Generator::Generator()", referenced from:
google::protobuf::compiler::ProtobufMain(int, char**) in main.o
"google::protobuf::compiler::python::Generator::~Generator()", referenced from:
google::protobuf::compiler::ProtobufMain(int, char**) in main.o
"vtable for google::protobuf::compiler::CodeGenerator", referenced from:
google::protobuf::compiler::CodeGenerator::CodeGenerator() in main.o
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"vtable for google::protobuf::compiler::js::Generator", referenced from:
google::protobuf::compiler::js::Generator::Generator() in main.o
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"vtable for google::protobuf::compiler::php::Generator", referenced from:
google::protobuf::compiler::php::Generator::Generator() in main.o
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"vtable for google::protobuf::compiler::ruby::Generator", referenced from:
google::protobuf::compiler::ruby::Generator::Generator() in main.o
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [protoc] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
我已经尝试解决了,没有任何进展。感谢您的帮助!
已编辑:64 位版本也有错误。我也遵循谷歌的指南(https://developers.google.com/cardboard/develop/ios/protobuf)
...
CXXLD protoc
ld: warning: ignoring file /Users/tom/RefCode/protobuf/src/.libs/libprotobuf.a, building for iOS-arm64 but attempting to link with file built for unknown-unsupported file format ( 0x21 0x3C 0x61 0x72 0x63 0x68 0x3E 0x0A 0x2F 0x20 0x20 0x20 0x20 0x20 0x20 0x20 )
ld: warning: ignoring file ./.libs/libprotobuf.a, building for iOS-arm64 but attempting to link with file built for unknown-unsupported file format ( 0x21 0x3C 0x61 0x72 0x63 0x68 0x3E 0x0A 0x2F 0x20 0x20 0x20 0x20 0x20 0x20 0x20 )
ld: warning: ignoring file ./.libs/libprotoc.a, building for iOS-arm64 but attempting to link with file built for unknown-unsupported file format ( 0x21 0x3C 0x61 0x72 0x63 0x68 0x3E 0x0A 0x2F 0x20 0x20 0x20 0x20 0x20 0x20 0x20 )
Undefined symbols for architecture arm64:
"google::protobuf::compiler::objectivec::ObjectiveCGenerator::ObjectiveCGenerator()", referenced from:
google::protobuf::compiler::ProtobufMain(int, char**) in main.o
"google::protobuf::compiler::objectivec::ObjectiveCGenerator::~ObjectiveCGenerator()", referenced from:
google::protobuf::compiler::ProtobufMain(int, char**) in main.o
"google::protobuf::compiler::CodeGenerator::~CodeGenerator()", referenced from:
google::protobuf::compiler::js::Generator::~Generator() in main.o
google::protobuf::compiler::ruby::Generator::~Generator() in main.o
google::protobuf::compiler::php::Generator::~Generator() in main.o
"google::protobuf::compiler::CommandLineInterface::AllowPlugins(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
google::protobuf::compiler::ProtobufMain(int, char**) in main.o
"google::protobuf::compiler::CommandLineInterface::RegisterGenerator(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, google::protobuf::compiler::CodeGenerator*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
google::protobuf::compiler::ProtobufMain(int, char**) in main.o
"google::protobuf::compiler::CommandLineInterface::Run(int, char const* const*)", referenced from:
google::protobuf::compiler::ProtobufMain(int, char**) in main.o
"google::protobuf::compiler::CommandLineInterface::CommandLineInterface()", referenced from:
google::protobuf::compiler::ProtobufMain(int, char**) in main.o
"google::protobuf::compiler::CommandLineInterface::~CommandLineInterface()", referenced from:
google::protobuf::compiler::ProtobufMain(int, char**) in main.o
"google::protobuf::compiler::cpp::CppGenerator::CppGenerator()", referenced from:
google::protobuf::compiler::ProtobufMain(int, char**) in main.o
"google::protobuf::compiler::cpp::CppGenerator::~CppGenerator()", referenced from:
google::protobuf::compiler::ProtobufMain(int, char**) in main.o
"google::protobuf::compiler::java::JavaGenerator::JavaGenerator()", referenced from:
google::protobuf::compiler::ProtobufMain(int, char**) in main.o
"google::protobuf::compiler::java::JavaGenerator::~JavaGenerator()", referenced from:
google::protobuf::compiler::ProtobufMain(int, char**) in main.o
"google::protobuf::compiler::csharp::Generator::Generator()", referenced from:
google::protobuf::compiler::ProtobufMain(int, char**) in main.o
"google::protobuf::compiler::csharp::Generator::~Generator()", referenced from:
google::protobuf::compiler::ProtobufMain(int, char**) in main.o
"google::protobuf::compiler::python::Generator::Generator()", referenced from:
google::protobuf::compiler::ProtobufMain(int, char**) in main.o
"google::protobuf::compiler::python::Generator::~Generator()", referenced from:
google::protobuf::compiler::ProtobufMain(int, char**) in main.o
"vtable for google::protobuf::compiler::CodeGenerator", referenced from:
google::protobuf::compiler::CodeGenerator::CodeGenerator() in main.o
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"vtable for google::protobuf::compiler::js::Generator", referenced from:
google::protobuf::compiler::js::Generator::Generator() in main.o
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"vtable for google::protobuf::compiler::php::Generator", referenced from:
google::protobuf::compiler::php::Generator::Generator() in main.o
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"vtable for google::protobuf::compiler::ruby::Generator", referenced from:
google::protobuf::compiler::ruby::Generator::Generator() in main.o
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [protoc] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
最佳答案
哦,我找到答案了!
看https://github.com/openssl/openssl/issues/10709#issuecomment-589430851和 https://github.com/bitcoin/bitcoin/issues/20825#issuecomment-753444519 ,解决方案非常简单:
brew uninstall binutils
非常有趣的错误信息和解决方案...
关于c++ - 在 iOS : "Undefined symbols" and "ld: warning: ignoring file" 中为 C++ 编译 Protobuf 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69335349/
我只是有一个更琐碎的问题。 为什么undefined == undefined 返回true,而undefined >= undefined 为false? undefined 等于 undefine
用PHP 7.2编写套接字服务器。根据Firefox 60中的“网络”选项卡,服务器的一些HTTP响应的第一行随机变为undefined undefined undefined。因此,我尝试记录套接字
在 JavaScript 中这是真的: undefined == undefined 但这是错误的: undefined <= undefined 起初我以为<=运算符包含第一个,但我猜它试图将其转换
在回答这个问题 (Difference between [Object, Object] and Array(2)) 时,我在 JavaScript 数组中遇到了一些我以前不知道的东西(具有讽刺意味的
来自https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/of , Note: thi
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
当我添加 到我的 PrimeFaces Mobile 页面,然后我在服务器日志中收到以下警告 WARNING: JSF1064: Unable to find or serve resource, u
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我是一名优秀的程序员,十分优秀!