Can't build OF in Eclipse, OSX 10.6.8

Hello,

I am trying to get up and running with Android but have some issues. When eclipse tries to build I get this error

…/…/…/openFrameworks//video/ofQtUtils.h:44: error: ‘MediaHandler’ was not declared in this scope
…/…/…/openFrameworks//video/ofQtUtils.h:44: error: expected primary-expression before ‘*’ token
…/…/…/openFrameworks//video/ofQtUtils.h:44: error: ‘outIsMPEG’ was not declared in this scope
…/…/…/openFrameworks//video/ofQtUtils.h:44: error: initializer expression list treated as compound expression
…/…/…/openFrameworks//video/ofQtUtils.h:45: error: ‘MediaHandler’ was not declared in this scope
…/…/…/openFrameworks//video/ofQtUtils.h:45: error: expected primary-expression before ‘*’ token
…/…/…/openFrameworks//video/ofQtUtils.h:45: error: ‘outStaticFrameRate’ was not declared in this scope
…/…/…/openFrameworks//video/ofQtUtils.h:45: error: initializer expression list treated as compound expression
…/…/…/openFrameworks//video/ofQtUtils.h:46: error: ‘Media’ was not declared in this scope
…/…/…/openFrameworks//video/ofQtUtils.h:46: error: expected primary-expression before ‘double’
…/…/…/openFrameworks//video/ofQtUtils.h:46: error: initializer expression list treated as compound expression
…/…/…/openFrameworks//video/ofQtUtils.h:47: error: variable or field ‘MovieGetVideoMediaAndMediaHandler’ declared void
…/…/…/openFrameworks//video/ofQtUtils.h:47: error: ‘Movie’ was not declared in this scope
…/…/…/openFrameworks//video/ofQtUtils.h:47: error: ‘Media’ was not declared in this scope
…/…/…/openFrameworks//video/ofQtUtils.h:47: error: ‘outMedia’ was not declared in this scope
…/…/…/openFrameworks//video/ofQtUtils.h:48: error: ‘MediaHandler’ was not declared in this scope
…/…/…/openFrameworks//video/ofQtUtils.h:48: error: ‘outMediaHandler’ was not declared in this scope
…/…/…/openFrameworks//video/ofQtUtils.h:49: error: variable or field ‘MovieGetStaticFrameRate’ declared void
…/…/…/openFrameworks//video/ofQtUtils.h:49: error: ‘Movie’ was not declared in this scope
…/…/…/openFrameworks//video/ofQtUtils.h:49: error: expected primary-expression before ‘double’
…/…/…/openFrameworks//video/ofQtUtils.h:52: error: ‘UserData’ has not been declared
…/…/…/openFrameworks//video/ofQtUtils.h:53: error: ‘UserData’ has not been declared
make[1]: *** [obj/Debug/openFrameworks/app/ofAppRunner.o] Error 1
make: *** [all] Error 2

also, the console prints that my setup is trying to build for Linux…

**** Build of configuration Linux for project openFrameworks ****

make all -C…/openFrameworksCompiled/project/linux

maybe this is an issue with my computer being 64bit? If anyone has any tips i would really appreciate it.

thanks

check the target, i think you are compiling the linux one instead of the android one, in the hammer button in the toolbar press the arrow and select android

Hi arturo and panoptican. I’m also tearing my hair out with eclipse. I am running 10.7 osx and have followed the android/eclipse steps from the oF site. I am still getting these errors

make[1]: *** [obj/androidDebug/src/main.o] Error 127
and
/bin/sh: pkg-config: command not found

I notice there is also a whole lot of reference to linux in the console eg
/bin/sh: /toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86/bin/arm-linux-androideabi-g++: No such file or directory

but I am quite definitely selecting android in the build hammer icon ( I have the openframeworks project selected in the navigator on the left hand side) It seems like a few folks are having this same issue - there is some kind of problem with the make file solution. Thanks for all your work on this so far arturo and everyone. If you have any ideas I’d really appreciate it.
cheers!

the pkg-config thing is definetly related with the target being linux, but the other line you point to is because android is actually linux so:

arm-linux-androideabi-g++

makes actually reference to the android version of g++ which is the compiler.

it’s been a while since i don’t test this in osx, will take a look

Hey Arturo, did you have any success with this at all?

thanks Tom

i’m interested in this as well … still couldn’t get it working under osx lion

I think I have the same problem…
I selected android under the hammer icon but I still have some pkg error…

When I try to build OF like it is explain here : http://www.openframeworks.cc/setup/android-eclipse/
I get this message in the console:

  
**** Build of configuration Android for project openFrameworks ****  
  
make android -C../openFrameworksCompiled/project/android   
/bin/sh: pkg-config: command not found  
/bin/sh: pkg-config: command not found  
make DebugAndroid  
make[1]: Nothing to be done for `DebugAndroid'.  
make ReleaseAndroid  
make[1]: Nothing to be done for `ReleaseAndroid'.  
make Release_arm7Android  
make[1]: Nothing to be done for `Release_arm7Android'.  
make Release_neonAndroid  
make[1]: Nothing to be done for `Release_neonAndroid'.  
  
**** Build Finished ****  
  
  

When I try to run an example on my device I have:

  
  
Makefile:361: warning: overriding commands for target `clean'  
Makefile:356: warning: ignoring old commands for target `clean'  
if [ -d "bin/data" ]; then \  
		mkdir -p res/raw; \  
		rm res/raw/androidpolygonexampleresources.zip; \  
		cd bin/data; \  
		zip -r ../../res/raw/androidpolygonexampleresources.zip *; \  
		cd ../..; \  
	fi   
if [ -f obj/ ]; then rm obj/; fi  
#touch AndroidManifest.xml  
/Users/user/Documents/OF/of_preRelease_v007_android/android-sdk-macosx/tools/android update project --target android-8 --path   
Error: Missing argument for flag --path.  
  
       Usage:  
       android [global options] update project [action options]  
       Global options:  
  -h --help    : Help on a specific command.  
  -v --verbose : Verbose mode, shows errors, warnings and all messages.  
  -s --silent  : Silent mode, shows errors only.  
  
                         Action "update project":  
  Updates an Android project (must already have an AndroidManifest.xml).  
Options:  
  -l --library    : Directory of an Android library to add, relative to this  
                    project's directory.  
  -p --path       : The project's directory. [required]  
  -n --name       : Project name.  
  -t --target     : Target ID to set for the project.  
  -s --subprojects: Also updates any projects in sub-folders, such as test  
                    projects.  
make: *** [AndroidInstall] Error 1  
  

Thanks

Hi guys,

I think I am progressing but it is still not working…
I am on OSX 10.7.2 and it is seems to be tricky to use OF Android on this platform.

I collected on the forum some tips that can be useful, so far:

  • using android-ndk-r5b
  • downloading openframeworks-openFrameworks-7ca7833 from Github
  • Installing Android SDK API 8 and API 10
  • Changing the hammer button to Android and remove “build Automatically” in project menu

When trying to build and install an example:

  • changing the hammer to AndroidRelaese
  • make sure the project Explorer window is highlighted to avoid the “Problem Occurred” window.

the “/bin/sh: pkg-config: command not found” is still here when I build the OF folder but I read that it can work even with these errors (Confirmation of this would be usefull).

But I still have this error:

  
Makefile:361: warning: overriding commands for target `clean'  
Makefile:356: warning: ignoring old commands for target `clean'  
make: execvp: /Users/urs/Documents/OF/OF_Android/android-sdk-macosx: Permission denied  
if [ -d "bin/data" ]; then \  
		mkdir -p res/raw; \  
		rm res/raw/androidassimpexampleresources.zip; \  
		cd bin/data; \  
		zip -r ../../res/raw/androidassimpexampleresources.zip *; \  
		cd ../..; \  
	fi   
  adding: astroboy_walk.dae (deflated 80%)  
  adding: boy_10.tga (deflated 84%)  
if [ -f obj/ ]; then rm obj/; fi  
#touch AndroidManifest.xml  
/Users/urs/Documents/OF/OF_Android/android-sdk-macosx /tools/android update project --target android-8 --path   
make: /Users/urs/Documents/OF/OF_Android/android-sdk-macosx: Permission denied  
make: *** [AndroidInstall] Error 1  

Any thought ?

In your Android Install external tool configuration, does project_loc have a backslash in it, like project\_loc? That was an error in the documentation, and it would mean that the android update command wouldn’t get the path of the project correctly.

Regarding pkg-config, I see these errors every so often. It seems to be only used for detecting linux libraries (AFAICT from the makefiles) and failure of the command evaluates to false, which doesn’t seem to cause any trouble.

No idea about your ‘permission denied’ problem, maybe you just don’t have full rights to that directory?