std::atomic library dependency (gcc 4.7.3)

前提是你 提交于 2019-11-29 05:01:14

Ok, finally found the answer at: https://gcc.gnu.org/wiki/Atomic/GCCMM

Turns out, 4.7 did not in fact have 'official' atomics support (just the header files). If you want to use atomics in 4.7 compilers, you must download the source code linked on that page and build it yourself

gcc -c -o libatomic.o libatomic.c
ar rcs libatomic.a libatomic.o

Then, you can build it using

g++-4.7.3 -std=c++0x atomics.cpp -latomic -L./
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!