学习记录

来源:互联网 发布:mac 推出键 编辑:程序博客网 时间:2024/05/16 06:29

编译报错:nanoARCS-molecule.o:(.data+0x0): multiple definition of `FLES::_FLESK'

解决方案:因为一个有static成员的类,static成员定义在 .h 文件中,.h被多次包含报错,将成员定义写在单独的 .cpp 中即可


dpkg -l 列出所有安装的包(apt-get 安装的包)

dpkg -L libboost-iostreams1.54.0 列出目录


apt-cache search 查找包名(一般安装.dev)

apt-get 安装


export LD_LIBRARY_PATH=/usr/local/log4cxx/lib:$LD_LIBRARY_PATH

pkg-config --libs log4cpp  查找动态链接库目录


ldd arcs //查找二进制程序需要的动态链接库和目录


//运行时动态链接库目录!!

linux--LD_LIBRARY_PATH mac--DYLD_LIBRARY_PATH
export DYLD_LIBRARY_PATH=/Users/wangbing/boost/boost_1_59_0/stage/lib
//没有报错
dyld: Library not loaded: libboost_iostreams.dylib
  Referenced from: /Users/wangbing/cplusplus/InterInteview/./a.out
  Reason: image not found
Trace/BPT trap: 5
//-L 编译时动态链接库目录!!-I 头文件目录
g++ -L/Users/wangbing/boost/boost_1_59_0/stage/lib -I/Users/wangbing/boost/boost_1_59_0 boost_gz_stream.cpp -lboost_iostreams -lz -o boost_test


0 0
原创粉丝点击