You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#include <iostream>
#include "absl_simple_tests.h"
#include "torch/torch.h"
int main() {
auto s = TestStrCat();
std::cout << s << std::endl;
s = TestStrAppend();
std::cout << s << std::endl;
std::cout << torch::eye(3) << std::endl;
return 0;
}
If i build this, I will get errors:
/usr/bin/ld: CMakeFiles/simple_tests.dir/main.cpp.o: in function `TestStrCat()':
main.cpp:(.text+0xc3): undefined reference to `absl::StrCat(absl::AlphaNum const&, absl::AlphaNum const&, absl::AlphaNum const&)'
/usr/bin/ld: CMakeFiles/simple_tests.dir/main.cpp.o: in function `TestStrAppend()':
main.cpp:(.text+0x1a4): undefined reference to `absl::StrAppend(std::string*, absl::AlphaNum const&)'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
I have tested libtorch and abseil seperately, they all worked successfully.
The libtorch is just torch2.0.
This discussion was converted from issue #1429 on May 08, 2023 14:21.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the issue
If i use abseil and libtorch together, and use the function like StrAppend, the build will fail and give errors like
Steps to reproduce the problem
My Cmakelist is like
The file
absl_simple_tests.hisThe file
main.cppis likeIf i build this, I will get errors:
I have tested libtorch and abseil seperately, they all worked successfully.
The libtorch is just torch2.0.
What version of Abseil are you using?
d722803
What operating system and version are you using?
ubuntu22.04
What compiler and version are you using?
gcc 11.3.0
What build system are you using?
cmake 3.25.2
Additional context
No response
Beta Was this translation helpful? Give feedback.
All reactions