Linux status/workaround for "error: undef'd ref to 'CPlatform::CreateInstance()'"?
#1
Question 
I'm building kodi/master on linux/64,
Code:
    git log | head
        commit af8af7ca1031282f20260362985138249b5acf14
        Merge: fd00a12 241b148
        Author: Martijn Kaijser <[email protected]>
        Date:   Sun Nov 6 22:18:15 2016 +0100

            Merge pull request #10876 from phil65/reset_videocodecinfo

            [videoplayer] reset VideoCodecInfo in CProcessInfo constructor

        commit fd00a12a838810e1575cfd8861dc3039e5dbfdf5
configure + build looks ok, until late linking steps.

currently fails at
Code:
    ...
    [100%] Linking CXX executable kodi.bin
    /usr/bin/cmake -E cmake_link_script CMakeFiles/kodi.dir/link.txt --verbose=1
    /dev/src/kodi/build/build/ffmpeg-link-wrapper /usr/bin/g++  -O3 -Wall -fstack-protector -funwind-tables -fasynchronous-unwind-tables -fmessage-length=0 -grecord-gcc-switches -march=native -mtune=native -std=c++11 -I/usr/include/freetype2 -I/usr/local/include -O3 -DNDEBUG -s  -L/usr/local/lib64 -Wl,-rpath,/usr/local/lib64 -fuse-ld=gold CMakeFiles/kodi.dir/dev/src/kodi/xbmc/platform/posix/main.cpp.o -o kodi.bin -rdynamic -Wl,--whole-archive build/upnp/libupnp.a build/unrarxlib/libunrarxlib.a build/swig/libpython_binding.a -Wl,--no-whole-archive libkodi.a build/upnp/libupnp.a build/unrarxlib/libunrarxlib.a build/swig/libpython_binding.a -lpthread -lsqlite3 -lfreetype /usr/local/lib64/libpcrecpp.so /usr/local/lib64/libpcre.so build/libdvd/lib/libdvdnav.a build/libdvd/lib/libdvdread.a build/libdvd/lib/libdvdcss.a -ltinyxml -lpython2.7 -lyajl -llzo2 -lfribidi -ltag build/lib/libcrossguid.a -luuid -lz /usr/local/lib64/libmicrohttpd.so -lgcrypt -lgpg-error -lrt /usr/local/mariadb/lib64/libmysqlclient.so /usr/local/lib64/libssh.so -lxslt -lxml2 -lasound -ludev -ldbus-1 /usr/local/lib64/libvdpau.so -lva -lva-x11 /usr/local/ssl/lib64/libssl.so /usr/local/ssl/lib64/libcrypto.so -lcdio -lGL -lGLU -lX11 -lXext -ldrm -lXrandr -lEGL -ldl -Wl,-rpath,/usr/local/lib64:/usr/local/mariadb/lib64:/usr/local/ssl/lib64
    libkodi.a(ServiceManager.cpp.o):ServiceManager.cpp:function CServiceManager::Init1(): error: undefined reference to 'CPlatform::CreateInstance()'
    collect2: error: ld returned 1 exit status
    CMakeFiles/kodi.dir/build.make:142: recipe for target 'kodi.bin' failed
    gmake[2]: *** [kodi.bin] Error 1
    gmake[2]: Leaving directory '/dev/src/kodi/build'
    CMakeFiles/Makefile2:423: recipe for target 'CMakeFiles/kodi.dir/all' failed
    gmake[1]: *** [CMakeFiles/kodi.dir/all] Error 2
    gmake[1]: Leaving directory '/dev/src/kodi/build'
    Makefile:130: recipe for target 'all' failed
    gmake: *** [all] Error 2
Digging around re:
Code:
    CServiceManager::Init1(): error: undefined reference to 'CPlatform::CreateInstance()'
I think this is causing my issue
Code:
    [platform] - add unique hardware identifier as info label #10543
     https://github.com/xbmc/xbmc/pull/10543#issuecomment-249412529
