tlsh icon indicating copy to clipboard operation
tlsh copied to clipboard

undefined references in tlsh_unittest.cpp

Open 0x570x57 opened this issue 6 years ago • 5 comments

Building fails at: Scanning dependencies of target tlsh [ 5%] Building CXX object src/CMakeFiles/tlsh.dir/tlsh.cpp.o [ 10%] Building CXX object src/CMakeFiles/tlsh.dir/tlsh_impl.cpp.o [ 15%] Building CXX object src/CMakeFiles/tlsh.dir/tlsh_util.cpp.o [ 20%] Building CXX object src/CMakeFiles/tlsh.dir/input_desc.cpp.o [ 25%] Building CXX object src/CMakeFiles/tlsh.dir/shared_file_functions.cpp.o [ 30%] Linking CXX static library ../../../lib/libtlsh.a [ 30%] Built target tlsh Scanning dependencies of target tlsh_unittest [ 35%] Building CXX object test/CMakeFiles/tlsh_unittest.dir/tlsh_unittest.cpp.o [ 40%] Linking CXX executable ../../../bin/tlsh_unittest /opt/binutils-2.32/bin/ld: CMakeFiles/tlsh_unittest.dir/tlsh_unittest.cpp.o: in function trendLSH_ut(char*, char*, char*, int, int, char*, char*, int, bool, int, int, int, int, char*)': tlsh_unittest.cpp:(.text+0x39b): undefined reference to operator new(unsigned long)' /opt/binutils-2.32/bin/ld: tlsh_unittest.cpp:(.text+0x42f): undefined reference to operator delete(void*, unsigned long)' /opt/binutils-2.32/bin/ld: tlsh_unittest.cpp:(.text+0x45b): undefined reference to operator delete(void*, unsigned long)' /opt/binutils-2.32/bin/ld: tlsh_unittest.cpp:(.text+0x8f0): undefined reference to operator delete(void*, unsigned long)' /opt/binutils-2.32/bin/ld: CMakeFiles/tlsh_unittest.dir/tlsh_unittest.cpp.o: in function trendLSH_ut(char*, char*, char*, int, int, char*, char*, int, bool, int, int, int, int, char*) [clone .cold]':

Couldn't find a solution, Cmake version 3.10.2

Thanks!

0x570x57 avatar Aug 14 '19 13:08 0x570x57

Hi 0x57

what is your environment? You are using Linux ? If so , which version?

I am confused though I did a search tlsh_unittest.cpp does not have a statement with new long in it.

The codebase does not use "long" integers

$ grep -r "long" /.h /.cpp Windows/WinFunctions.cpp: printf("ERROR: directory name candidate, %s, is too long (%d >= %d)\n", test/timing_unittest.cpp: long before_ms; test/timing_unittest.cpp: long after_ms; test/timing_unittest.cpp: long diff = (after_ms - before_ms); test/timing_unittest.cpp: long per_iter = diff / MAX_TRY;

cheers jono

jonjoliver avatar Aug 15 '19 07:08 jonjoliver

Hey Jono,

Thanks for your prompt reply. I'm using Ubuntu with 4.15.0-50-generic.

Maybe you don't use long integers, but you refer to a function in cmake that does, and the linking fails?

I know nothing about how cmake works, but from my googling (cmake undefined reference to) I see that similar issues were resolved by fixing the order of the linked libraries / adding correct links.

Thank you

0x570x57 avatar Aug 15 '19 08:08 0x570x57

I will fire up an Ubuntu instance - and see what happens... Give me a few days at this end to see what I can figure out...

jonjoliver avatar Aug 15 '19 11:08 jonjoliver

Hi,

build fails on windows, however, due to some other undefined references in tlsh_unittest : image

my believe is that the tslh.dll might not be properly linked: image

Could you please suggest a solution? Thanks

constantintcacenco avatar Oct 08 '19 21:10 constantintcacenco

Please look my project if you still get LNK2019 error. I fixed that but didn't published on github due to limits of git lfs on github also I need remove archive for that etc. I solved that problem.

HydraDragonAntivirus avatar Jan 25 '24 00:01 HydraDragonAntivirus