twelve17 / openalpr-ios

Xcode Framework for the openalpr library
GNU General Public License v3.0
116 stars 35 forks source link

Building leptonica error #27

Closed ducnmisbk closed 8 years ago

ducnmisbk commented 8 years ago

Hi I'm getting errors when trying to run bundle exec ./bin/build_frameworks.rb Any ideas?

Ducs-Mac-mini:openalpr-ios-master ducnm33$ bundle exec ./bin/build_frameworks.rb
options: {}
Downloading opencv2 library.
adding opencv2 headers symlink hack: /Users/ducnm33/Downloads/TestOpenAlprIos/openalpr-ios-master/output/opencv2.framework/Headers/opencv2 -> /Users/ducnm33/Downloads/TestOpenAlprIos/openalpr-ios-master/output/opencv2.framework/Headers
Downloading leptonica library.
Building leptonica for armv7 from /Users/ducnm33/Downloads/TestOpenAlprIos/openalpr-ios-master/work/leptonica-1.71
make: *** No rule to make target `clean'.  Stop.
make: *** No rule to make target `distclean'.  Stop.
configure: WARNING: if you wanted to set the --build type, don't use --host.
    If a cross compiler is detected then cross compile mode will be used
configure: error: in `/Users/ducnm33/Downloads/TestOpenAlprIos/openalpr-ios-master/work/leptonica-1.71':
configure: error: C compiler cannot create executables
See `config.log' for more details
/Users/ducnm33/Downloads/TestOpenAlprIos/openalpr-ios-master/lib/alpr/utils.rb:44:in `execute': Child returned: pid 44897 exit 77 (RuntimeError)
    from /Users/ducnm33/Downloads/TestOpenAlprIos/openalpr-ios-master/lib/alpr/utils.rb:74:in `log_execute'
    from /Users/ducnm33/Downloads/TestOpenAlprIos/openalpr-ios-master/lib/alpr/package/automake.rb:147:in `do_autoconf_build'
    from /Users/ducnm33/Downloads/TestOpenAlprIos/openalpr-ios-master/lib/alpr/package/automake.rb:58:in `build_arch'
    from /Users/ducnm33/Downloads/TestOpenAlprIos/openalpr-ios-master/lib/alpr/package/base.rb:53:in `block in install'
    from /Users/ducnm33/Downloads/TestOpenAlprIos/openalpr-ios-master/lib/alpr/package/base.rb:52:in `each'
    from /Users/ducnm33/Downloads/TestOpenAlprIos/openalpr-ios-master/lib/alpr/package/base.rb:52:in `install'
    from ./bin/build_frameworks.rb:69:in `<main>'
ducnmisbk commented 8 years ago

Resolved!

My problem was I have 2 versions of xcode (Xcode.app and Xcode 2.app). I set default xcode to XCode.app and the problem was resolved.

staticdreams commented 7 years ago

I'm having similar error, apart from the fact that it is a bit further down the command line and this difference:

configure: error: cannot run C compiled programs. VS configure: error: C compiler cannot create executables

➜  openalpr-ios git:(master) bundle exec ./bin/build_frameworks.rb
options: {}
Package opencv2 is already installed. Skipping build.
Building leptonica for armv7 from /Users/Peter/Desktop/openalpr-ios/work/leptonica-1.71
make: *** No rule to make target `clean'.  Stop.
make: *** No rule to make target `distclean'.  Stop.
configure: WARNING: if you wanted to set the --build type, don't use --host.
    If a cross compiler is detected then cross compile mode will be used
configure: WARNING: using cross tools not prefixed with host triplet
Building leptonica for armv7s from /Users/Peter/Desktop/openalpr-ios/work/leptonica-1.71
configure: WARNING: if you wanted to set the --build type, don't use --host.
    If a cross compiler is detected then cross compile mode will be used
configure: WARNING: using cross tools not prefixed with host triplet
Building leptonica for arm64 from /Users/Peter/Desktop/openalpr-ios/work/leptonica-1.71
configure: WARNING: if you wanted to set the --build type, don't use --host.
    If a cross compiler is detected then cross compile mode will be used
configure: WARNING: using cross tools not prefixed with host triplet
Building leptonica for i386 from /Users/Peter/Desktop/openalpr-ios/work/leptonica-1.71
configure: error: in `/Users/Peter/Desktop/openalpr-ios/work/leptonica-1.71':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
bundler: failed to load command: ./bin/build_frameworks.rb (./bin/build_frameworks.rb)
RuntimeError: Child returned: pid 49854 exit 1
  /Users/Peter/Desktop/openalpr-ios/lib/alpr/utils.rb:44:in `execute'
  /Users/Peter/Desktop/openalpr-ios/lib/alpr/utils.rb:74:in `log_execute'
  /Users/Peter/Desktop/openalpr-ios/lib/alpr/package/automake.rb:147:in `do_autoconf_build'
  /Users/Peter/Desktop/openalpr-ios/lib/alpr/package/automake.rb:58:in `build_arch'
  /Users/Peter/Desktop/openalpr-ios/lib/alpr/package/base.rb:53:in `block in install'
  /Users/Peter/Desktop/openalpr-ios/lib/alpr/package/base.rb:52:in `each'
  /Users/Peter/Desktop/openalpr-ios/lib/alpr/package/base.rb:52:in `install'
  /Users/Peter/Desktop/openalpr-ios/bin/build_frameworks.rb:69:in `<top (required)>'

I only have one version of Xcode installed (currently 8.1, but it didn't work with 8.0 either). And it is located in the default path:

/Applications/Xcode.app

Any suggestions?

@ducnmisbk perhaps you have any other tips?