cpp 常用命令
basic
- compile
- g++ -c -o a.o a.cpp
- -I includeDir
- -L libraryDir
- -lxx sharead xx library
- lxx static xx library
- g++ -c -o a.o a.cpp
- create static library
- ar ru libxxx.a a.o b.o c.o
- create shared library
- Linux: g++ –shared -fPIC -o libxxx.so a.o b.o c.o
- MacOs: g++ -dynamiclib -fPIC -o libxxx.dylib a.o b.o c.o
- show lib dependency
- Linux:ldd
- MacOs:otool -L
- include path:echo | g++ -v -x c++ -E -
- /etc/ld.so.conf
- ldconfig -p