Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

protoc-gen-objc: program not found or is not executable #32

Closed
wangqianjun opened this issue Feb 10, 2015 · 19 comments
Closed

protoc-gen-objc: program not found or is not executable #32

wangqianjun opened this issue Feb 10, 2015 · 19 comments
Assignees
Labels

Comments

@wangqianjun
Copy link

Hi, alexeyxo:
I got the issue when compile '.proto' file, fllowing

protoc-gen-objc: program not found or is not executable
--objc_out: protoc-gen-objc: Plugin failed with status code 1.

please help, thanks!

@alexeyxo
Copy link
Owner

what command you enter to compile?

@wangqianjun
Copy link
Author

Thank you for taking the time!
i am trying to run protocol buffers on iphone, when i type the protoc command in my Terminal i got a error, such as:

My command: protoc person.proto --objc_out="./"

and the error message is :

protoc-gen-objc: program not found or is not executable
–objc_out: protoc-gen-objc: Plugin failed with status code 1.

I'm installed proto step by step https://github.com/alexeyxo/protobuf-objc.

@alexeyxo
Copy link
Owner

Try:

which protoc-gen-objc

Give me please the log to the following commands:

  1. ./configure
  2. make
  3. make install

@wangqianjun
Copy link
Author

I am try 'protoc-gen-objc', Without success:
command> protoc-gen-objc person.proto --objc_out="./"

error:
-bash: protoc-gen-objc: command not found

@wangqianjun
Copy link
Author

./configure:
checking build system type... x86_64-apple-darwin14.0.0
checking host system type... x86_64-apple-darwin14.0.0
checking target system type... x86_64-apple-darwin14.0.0
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking C++ compiler flags...... use default: -g -O2 -DNDEBUG
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm
checking the name lister (/usr/bin/nm) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 196608
checking how to convert x86_64-apple-darwin14.0.0 file names to x86_64-apple-darwin14.0.0 format... func_convert_file_noop
checking how to convert x86_64-apple-darwin14.0.0 file names to toolchain format... func_convert_file_noop
checking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld option to reload object files... -r
checking for objdump... no
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @file support... no
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm output from gcc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for lipo... lipo
checking for otool... otool
checking for otool64... no
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking for -force_load linker flag... yes
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... yes
checking for gcc option to produce PIC... -fno-common -DPIC
checking if gcc PIC flag -fno-common -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin14.0.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no
checking whether the g++ linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking for g++ option to produce PIC... -fno-common -DPIC
checking if g++ PIC flag -fno-common -DPIC works... yes
checking if g++ static flag -static works... no
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin14.0.0 dyld
checking how to hardcode library paths into programs... immediate
checking for ANSI C header files... (cached) yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking for inttypes.h... (cached) yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking for working memcmp... yes
checking for working strtod... yes
checking for ftruncate... yes
checking for memset... yes
checking for mkdir... yes
checking for strchr... yes
checking for strerror... yes
checking for strtol... yes
checking google/protobuf/stubs/common.h usability... no
checking google/protobuf/stubs/common.h presence... no
checking for google/protobuf/stubs/common.h... no
configure: error:
ERROR: protobuf headers are required.

You must either install protobuf from google,
or if you have it installed in a custom location
you must add '-Iincludedir' to CXXFLAGS
and '-Llibdir' to LDFLAGS.

If you did not specify a prefix when installing
protobuf, try
'./configure CXXFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib'
In some 64-bit environments, try LDFLAGS=-L/usr/local/lib64.

@wangqianjun
Copy link
Author

'make' not success:
make: *** No targets specified and no makefile found. Stop.

@alexeyxo
Copy link
Owner

You have a compile errors.
Look this https://code.google.com/p/protobuf-c/issues/detail?id=88

@alexeyxo
Copy link
Owner

You should reinstall original Google Protocol Buffers

@wangqianjun
Copy link
Author

The original Google Protocol Buffers can compile .proto file to .h, .m ?

@wangqianjun
Copy link
Author

I am reinstalled Google Protocol Buffers form https://github.com/google/protobuf, but it not working.

@wangqianjun
Copy link
Author

The current version of protobuf-objc can compatible be with Google Protocol Buffers 2.6.1?

@alexeyxo
Copy link
Owner

The current version supports PB 2.6.1

@wangqianjun
Copy link
Author

Hi, alexeyxo:
I'm reinstalled Google Protocol Buffers:
download URL: https://github.com/google/protobuf
Open a Terminal
Navigate to the protocol buffers directory (protobuf-2.6.1)
Type ./configure and press return
Type make and press return
Type make check to see if it installed correctly
Type make install to install the programs
have no error.

Install protobuf-objc:
Navigate to the protocol buffers directory(protobuf-objc):
./build.sh
and i got the error:

configure: error:
ERROR: protobuf headers are required.

You must either install protobuf from google,
or if you have it installed in a custom location
you must add '-Iincludedir' to CXXFLAGS
and '-Llibdir' to LDFLAGS.

OMG, I'm going crazy. help!!

@wangqianjun
Copy link
Author

Development environment:
OSX Yosemite 10.10.1(iMac)

@alexeyxo
Copy link
Owner

try this:

./configure CXXFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib
or
./configure CXXFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib64

make && make install

After than will be ok

@alexeyxo
Copy link
Owner

Got it?

@alexeyxo alexeyxo self-assigned this Feb 20, 2015
@wangqianjun
Copy link
Author

sorry,i am in vocation

@wangqianjun
Copy link
Author

It works, thanks.

@OneWang
Copy link

OneWang commented Nov 8, 2018

i try './configure CXXFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib';but it's also hanpen this error;how to solve this problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants