WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: PiCore and Omxplayer  (Read 14351 times)

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 10363
Re: PiCore and Omxplayer
« Reply #15 on: November 11, 2015, 10:49:06 PM »
Hi paperone
Quote
I was reading through newbielink:https://github.com/puppetlabs/Razor-Microkernel/wiki/Building-your-own-TCL-Extension [nonactive] and tried to follow along but didn't quite manage to get the extension compilation done.
Those instructions are for X86, you are building for ARM, so there will be differences.
Under ARM, there is no  compiletc. You use  compile-essentials  instead.
The exported flags are different. I think most of them default to the correct values. Maybe bmarkus can comment on that.
I also recommend you don't use the  tce-load  commands. Use the GUI  Apps  utility and let it install the required tools
and extensions  Onboot.
Quote
- Install the build tools such as compiletc.tcz, squashfs-tools.tcz, etc.
- Find and install all dependencies, these dependencies must be already "converted" to TinyCore extensions. For example, the omxplayer requires the the dependencies as you listed above — some are in tcz format and some others aren't.
- For those that aren't, we need to "convert" them in tcz.
- Finally, find the source file of the new extension eg: omxplayer. Do "configure" with some parameters and build it using "make".
Yes, yes, yes, and yes.
Quote
- Move the build package or executable into their own folder and pack it using "mksquashfs".
Do:
Code: [Select]
./configure --helpthis will list available build options. Check for a  dest-dir  option. This will let you select a unique directory to install to
which will make squashing into a tcz a lot easier.

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7179
    • My Community Forum
Re: PiCore and Omxplayer
« Reply #16 on: November 11, 2015, 11:37:36 PM »
You can use default GCC settings. If you want to be sure using correct flags, use

Code: [Select]
-march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp
to make sure code will run on all Raspberry Pi boards. There are other options which depends on the application you are building and influence spped, size and other features.

Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline paperone

  • WikiUser
  • *
  • Posts: 19
Re: PiCore and Omxplayer
« Reply #17 on: November 12, 2015, 12:20:01 AM »
Thanks Rich, bmarkus!

I am trying to compile the last dependency now — that is libav. As suggested by Rich, I downloaded the compressed file from http://www.freedesktop.org/software/vaapi/releases/libva/libva-1.6.1.tar.bz2
But when I run "./configure $XORG_CONFIG &&" — I can't get past this step as it threw me:
checking now to run the C preprocessor... /lib/cpp
configure: error: in '/hone/tc/libva-1.6.1':
configure: error: C preprocessor "lib/cpp" fails sanity check

I searched other forum and people suggested it has something to do with c or c++ compiler but it seemed that I can run both gcc or g++ just fine from the terminal. Any idea? Here's the config.log from the configure step : https://gist.github.com/anonymous/48dcd949df7aa061adab

Hello from sunny Singapore! :)

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7179
    • My Community Forum
Re: PiCore and Omxplayer
« Reply #18 on: November 12, 2015, 12:36:57 AM »
Install Linux api headers from repo
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline paperone

  • WikiUser
  • *
  • Posts: 19
Re: PiCore and Omxplayer
« Reply #19 on: November 12, 2015, 04:54:38 AM »
Hi bmarkus,

That was the indeed the missing extension, thank you! I am slow but I managed to compile libav now.

Next, I downloaded omxplayer master branch and I was trying to compile it, along the way I found that the "make" requires 2 more extensions - git.tcz and coreutils.tcz which are there in the App Browser. From the compiling section on https://github.com/popcornmix/omxplayer#compiling, the instruction is to run the ./prepare-native-raspbian.sh script first which I skipped since I have already installed the dependencies separately using App Browser.

Next, it said build with "make ffmpeg" and this is where I am currently stuck. I waited for a while for the "make" to clone the repo and do its own thing but then it stopped and spewed out some errors. It said compiler test failed along the bottom of the output but I couldn't understand what that means and where to fix.

Code: [Select]
arm-linux-gnueabihf-gcc is unable to create an executable file.
C compiler test failed.
Full terminal output is at https://gist.github.com/anonymous/687c2e9a23e86359d5e4

Any idea?
Hello from sunny Singapore! :)

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7179
    • My Community Forum
Re: PiCore and Omxplayer
« Reply #20 on: November 12, 2015, 05:12:52 AM »
Check config.log for details on error and adjust make file according to your setup.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline paperone

  • WikiUser
  • *
  • Posts: 19
Re: PiCore and Omxplayer
« Reply #21 on: November 12, 2015, 05:33:23 AM »
Ok, I spot 2 warnings in config.log:

Code: [Select]
WARNING: arm-linux-gnueabihf-pkg-config not found, library detection may fail.
mktemp -u XXXXXX
RCXMQY
WARNING: Unknown C compiler arm-linux-gnueabihf-gcc, unable to select optimal CFLAGS
check_ld cc
check_cc

First I tried to disable some flags as suggested by Irenaud @ https://github.com/huceke/omxplayer/issues/20#issuecomment-7143502

Quote
I'm trying to run a build on a native system, and the solution thus far has been to remove all references (in Makefile.ffmpeg and Makefile.include) to the flag -mfpu=vfp and change -mfloat-abi=softfp to -mfloat-abi=hard. Native raspberry pi builds take quite a while so I haven't finished the build for a full test, but thus far that appears to fix this build error.

No luck. Removed the old build. Then I tried again to install a few things as suggested from http://stackoverflow.com/questions/14180185/gcc-arm-linux-gnueabi-command-not-found but it still throw me the same error. I am clueless as to what flags in the make file to adjust.  :-\
« Last Edit: November 12, 2015, 06:02:04 AM by paperone »
Hello from sunny Singapore! :)

Offline paperone

  • WikiUser
  • *
  • Posts: 19
Re: PiCore and Omxplayer
« Reply #22 on: November 12, 2015, 09:50:08 PM »
Ok, looks like I am asking a lot of questions and sorry to draw a bit of you time into this.  ;D Apparently, I need to delve into configure, make and make install stuff a bit more.

I am currently building ffmpeg using the configure script and make file included in the ffmpeg directory, a subdirectory in omxplayer. Will post back once I manage to get everything running and then probably create a complete guide of the steps that I went through.

Thanks bmarkus and Rich for your help so far!  :)
Hello from sunny Singapore! :)

Offline paperone

  • WikiUser
  • *
  • Posts: 19
Re: PiCore and Omxplayer
« Reply #23 on: November 13, 2015, 09:40:12 PM »
Ok, I am listing out the steps I have taken so far:

- Install the following extensions/dependencies from repo using App Browser:
   - compile-essentials.tcz (the variant of compiletc.tcz in piCore)
   - pcre-dev.tcz
   - libidn-dev.tcz
   - boost-dev.tcz
   - freetype-dev.tcz
   - libusb-dev.tcz
   - dbus-dev.tcz
   - openssl-1.0.1-dev.tcz
   - libssh2-dev.tcz
   - samba4-dev.tcz
   - pkg-config.tcz
   - linux-3.12.y_api_headers.tcz (this is needed to compile libva)
   - ffmpeg-dev.tcz and ffmpeg.tcz (there's a Makefile.ffmpeg inside omxplayer source but since the piCore repo already has ffmpeg.tcz we can just use it)
   - git.tcz (utility to clone omxplayer from github - https://github.com/popcornmix/omxplayer)
   - coreutils.tcz (maybe we don't need this?)

- libva requires pthread-stubs and libdrm so before we build that we have to install them first else it will throw out missing package error during the libva make process.
   - Download and build pthread-stubs from http://xcb.freedesktop.org/dist/libpthread-stubs-0.1.tar.bz2
      > wget http://xcb.freedesktop.org/dist/libpthread-stubs-0.1.tar.bz2
      > tar -xjvf libpthread-stubs-0.1.tar.bz2
      > cd libpthread-stubs-0.1
      > ./configure --prefix=/usr && make
      > sudo make install
      - Ref: http://www.linuxfromscratch.org/blfs/view/6.3/general/libpthread-stubs.html

   - Download and build libdrm from http://dri.freedesktop.org/libdrm/libdrm-2.4.65.tar.gz (else mid way into libva configure, it will fail with error: no package 'libdrm' found)
      > wget http://dri.freedesktop.org/libdrm/libdrm-2.4.65.tar.gz
      > tar -xzvf libdrm-2.4.65.tar.gz
      > cd libdrm-2.4.65
      > ./configure --prefix=/usr --enable-udev && make
      > sudo make install
      - Ref: http://www.linuxfromscratch.org/blfs/view/svn/x/libdrm.html

- Now, download and build libva from http://www.linuxfromscratch.org/blfs/view/svn/x/x7driver.html#libva
   > wget http://www.freedesktop.org/software/vaapi/releases/libva/libva-1.6.1.tar.bz2
   > tar jxf libva-1.6.1.tar.bz2
   > cd libva-1.6.1
   > ./configure $XORG_CONFIG && make
   > sudo make install [we're at this now...]

- Download and build omxplayer from https://github.com/popcornmix/omxplayer
   > git clone https://github.com/popcornmix/omxplayer
   > cd omxplayer
   - There's not configure script from the source so skipping it (am I doing the right thing?)
   > make
   - Got "/bin/sh: bash: not found" — fixed that by replacing bash to sh on Makefile line 51 and save the file
   > make (run again)
   - Got another error, something like "/home/dc4/tools/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi" (didn't manage to copy the screenshot as the I accidentally rebooted the system and all the build is gone). I guess I need to try from building libdrm, libpthread and libva again before I can run omxplayer make.

What a long journey hehe, and I hope to be able to tackle the omxplayer build process, natively or otherwise cross-compile I am new to this by the way, will go through another heaps of learning process again but it's fun! I am posting the previous steps in the hope of easing other people from falling in my steps, of course if you're newbie like me — you're probably doing the same mistake as mine.

For the piCore experts out there, please pick my mistakes and kindly give advice for improvement, thank you very much and have a great weekend!
« Last Edit: November 13, 2015, 09:42:09 PM by paperone »
Hello from sunny Singapore! :)

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 10363
Re: PiCore and Omxplayer
« Reply #24 on: November 13, 2015, 10:57:08 PM »
Hi paperone
I'm no PiCore expert, but this might help ....
Take another look in the repository, libpthread-stubs.tcz is in there.
Quote
./configure --prefix=/usr
That should probably be:
Code: [Select]
./configure --prefix=/usr/local
Quote
sudo make install
Rather than installing in the running system, you would be better off creating an extension
Code: [Select]
mkdir /tmp/package
sudo make install DESTDIR=/tmp/package
mksquashfs /tmp/package ExtensionName.tcz
rm -r /tmp/package
Copy the extension to your  tce  directory and add it to your  onboot.lst  file. You can load it without rebooting using
Apps load local.
Quote
Got "/bin/sh: bash: not found"
Install  bash.tcz  just in case it really needs some features of bash.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 10363
Re: PiCore and Omxplayer
« Reply #25 on: November 13, 2015, 11:19:23 PM »
Hi paperone
Xorg-7.7-lib.tcz  has  libdrm  so install  Xorg-7.7-dev.tcz.

Offline paperone

  • WikiUser
  • *
  • Posts: 19
Re: PiCore and Omxplayer
« Reply #26 on: November 15, 2015, 01:11:44 AM »
Hi Rich, thanks for the tips on creating extension the proper way and also pointing out that Xorg-7.7-dev.tcz contains libdrm. I will keep that in mind.

Now, I am trying to tailor the Makefile.include from omxplayer to my environment so that I can compile it natively on RPi Model B. I have time so I am not bothered with the fact that natively compiling thing on RPi is slow.

Looking at the Makefile.include, the TOOLCHAIN and HOST flags was pointing to a non-existent directory:
Code: [Select]
#Makefile.include
TOOLCHAIN :=/home/dc4/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/
HOST :=arm-linux-gnueabihf

Down below the Makefile.include, I found that it uses g++ so I did a
Code: [Select]
which g++the system gave me /usr/local/bin/g++ so I changed those flags to:

Code: [Select]
#Makefile.include
TOOLCHAIN :=/usr/local/
HOST :=
CXX := $(TOOLCHAIN)/bin/$(HOST)g++ --sysroot=$(SYSROOT)
CFLAGS := -Os -pipe
CXXFLAGS := -Os -pipe
LDFLAGS := -Wl,-O1

Now I am able to direct the Makefile to run g++ but when I run make, I got:
Code: [Select]
bash gen_version.sh > version.h
/usr/local//bin/g++ --sysroot=/opt/bcm-rootfs -Os -pipe -Os -pipe -std=c++0x -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -DTARGET_LINUX -fPIC -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CMAKE_CONFIG -D__VIDEOCORE4__ -U_FORTIFY_SOURCE -Wall -DHAVE_OMXLIB -DUSE_EXTERNAL_FFMPEG  -DHAVE_LIBAVCODEC_AVCODEC_H -DHAVE_LIBAVUTIL_OPT_H -DHAVE_LIBAVUTIL_MEM_H -DHAVE_LIBAVUTIL_AVUTIL_H -DHAVE_LIBAVFORMAT_AVFORMAT_H -DHAVE_LIBAVFILTER_AVFILTER_H -DHAVE_LIBSWRESAMPLE_SWRESAMPLE_H -DOMX -DOMX_SKIP64BIT -ftree-vectorize -DUSE_EXTERNAL_OMX -DTARGET_RASPBERRY_PI -DUSE_EXTERNAL_LIBBCM_HOST -isystem/opt/bcm-rootfs/opt/vc/include -isystem/opt/bcm-rootfs/usr/include -isystem/opt/bcm-rootfs/opt/vc/include/interface/vcos/pthreads -Ipcre/build -Iboost-trunk -Ifreetype2/include -I./ -Ilinux -Iffmpeg_compiled/usr/local/include/ -I /usr/include/dbus-1.0 -I /usr/lib/arm-linux-gnueabihf/dbus-1.0/include -c linux/XMemUtils.cpp -o linux/XMemUtils.o -Wno-deprecated-declarations
linux/XMemUtils.cpp:1:20:fatal error: stdlib.h: No such file or directory
 #include <stdlib.h>

 compilation terminated.
Makefile:45: recipe for target 'linux/XMemUtils.o' failed

Compile-essentials.tcz is installed right from the start, shouldn't stdlib.h file be included by default? Do you know what causes this error — by chance is there any flags that I still need to change or do I need to install other dev extension?

Also, tried install glibc_base-dev.tcz and added /usr/include to the INCLUDES flag but still it seemed make doesn't pick up the stdlib.h library.  :-\
« Last Edit: November 15, 2015, 01:26:30 AM by paperone »
Hello from sunny Singapore! :)

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 10701
Re: PiCore and Omxplayer
« Reply #27 on: November 15, 2015, 02:26:46 AM »
Remove the --sysroot option. That's also for cross-compiling.
The only barriers that can stop you are the ones you create yourself.

Offline paperone

  • WikiUser
  • *
  • Posts: 19
Re: PiCore and Omxplayer
« Reply #28 on: November 15, 2015, 06:10:44 AM »
Thanks curaga, that helped fixed the missing stdlib.h file - although I am new to the whole configure and make thing, I feel a bit embarrassed now, lol.
Now the make threw me different errors and to my inexperienced eye, I could not determine whether the error is caused by missing library or because the incorrect flags or path in the Makefile. Or do I need to download anything from http://releases.linaro.org/14.04/components/toolchain/binaries/? Sorry about the barrage of questions!

Here's the Makefile.include, Makefile and error in full, can you take a quick glance and spot anything wrong with them?

Code: [Select]
#Makefile.include
USE_BUILDROOT=0
FLOAT=hard

ifeq ($(USE_BUILDROOT), 1)
BUILDROOT :=/opt/xbmc-bcm/buildroot
SDKSTAGE :=$(BUILDROOT)/output/staging
TARGETFS :=$(BUILDROOT)/output/target
TOOLCHAIN :=$(BUILDROOT)/output/host/usr/
HOST :=arm-unknown-linux-gnueabi
SYSROOT :=$(BUILDROOT)/output/host/usr/arm-unknown-linux-gnueabi/sysroot
else
BUILDROOT :=/opt/bcm-rootfs
SDKSTAGE :=/opt/bcm-rootfs
TARGETFS :=/opt/bcm-rootfs
TOOLCHAIN :=/usr/local/
HOST :=
#SYSROOT :=$(TOOLCHAIN)/arm-bcm2708hardfp-linux-gnueabi/sysroot
SYSROOT :=/opt/bcm-rootfs
endif

JOBS=7

CFLAGS := -Os -pipe
CXXFLAGS := -Os -pipe
CPPFLAGS := $(CFLAGS)
LDFLAGS := -L$(BUILDROOT)/lib
LD := $(TOOLCHAIN)/bin/$(HOST)-ld
CC := $(TOOLCHAIN)/bin/$(HOST)-gcc
CXX := $(TOOLCHAIN)/bin/$(HOST)g++
OBJDUMP := $(TOOLCHAIN)/bin/$(HOST)-objdump
RANLIB := $(TOOLCHAIN)/bin/$(HOST)-ranlib
STRIP := $(TOOLCHAIN)/bin/$(HOST)-strip
AR := $(TOOLCHAIN)/bin/$(HOST)-ar
CXXCP := $(CXX) -E
PATH := $(PREFIX)/bin:$(BUILDROOT)/output/host/usr/bin:$(PATH)

CFLAGS += -Os -pipe
LDFLAGS += -Wl, -O1
#INCLUDES += -isystem$(SDKSTAGE)/usr/include -isystem$(SDKSTAGE)/opt/vc/include -isystem$(SYSROOT)/usr/include -isystem$(SDKSTAGE)/opt/vc/include/interface/vcos/pthreads -isystem$(SDKSTAGE)/usr/include/freetype2
#INCLUDES += -isystem$(SDKSTAGE)/opt/vc/include -isystem$(SYSROOT)/usr/include -isystem$(SDKSTAGE)/opt/vc/include/interface/vcos/pthreads -Ipcre/build -Iboost-trunk -Ifreetype2/include /usr/include
INCLUDES += /usr/include


Code: [Select]
#Makefile
include Makefile.include

CFLAGS+=-Os -pipe

LDFLAGS+=-Wl, -O1

INCLUDES+=-I./ -Ilinux -Iffmpeg_compiled/usr/local/include/ -I /usr/include/dbus-1.0 -I /usr/lib/arm-linux-gnueabihf/dbus-1.0/include /usr/include

DIST ?= omxplayer-dist

SRC=linux/XMemUtils.cpp \
utils/log.cpp \
DynamicDll.cpp \
utils/PCMRemap.cpp \
utils/RegExp.cpp \
OMXSubtitleTagSami.cpp \
OMXOverlayCodecText.cpp \
BitstreamConverter.cpp \
linux/RBP.cpp \
OMXThread.cpp \
OMXReader.cpp \
OMXStreamInfo.cpp \
OMXAudioCodecOMX.cpp \
OMXCore.cpp \
OMXVideo.cpp \
OMXAudio.cpp \
OMXClock.cpp \
File.cpp \
OMXPlayerVideo.cpp \
OMXPlayerAudio.cpp \
OMXPlayerSubtitles.cpp \
SubtitleRenderer.cpp \
Unicode.cpp \
Srt.cpp \
KeyConfig.cpp \
OMXControl.cpp \
Keyboard.cpp \
omxplayer.cpp \

OBJS+=$(filter %.o,$(SRC:.cpp=.o))

all: dist

%.o: %.cpp
@rm -f $@
$(CXX) $(CFLAGS) $(INCLUDES) -c $< -o $@ -Wno-deprecated-declarations

omxplayer.o: help.h keys.h

version:
bash gen_version.sh > version.h

omxplayer.bin: version $(OBJS)
$(CXX) $(LDFLAGS) -o omxplayer.bin $(OBJS) -lvchiq_arm -lvcos -ldbus-1 -lrt -lpthread -lavutil -lavcodec -lavformat -lswscale -lswresample -lpcre
$(STRIP) omxplayer.bin

help.h: README.md Makefile
awk '/SYNOPSIS/{p=1;print;next} p&&/KEY BINDINGS/{p=0};p' $< \
| sed -e '1,3 d' -e 's/^/"/' -e 's/$$/\\n"/' \
> $@
keys.h: README.md Makefile
awk '/KEY BINDINGS/{p=1;print;next} p&&/KEY CONFIG/{p=0};p' $< \
| sed -e '1,3 d' -e 's/^/"/' -e 's/$$/\\n"/' \
> $@

omxplayer.1: README.md
sed -e '/DOWNLOADING/,/omxplayer-dist/ d; /DBUS/,$$ d' $< >MAN
curl -F page=@MAN http://mantastic.herokuapp.com 2>/dev/null >$@

clean:
for i in $(OBJS); do (if test -e "$$i"; then ( rm $$i ); fi ); done
@rm -f omxplayer.old.log omxplayer.log
@rm -f omxplayer.bin
@rm -rf $(DIST)
@rm -f omxplayer-dist.tar.gz

ffmpeg:
@rm -rf ffmpeg
make -f Makefile.ffmpeg
make -f Makefile.ffmpeg install

dist: omxplayer.bin omxplayer.1
mkdir -p $(DIST)/usr/lib/omxplayer
mkdir -p $(DIST)/usr/bin
mkdir -p $(DIST)/usr/share/doc/omxplayer
mkdir -p $(DIST)/usr/share/man/man1
cp omxplayer omxplayer.bin $(DIST)/usr/bin
cp COPYING $(DIST)/usr/share/doc/omxplayer
cp README.md $(DIST)/usr/share/doc/omxplayer/README
cp omxplayer.1 $(DIST)/usr/share/man/man1
cp -a ffmpeg_compiled/usr/local/lib/*.so* $(DIST)/usr/lib/omxplayer/
cd $(DIST); tar -czf ../$(DIST).tgz *

Code: [Select]
tc@box:/home/omxplayer-master$ make
bash gen_version.sh > version.h
/usr/local//bin/g++ -Os -pipe -Os -pipe -Os -pipe /usr/include -I./ -Ilinux -Iffmpeg_compiled/usr/local/include/ -I /usr/include/dbus-1.0 -I /usr/lib/arm-linux-gnueabihf/dbus-1.0/include /usr/include -c utils/log.cpp -o utils/log.o -Wno-deprecated-declarations
utils/log.cpp: In static member function 'static void CLog::Log(int, const char*, ...)':
utils/log.cpp:60:64: error: expected ',' or ';' before 'PRIu64'
   static const char* prefixFormat = "%02.2d:%02.2d:%02.2d T:%" PRIu64 " %7s: ";
                                                                ^
utils/log.cpp:73:28: error: 'gettimeofday' was not declared in this scope
     gettimeofday(&now, NULL);
                            ^
utils/log.cpp:74:5: error: 'SYSTEMTIME' was not declared in this scope
     SYSTEMTIME time;
     ^
utils/log.cpp:75:10: error: request for member 'wHour' in 'time', which is of non-class type 'time_t(time_t*) throw () {aka long int(long int*) throw ()}'
     time.wHour=(now.tv_sec/3600) % 24;
          ^
utils/log.cpp:76:10: error: request for member 'wMinute' in 'time', which is of non-class type 'time_t(time_t*) throw () {aka long int(long int*) throw ()}'
     time.wMinute=(now.tv_sec/60) % 60;
          ^
utils/log.cpp:77:10: error: request for member 'wSecond' in 'time', which is of non-class type 'time_t(time_t*) throw () {aka long int(long int*) throw ()}'
     time.wSecond=now.tv_sec % 60;
          ^
utils/log.cpp:96:43: error: request for member 'wHour' in 'time', which is of non-class type 'time_t(time_t*) throw () {aka long int(long int*) throw ()}'
       strPrefix.Format(prefixFormat, time.wHour, time.wMinute, time.wSecond, stamp, levelNames[m_repeatLogLevel]);
                                           ^
utils/log.cpp:96:55: error: request for member 'wMinute' in 'time', which is of non-class type 'time_t(time_t*) throw () {aka long int(long int*) throw ()}'
       strPrefix.Format(prefixFormat, time.wHour, time.wMinute, time.wSecond, stamp, levelNames[m_repeatLogLevel]);
                                                       ^
utils/log.cpp:96:69: error: request for member 'wSecond' in 'time', which is of non-class type 'time_t(time_t*) throw () {aka long int(long int*) throw ()}'
       strPrefix.Format(prefixFormat, time.wHour, time.wMinute, time.wSecond, stamp, levelNames[m_repeatLogLevel]);
                                                                     ^
utils/log.cpp:98:57: error: expected ')' before 'LINE_ENDING'
       strData2.Format("Previous line repeats %d times." LINE_ENDING, m_repeatCount);
                                                         ^
utils/log.cpp:126:27: error: 'LINE_ENDING' was not declared in this scope
     strData.Replace("\n", LINE_ENDING"                                            ");
                           ^
utils/log.cpp:129:41: error: request for member 'wHour' in 'time', which is of non-class type 'time_t(time_t*) throw () {aka long int(long int*) throw ()}'
     strPrefix.Format(prefixFormat, time.wHour, time.wMinute, time.wSecond, stamp, levelNames[loglevel]);
                                         ^
utils/log.cpp:129:53: error: request for member 'wMinute' in 'time', which is of non-class type 'time_t(time_t*) throw () {aka long int(long int*) throw ()}'
     strPrefix.Format(prefixFormat, time.wHour, time.wMinute, time.wSecond, stamp, levelNames[loglevel]);
                                                     ^
utils/log.cpp:129:67: error: request for member 'wSecond' in 'time', which is of non-class type 'time_t(time_t*) throw () {aka long int(long int*) throw ()}'
     strPrefix.Format(prefixFormat, time.wHour, time.wMinute, time.wSecond, stamp, levelNames[loglevel]);
                                                                   ^
utils/log.cpp: In static member function 'static bool CLog::Init(const char*)':
utils/log.cpp:152:17: error: aggregate 'CLog::Init(const char*)::stat info' has incomplete type and cannot be defined
     struct stat info;
                 ^
utils/log.cpp:153:41: error: invalid use of incomplete type 'struct CLog::Init(const char*)::stat'
     if (stat(strLogFileOld.c_str(),&info) == 0 &&
                                         ^
utils/log.cpp:152:12: error: forward declaration of 'struct CLog::Init(const char*)::stat'
     struct stat info;
            ^
utils/log.cpp:156:38: error: invalid use of incomplete type 'struct CLog::Init(const char*)::stat'
     if (stat(strLogFile.c_str(),&info) == 0 &&
                                      ^
utils/log.cpp:152:12: error: forward declaration of 'struct CLog::Init(const char*)::stat'
     struct stat info;
            ^
Makefile:45: recipe for target 'utils/log.o' failed
make: *** [utils/log.o] Error 1
Hello from sunny Singapore! :)

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 10363
Re: PiCore and Omxplayer
« Reply #29 on: November 15, 2015, 08:51:13 AM »
Hi paperone
The original  Makefile  had:
Code: [Select]
CFLAGS+=-std=c++0x -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -DTARGET_LINUX -fPIC -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CMAKE_CONFIG -D__VIDEOCORE4__ -U_FORTIFY_SOURCE -Wall -DHAVE_OMXLIB -DUSE_EXTERNAL_FFMPEG  -DHAVE_LIBAVCODEC_AVCODEC_H -DHAVE_LIBAVUTIL_OPT_H -DHAVE_LIBAVUTIL_MEM_H -DHAVE_LIBAVUTIL_AVUTIL_H -DHAVE_LIBAVFORMAT_AVFORMAT_H -DHAVE_LIBAVFILTER_AVFILTER_H -DHAVE_LIBSWRESAMPLE_SWRESAMPLE_H -DOMX -DOMX_SKIP64BIT -ftree-vectorize -DUSE_EXTERNAL_OMX -DTARGET_RASPBERRY_PI -DUSE_EXTERNAL_LIBBCM_HOSTwhich you removed. I suggest putting that back in.

Quote
/usr/local//bin/g++ -Os -pipe -Os -pipe -Os -pipe /usr/include -I./ -Ilinux -Iffmpeg_compiled/usr/local/include/ -I /usr/include/dbus-1.0 -I /usr/lib/arm-linux-gnueabihf/dbus-1.0/include /usr/include -c utils/log.cpp -o utils/log.o -Wno-deprecated-declarations
-Os -pipe  shows up multiple times. Remove  -Os -pipe  from the  CFLAGS+=  statements.
/usr/include  shows up twice and is incorrect. It should be  -I/usr/include  and only defined once. Also, there should
not be a space between  -I  and what's being included.
« Last Edit: November 15, 2015, 08:54:21 AM by Rich »