简体   繁体   中英

linking a shared library fails after switching to clang with error adding symbols: file format not recognized

The library is built from source but links against some stuff built with gcc (such as opencv).

The library is a .a file and I am on linux.

Any ideas on what could be going wrong? This was building fine with gcc.

I built clang-14, lld and clang++ from source. I installed clang-14 but can't seem to install clang++.

The linker used is ld 9.0 (I'm not sure how to make my cmake project use lld).

gcc and clang are not compatible. Rebuild your library using clang.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM