简体   繁体   中英

Can't build with libusb. ‘_Atomic’ does not name a type

I am attempting to use libusb for a project and my C++ is rusty. I think I've resolved the dependencies for libtool and libdev on my ubuntu box, but now when I run, I get the following error.

/usr/lib/gcc/x86_64-linux-gnu/10/include/stdatomic.h:40:9: error: ‘_Atomic’ does not name a type

I found How to include C11 headers when compiling C++ with GCC? , but not sure how this helps me.

The problem appears to be in gcc somehow, but not sure how to go about fixing it. I'm using C++ 20 in CLion.

I'm running on Ubuntu and I had tried

sudo apt install libusb

to no avail. On a hunch I tried

sudo apt install libusb-dev

And it worked, so now I don't need to build it.

I need to remember to search for the library name if it isn't obvious.

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