我目前正在开发一个项目,我试图实现协议缓冲区作为序列化格式在本地计算机上存储数据,然后稍后再回读。协议缓冲区的一些功能对于这个项目来说似乎很完美,所以我急于测试它,但是我遇到了一些问题。构建和使用Google协议缓冲区
到目前为止,我还没有足够的时间来测试协议缓冲区。我将最新的zip文件(版本2.4.1)下载到我的Windows机器上。我阅读了位于文件夹根目录下的install.txt文件,但它是基于Unix的系统。然后我看到它带有一个vsprojects文件夹,并阅读其中列出的说明。基本上,我被告知要做的是打开一个解决方案,然后在Debug或Release中构建整个解决方案。我立即收到一些关于“config.h”未找到的错误。
我再次检查了Unix的说明和步骤之一是...
cd' to the directory containing the package's source code and type './configure' to configure the package for your system. If you're using
CSH“在旧版本的System V的,你可能需要输入sh ./configure' instead to prevent
CSH”从试图执行 `configure'本身。运行`configure'需要一段时间。在运行时,它会打印一些 消息,告诉它正在检查哪些功能。
因此,我启动到我很少使用的Ubuntu,并尝试按照这些说明。上面列出的步骤去罚款,我甚至能够获得下一步和“做”的项目,但是当时间到了使用“make install”命令,我收到以下错误:
[email protected]:~/Desktop/protobuf-2.4.1$ make install
Making install in .
make[1]: Entering directory `/home/ross/Desktop/protobuf-2.4.1'
make[2]: Entering directory `/home/ross/Desktop/protobuf-2.4.1'
make[2]: Nothing to be done for `install-exec-am'.
test -z "/usr/local/lib/pkgconfig" || /bin/mkdir -p "/usr/local/lib/pkgconfig"
/bin/mkdir: cannot create directory `/usr/local/lib/pkgconfig': Permission denied
make[2]: *** [install-pkgconfigDATA] Error 1
make[2]: Leaving directory `/home/ross/Desktop/protobuf-2.4.1'
make[1]: *** [install-am] Error 2
make[1]: Leaving directory `/home/ross/Desktop/protobuf-2.4.1'
化妆:* [安装递归]错误1
我主要使用Windows进行开发,我正在使用的整个项目现在正在Windows中进行,所以我有点担心。有没有人有幸在Windows或Linux中建立协议缓冲区?
谢谢
好吧,那为linux的一方工作。不要以为你有任何有用的Windows建议?我检查了运行configure的第一步没有生成一个config.h,因为我希望... – 2011-12-14 20:08:25