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

Build Errors #1

Closed
shakith opened this issue Feb 9, 2017 · 14 comments
Closed

Build Errors #1

shakith opened this issue Feb 9, 2017 · 14 comments

Comments

@shakith
Copy link

shakith commented Feb 9, 2017

Hi Kai,

This is a great initiative to test an android camera without using the android.hardware.Camera apis.
I am trying to build the the examples, but I get the following attached errors.
screenshot from 2017-02-09 15-04-18

The application.mk file is.
APP_ABI := armeabi APP_PLATFORM := android-19

And the android.mk file is.
`LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := v4l2test

LOCAL_MODULE_TAGS := optional

LOCAL_MODULE_PATH := $(TARGET_OUT)/bin

LOCAL_SRC_FILES :=
v4l2test.cpp
ffjpeg.cpp
camdev.cpp

LOCAL_SHARED_LIBRARIES :=
libutils
libcutils
libui
libgui
libandroid_runtime

#++ for ffmpeg library
LOCAL_CFLAGS +=
-D__STDC_CONSTANT_MACROS

LOCAL_C_INCLUDES +=
$(LOCAL_PATH)/ffmpeg/include

LOCAL_C_INCLUDES += /AOSP/frameworks/native/include/
LOCAL_C_INCLUDES += /AOSP/system/core/include/
LOCAL_C_INCLUDES += /AOSP/hardware/libhardware/include

LOCAL_LDFLAGS += -ldl
$(LOCAL_PATH)/ffmpeg/lib/libavformat.a
$(LOCAL_PATH)/ffmpeg/lib/libavcodec.a
$(LOCAL_PATH)/ffmpeg/lib/libswresample.a
$(LOCAL_PATH)/ffmpeg/lib/libswscale.a
$(LOCAL_PATH)/ffmpeg/lib/libavutil.a
$(LOCAL_PATH)/ffmpeg/lib/libx264.a
#-- for ffmpeg library

LOCAL_MULTILIB := 32

include $(BUILD_EXECUTABLE)

include $(CLEAR_VARS)

LOCAL_MODULE := encodertest

LOCAL_MODULE_TAGS := optional

LOCAL_MODULE_PATH := $(TARGET_OUT)/bin

LOCAL_SRC_FILES :=
ffjpeg.cpp
ffencoder.cpp
encodertest.cpp

LOCAL_SHARED_LIBRARIES :=
libutils
libcutils

#++ for ffmpeg library
LOCAL_CFLAGS +=
-D__STDC_CONSTANT_MACROS

LOCAL_C_INCLUDES +=
$(LOCAL_PATH)/ffmpeg/include

LOCAL_C_INCLUDES += /AOSP/frameworks/native/include/
LOCAL_C_INCLUDES += /AOSP/system/core/include/
LOCAL_C_INCLUDES += /AOSP/hardware/libhardware/include

LOCAL_LDFLAGS += -ldl
$(LOCAL_PATH)/ffmpeg/lib/libavformat.a
$(LOCAL_PATH)/ffmpeg/lib/libavcodec.a
$(LOCAL_PATH)/ffmpeg/lib/libswresample.a
$(LOCAL_PATH)/ffmpeg/lib/libswscale.a
$(LOCAL_PATH)/ffmpeg/lib/libavutil.a
$(LOCAL_PATH)/ffmpeg/lib/libx264.a
#-- for ffmpeg library

LOCAL_MULTILIB := 32

include $(BUILD_EXECUTABLE)

include $(CLEAR_VARS)

LOCAL_MODULE := recordertest

LOCAL_MODULE_TAGS := optional

LOCAL_MODULE_PATH := $(TARGET_OUT)/bin

LOCAL_C_INCLUDES := /AOSP/external/tinyalsa/include

LOCAL_SRC_FILES :=
micdev_tinyalsa.cpp
ffjpeg.cpp
camdev.cpp
ffencoder.cpp
ffrecorder.cpp
recordertest.cpp

LOCAL_SHARED_LIBRARIES :=
libutils
libcutils
libui
libgui
libandroid_runtime
libtinyalsa

#++ for ffmpeg library
LOCAL_CFLAGS +=
-D__STDC_CONSTANT_MACROS

LOCAL_C_INCLUDES +=
$(LOCAL_PATH)/ffmpeg/include
LOCAL_C_INCLUDES += /AOSP/frameworks/native/include/
LOCAL_C_INCLUDES += /AOSP/system/core/include/
LOCAL_C_INCLUDES += /AOSP/hardware/libhardware/include

LOCAL_LDFLAGS += -ldl
$(LOCAL_PATH)/ffmpeg/lib/libavformat.a
$(LOCAL_PATH)/ffmpeg/lib/libavcodec.a
$(LOCAL_PATH)/ffmpeg/lib/libswresample.a
$(LOCAL_PATH)/ffmpeg/lib/libswscale.a
$(LOCAL_PATH)/ffmpeg/lib/libavutil.a
$(LOCAL_PATH)/ffmpeg/lib/libx264.a
#-- for ffmpeg library

LOCAL_MULTILIB := 32

include $(BUILD_EXECUTABLE)
`

