【问题标题】:compiling protobuf 2.6.1 for android in windows在 Windows 中为 android 编译 protobuf 2.6.1
【发布时间】:2015-12-01 07:22:01
【问题描述】:

我试图在 Windows 中为 Android 编译 protobuf 2.6.1。我正在使用 MinGw 并从 https://developers.google.com/protocol-buffers/docs/downloads 下载了 protobuf 源

我能够毫无问题地运行以下配置脚本。

./configure --host=arm-linux-androideabi --disable-shared 
--enable-cross-compile CC=C:/Android/android-ndk-r10/toolchain
/arm-linux-androideabi-4.8/prebuilt/windows-x86_64/bin/arm-linux-
androideabi-gcc.exe CXX=C:/Android/android-ndk-r10/toolchains/arm-linux-
androideabi-4.8/prebuilt/windows-x86_64/bin/arm-linux-androideabi-
g++.exe LDFLAGS="-LC:/Android/android-ndk-r10/platforms/android-19/arch-
arm/usr/lib --sysroot=C:/Android/android-ndk-r10/platforms/android-
19/arch-arm" CPPFLAGS=-IC:/Android/android-ndk-r10/platforms/android-
19/arch-arm/usr/include

当我运行 make 命令时,会显示以下错误。

$ make
C:/MinGW/msys/1.0/bin/make  all-recursive
make[1]: Entering directory 'C:/MinGW/msys/1.0/home/VENKRAJ/protobuf'
Making all in .
make[2]: Entering directory 'C:/MinGW/msys/1.0/home/VENKRAJ/protobuf'
make[2]: Nothing to be done for 'all-am'.
make[2]: Leaving directory 'C:/MinGW/msys/1.0/home/VENKRAJ/protobuf'
Making all in src
make[2]: Entering directory 'C:/MinGW/msys/1.0/home/VENKRAJ/protobuf/src'
depbase=`echo google/protobuf/compiler/main.o | sed 's|[^/]*$|.deps
/&|;s|\.o$||'
`;\
C:/Android/android-ndk-r10/toolchains/arm-linux-androideabi-4.8/prebuilt 
/windows-x86_64/bin/arm-linux-androideabi-g++.exe -DHAVE_CONFIG_H -I.  
-I..   -IC:/Android/android-ndk-r10/platforms/android-19/arch-arm/usr
/include  -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare 
-O2 -g -DNDEBUG -MT google/protobuf/compiler/main.o -MD -MP -MF 
$depbase.Tpo -c -o google/protobuf/compiler/main.o google/protobuf
/compiler/main.cc &&\mv -f $depbase.Tpo $depbase.Po
In file included from ./google/protobuf/compiler
/command_line_interface.h:41:0,from google/protobuf/compiler/main.cc:33:

./google/protobuf/stubs/common.h:40:19: fatal error: cstddef: No such 
file or directory
#include <cstddef>
               ^
compilation terminated.
Makefile:2039: recipe for target 'google/protobuf/compiler/main.o' failed
make[2]: *** [google/protobuf/compiler/main.o] Error 1
make[2]: Leaving directory 'C:/MinGW/msys/1.0/home/VENKRAJ/protobuf/src'
Makefile:700: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory 'C:/MinGW/msys/1.0/home/VENKRAJ/protobuf'
Makefile:606: recipe for target 'all' failed
make: *** [all] Error 2

请告诉我哪里出错了。

【问题讨论】:

  • 我有同样的问题(但使用 arm-none-eabi-gcc/g++ 编译器)

标签: android c++ windows qt protocol-buffers


【解决方案1】:

尝试运行

清理

使distclean

然后重新运行

./配置

制作

【讨论】:

  • Jonathan...我做了一个 make clean 但我仍然面临同样的错误。
  • 你能编译吗?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-06-08
  • 1970-01-01
  • 1970-01-01
  • 2011-10-08
  • 2018-02-15
  • 1970-01-01
相关资源
最近更新 更多