That thread ends,
Code:
    https://github.com/xbmc/xbmc/pull/10543#issuecomment-255586521
        "... This code is not merged and likely will not be merged until both a team consensus on scope and size and a public involvement on the forum has taken place.  ..."
Assuming that's the relevant issue here (is it?), until it's resolved, what's the workaround for now?

IS there a cmd-line config, or manual edit, that'll fix this?

Or do I need to drop back to a particular source rev?
Reply
#2
Re:

> Or do I need to drop back to a particular source rev?

1st walking backwards through tags, 17.0b2 appears to be before the ~Sep19-24th commits that start causing this issue.

17.0b2 won't configure without error, lacking
Code:
    https://github.com/xbmc/xbmc/commit/247b43a48c5b576df90f04353a07e32002e198cf
OTOH, 17.0b3 includes that^ commit, and gets a sane configure, but build fails as reported above,
Code:
...
libkodi.a(ServiceManager.cpp.o):ServiceManager.cpp:function CServiceManager::Init1(): error: undefined reference to 'CPlatform::CreateInstance()'

and, no surprise, so do 17.0b4 & 17.0b5.
Reply
#3
Unless you patched kodi with the UUID PR yourself, it cannot be the problem, since it is not in master...

Pastebin a full build log and your CMakeCache.txt
Reply
#4
(2016-11-07, 11:04)wsnipex Wrote: Unless you patched kodi with the UUID PR yourself, it cannot be the problem, since it is not in master...

Not intentionally ...

(2016-11-07, 11:04)wsnipex Wrote: Pastebin a full build log

https://pastebin.com/6FytNenb

(2016-11-07, 11:04)wsnipex Wrote: and your CMakeCache.txt

https://pastebin.com/UiYfnmap
Reply
#5
something is off there, your system doesn't compile platform_common.a, which contains the symbol.
Are you sure you are compiling kodi master, without any patches?

did you already try a clean build?
Code:
git fetch
git reset --hard origin/master
git clean -xfd
then build again
Reply
#6
(2016-11-07, 19:58)wsnipex Wrote: something is off there, your system doesn't compile platform_common.a, which contains the symbol.
Are you sure you are compiling kodi master, without any patches?

did you already try a clean build?
Code:
git fetch
git reset --hard origin/master
git clean -xfd
then build again

yep, master. no patches.

And I reset & clean each time, unless I do a completely new/clean checkout ...

p.s. just re-did a sanity check. starting from clean checkout. same issue ...
Reply
#7
@wsnipex

Quote:your system doesn't compile platform_common.a

With that hint, I can get a complete build if I change my long-standing cmake config, enabling static libs

Code:
    cmake \
    ...
    -DBUILD_SHARED_LIBS=1 \
-    -DENABLE_STATIC_LIBS=0 \
+    -DENABLE_STATIC_LIBS=1 \
    ...

With that change, I get to

Code:
...
gmake[2]: Leaving directory '/dev/src/kodi/build'
[100%] Built target kodi
gmake[1]: Leaving directory '/dev/src/kodi/build'
/usr/bin/cmake -E cmake_progress_start /dev/src/kodi/build/CMakeFiles 0

./kodi.bin --version
  17.0-BETA6 Git:20161107-40a6575-dirty Media Center Kodi
  Copyright (C) 2005-2013 Team Kodi - http://kodi.tv

cmake STATIC_LIBS == 1 has not been previously needed.

What's changed that it is now?

Or is this actually a bug?
Reply
#8
hmm, guess you found a bug.
Reply
#9
(2016-11-08, 09:31)wsnipex Wrote: hmm, guess you found a bug.

->

cmake sharedlib build fails, doesn't compile platform_common.a, unless "-DENABLE_STATIC_LIBS=1" is set
http://trac.kodi.tv/ticket/17061#ticket
Reply
#10
Yep, that's a bug: https://github.com/xbmc/xbmc/pull/10897
Thanks for reporting.
Reply

Logout Mark Read Team Forum Stats Members Help
status/workaround for "error: undef'd ref to 'CPlatform::CreateInstance()'"?0