What platform SDK was this built on? I am using the newest NDK from android studio. I am building your examples through nkd-build.

Thanks in advance.

@rockcarry
Copy link
Owner

rockcarry commented Feb 10, 2017

I checked you android.mk, I found it missing "\" ??

for example:

in yours
LOCAL_SRC_FILES :=
v4l2test.cpp
ffjpeg.cpp
camdev.cpp

but it shoud like this:
LOCAL_SRC_FILES :=
v4l2test.cpp \
ffjpeg.cpp \
camdev.cpp

maybe you are missing the "\". (or the github web display bug ?)

I built these codes under Allwinner A33 android 4.4 source code enviroment.
In theory it is possible using NDK, but I suggest you using NDK version which corresponding to the Android4.4.

good luck.

@shakith
Copy link
Author

shakith commented Feb 10, 2017

I checked and "" are in the mk file. It looks like a github web display bug. could you share your NDK toolchain mentioned in the readme (arm-linux-androideabi-4.7.1-full-linux-x86.tar.bz2)?

@rockcarry
Copy link
Owner

arm-linux-androideabi-4.7.1-full-linux-x86.tar.bz2
no problem, but how to give it to you ? about 39MB size.

@rockcarry
Copy link
Owner

I upload it to the Baidu cloud, please try download:
link: http://pan.baidu.com/s/1qYxwcQK passcode: sqc8

@shakith
Copy link
Author

shakith commented Feb 10, 2017

Got it. Thanks

@rockcarry
Copy link
Owner

dose it compile success now ? or not ?

@shakith
Copy link
Author

shakith commented Feb 11, 2017

Not yet. A seperate makefile is needed to build test programs using arm-linux-androideabi-4.7.1-full-linux-x86.tar.bz2 toolchain. Do you already have such a makefile?

@rockcarry
Copy link
Owner

sorry. I only use arm-linux-androideabi-4.7.1-full-linux-x86 toolchain to build ffmpeg library for v4l2test.
the source code of v4l2test need build using NDK or in android source code building enviroment.
the arm-linux-androideabi-4.7.1-full-linux-x86 toolchain is a standalone toolchain for android, it means you can use it to build c/c++ source without NDK.

@shakith
Copy link
Author

shakith commented Feb 13, 2017

Okay. I want to build v4l2test without using NDK. As I have build errors with NDK. How did you build v4l2test without using the NDK? Did you create a makefile to build c/c++ (e.g. v4l2test) using the arm-linux-androideabi-4.7.1-full-linux-x86 stnadalone toolchain?

@rockcarry
Copy link
Owner

some source code of v4l2test using android header files, example:

in camdev.h
#include <gui/Surface.h>
#include <gui/SurfaceComposerClient.h>
#include <gui/ISurfaceComposer.h>
#include <ui/DisplayInfo.h>
#include <ui/GraphicBufferMapper.h>

these header files are not included in the standalone toolchains.

so you need NDK and download related android source code or header files.

I sugguest you download the android 4.4 source code, and try to build it.

my build steps in android source code enviroment:

  1. cd android-source dir
  2. copy v4l2test to android-source dir
  3. source build/envsetup.sh
  4. lunch (select a device combo)
  5. make -j8 (this will make whole android source code )
  6. mmm v4l2test -B (this will build v4l2test project)

@shakith
Copy link
Author

shakith commented Feb 15, 2017

Thanks. I managed to build it.

@shakith shakith closed this as completed Feb 15, 2017
@rockcarry
Copy link
Owner

great

@rockcarry
Copy link
Owner

you write a new makefile ?
could you please share you modification, this maybe helpful for other peoples.
thank you.

@shakith
Copy link
Author

shakith commented Mar 1, 2017

Sorry fro the late reply. I didnt make a new makefile. I just followed your steps build the project using mmm v4l2test -B

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

No branches or pull requests

2 participants