-
-
Notifications
You must be signed in to change notification settings - Fork 396
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
abseil link错误 #1531
Comments
贴下你这 main 里面的测试代码 |
简单的一次函数调用 #include <iostream>
#include "absl/strings/numbers.h"
using namespace std;
int main(int argc, char** argv)
{
int result = 0;
auto a = absl::SimpleAtoi("123", &result);
cout << result << endl;
return 0;
}
|
再试下 xrepo update-repo
xrepo remove --all -y abseil
xmake f -c
xmake |
ok了,十分感谢 |
#include "absl/container/flat_hash_map.h"
#include <iostream>
int main(int argc, char **argv) {
absl::flat_hash_map<int, int> map;
if (map.contains(1)) {
return 1;
}
std::cout << "not found" << std::endl;
return 0;
} 也不能正常编译的,原因
看了下abseil仓库absl/container下的的CMakeLists.txt,flat_hash_map依赖absl_hash,absl_hash依赖absl_city 我对cmake不熟悉,只大致看了下它这些子组件之间声明的依赖(例如container),感觉很复杂,不太好手动清理出来一个链接顺序。 在原生使用cmake的情况下,写下absl::***它可能会自动顺着声明处理?xmake下用什么解决呢?配置下cmake提前打包出来一个libabsl.a之类的完整大包? |
我现在只是稍微调整了下顺序,你可以提个 pr 过来 继续改进包里面 links 的顺序。。 xmake-repo/packages/a/abseil/xmake.lua Line 17 in 0ebe60d
没用,对外导出 只能自己配置,xmake 不解析 cmakelists |
merge了,再试试 |
Xmake 版本
2.7.2+202210122221
操作系统版本和架构
Linux MFK 5.10.102.1-microsoft-standard-WSL2 #1 SMP Wed Mar 2 00:30:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
描述问题
引用abseil包,链接失败,我试了"abseil 20220623.0"和"abseil master"都有这个问题, debug下也是同样的错误,cmake正常
期待的结果
链接成功
工程配置
No response
附加信息和错误日志
The text was updated successfully, but these errors were encountered: