#Undefined symbols for architecture arm64:

17 messages · Page 1 of 1 (latest)

tardy jolt
#

Hi all, I am trying to add gtest to my project for testing and I keep getting this error.

I am using brew clang instead of apple clang but for some reason gtest keeps giving me this error.

Undefined symbols for architecture arm64:
"std::__1::__hash_memory(void const*, unsigned long)", referenced from:
unsigned long std::__1::__do_string_hash[abi:ne210107]<char const*>(char const*, char const*) in libgtest.a2
ld: symbol(s) not found for architecture arm64

My cmake files to the test file I want to test are

CMakeLists.txt
src/order/CMakeLists.txt
src/order/test/CMakeLists.txt

Any advice on this would be greatly appreciated
Thanks!

serene matrixBOT
#

When your question is answered use !solved or the button below to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

neat spade
#

wtf is std::1:: catloading

tardy jolt
#

This is the error, it cut off the __

neat spade
#

have you tried hello world google test first?

#

i not use mac idk, guesswork isnt pretty useful here
try gtest hello world, and if it not works maybe i could guess something

#

wait for other to reply

weak phoenix
#

any reason you’re not using appleclang?

#

not that it matters too much since missing stl symbols would imply mismatching standard libraries

tardy jolt
#

I wanted it as it is better for cross platforms and has newer features

#

The issue is coming from libgtest which is statically linked lib and I'm unsure how to build it using brew clang which is why im assuming it is not working. I think I'm missing something in the top cmakelists.txt or something is in the wrong order and thats why its building incorrectly

weak phoenix
#

chatgpt

#

bruh

#

apple clang is not that far behind, but also without some extra shenanigans you’ll be using your system’s standard library anyway

tardy jolt
#

regardless of why I'm choosing brew over apple, it doesnt work with either. I am trying to make this portable so that whoever pulls this from github will not have to brew install anything, its is done automatically

tardy jolt
#

!solved