1

我试图让 libmongocxx 在根据以下内容编译后在 Debian Jessie 64bit 上运行: quickstartguide

我添加了 find 命令返回的路径作为编译器抱怨丢失的 libmongoc-1.0.pc 文件的位置:

$: sudo find / -name "libmongoc-1.0.pc"

/opt/mongo-c-driver/src/libmongoc-1.0.pc
/opt/mongo-c/lib/pkgconfig/libmongoc-1.0.pc

我尝试在 pkg 路径声明中设置特定的依赖项:

 PKG_CONFIG_PATH=/opt/mongo-c/lib/pkgconfig c++ --std=c++11 main.cpp -  o hellomongo $(pkg-config --cflags --libs libmongocxx)

但是鉴于 xx 不同的尝试,我不断收到此错误:

  Package libmongoc-1.0 was not found in the pkg-config search path.
  Perhaps you should add the directory containing `libmongoc-1.0.pc'
  to the PKG_CONFIG_PATH environment variable
  Package 'libmongoc-1.0', required by 'libmongocxx', not found
  c++: error: main.cpp: No such file or directory
  c++: fatal error: no input files
  compilation terminated.

我希望有人可以启发我。

4

0 回答 0