juliagoda / antimicroX

Graphical program used to map keyboard buttons and mouse controls to a gamepad. Useful for playing games with no gamepad support
GNU General Public License v3.0
92 stars 13 forks source link

Won't compile on Raspbian Buster #111

Closed DaFunkShun closed 4 years ago

DaFunkShun commented 4 years ago

I can compile perfectly on my Ubuntu machine but make fails on Raspbian Buster on the Raspberry Pi4.

/usr/bin/ld: CMakeFiles/antilib.dir/src/gamecontroller/gamecontrollerdpad.cpp.o:(.data.rel.ro+0x0): multiple definition oftypeinfo for JoyDPadXml'; CMakeFiles/antilib.dir/src/gamecontroller/xml/moc_gamecontrollerdpadxml.cpp.o:(.data.rel.ro+0x5c): first defined here

/usr/bin/ld: CMakeFiles/antilib.dir/src/gamecontroller/gamecontrollerdpad.cpp.o:(.data.rel.ro+0xc): multiple definition of `typeinfo for JoyDPadXml'; CMakeFiles/antilib.dir/src/gamecontroller/xml/moc_gamecontrollerdpadxml.cpp.o:(.data.rel.ro+0x68): first defined here

/usr/bin/ld: CMakeFiles/antilib.dir/src/gamecontroller/gamecontrollerdpad.cpp.o:(.rodata+0x78): multiple definition of `typeinfo name for JoyDPadXml'; CMakeFiles/antilib.dir/src/gamecontroller/xml/moc_gamecontrollerdpadxml.cpp.o:(.rodata+0xe8): first defined here

/usr/bin/ld: CMakeFiles/antilib.dir/src/gamecontroller/gamecontrollerdpad.cpp.o:(.rodata+0x90): multiple definition of `typeinfo name for JoyDPadXml'; CMakeFiles/antilib.dir/src/gamecontroller/xml/moc_gamecontrollerdpadxml.cpp.o:(.rodata+0x100): first defined here

/usr/bin/ld: CMakeFiles/antilib.dir/src/gamecontroller/gamecontrollerset.cpp.o:(.data.rel.ro+0x0): multiple definition of `typeinfo for JoyDPadXml'; CMakeFiles/antilib.dir/src/gamecontroller/xml/moc_gamecontrollerdpadxml.cpp.o:(.data.rel.ro+0x5c): first defined here

/usr/bin/ld: CMakeFiles/antilib.dir/src/gamecontroller/gamecontrollerset.cpp.o:(.data.rel.ro+0xc): multiple definition of `typeinfo for JoyDPadXml'; CMakeFiles/antilib.dir/src/gamecontroller/xml/moc_gamecontrollerdpadxml.cpp.o:(.data.rel.ro+0x68): first defined here

/usr/bin/ld: CMakeFiles/antilib.dir/src/gamecontroller/gamecontrollerset.cpp.o:(.rodata+0x130): multiple definition of `typeinfo name for JoyDPadXml'; CMakeFiles/antilib.dir/src/gamecontroller/xml/moc_gamecontrollerdpadxml.cpp.o:(.rodata+0xe8): first defined here

/usr/bin/ld: CMakeFiles/antilib.dir/src/gamecontroller/gamecontrollerset.cpp.o:(.rodata+0x148): multiple definition of `typeinfo name for JoyDPadXml'; CMakeFiles/antilib.dir/src/gamecontroller/xml/moc_gamecontrollerdpadxml.cpp.o:(.rodata+0x100): first defined here

/usr/bin/ld: CMakeFiles/antilib.dir/src/gamecontroller/xml/gamecontrollerdpadxml.cpp.o:(.data.rel.ro+0x0): multiple definition of `typeinfo for JoyDPadXml'; CMakeFiles/antilib.dir/src/gamecontroller/xml/moc_gamecontrollerdpadxml.cpp.o:(.data.rel.ro+0x5c): first defined here

/usr/bin/ld: CMakeFiles/antilib.dir/src/gamecontroller/xml/gamecontrollerdpadxml.cpp.o:(.data.rel.ro+0xc): multiple definition of `typeinfo for JoyDPadXml'; CMakeFiles/antilib.dir/src/gamecontroller/xml/moc_gamecontrollerdpadxml.cpp.o:(.data.rel.ro+0x68): first defined here

/usr/bin/ld: CMakeFiles/antilib.dir/src/gamecontroller/xml/gamecontrollerdpadxml.cpp.o:(.rodata+0x6c): multiple definition of `typeinfo name for JoyDPadXml'; CMakeFiles/antilib.dir/src/gamecontroller/xml/moc_gamecontrollerdpadxml.cpp.o:(.rodata+0xe8): first defined here

/usr/bin/ld: CMakeFiles/antilib.dir/src/gamecontroller/xml/gamecontrollerdpadxml.cpp.o:(.rodata+0x84): multiple definition of `typeinfo name for JoyDPadXml'; CMakeFiles/antilib.dir/src/gamecontroller/xml/moc_gamecontrollerdpadxml.cpp.o:(.rodata+0x100): first defined here

/usr/bin/ld: CMakeFiles/antilib.dir/src/xml/setjoystickxml.cpp.o:(.data.rel.ro+0x0): multiple definition of `typeinfo for JoyDPadXml'; CMakeFiles/antilib.dir/src/gamecontroller/xml/moc_gamecontrollerdpadxml.cpp.o:(.data.rel.ro+0x5c): first defined here

/usr/bin/ld: CMakeFiles/antilib.dir/src/xml/setjoystickxml.cpp.o:(.data.rel.ro+0xc): multiple definition of `typeinfo for JoyDPadXml'; CMakeFiles/antilib.dir/src/gamecontroller/xml/moc_gamecontrollerdpadxml.cpp.o:(.data.rel.ro+0x68): first defined here

/usr/bin/ld: CMakeFiles/antilib.dir/src/xml/setjoystickxml.cpp.o:(.rodata+0xa0): multiple definition of `typeinfo name for JoyDPadXml'; CMakeFiles/antilib.dir/src/gamecontroller/xml/moc_gamecontrollerdpadxml.cpp.o:(.rodata+0xe8): first defined here

/usr/bin/ld: CMakeFiles/antilib.dir/src/xml/setjoystickxml.cpp.o:(.rodata+0xb8): multiple definition of `typeinfo name for JoyDPadXml'; CMakeFiles/antilib.dir/src/gamecontroller/xml/moc_gamecontrollerdpadxml.cpp.o:(.rodata+0x100): first defined here

collect2: error: ld returned 1 exit status make[2]: [CMakeFiles/antilib.dir/build.make:4326: libantilib.so] Fehler 1 make[1]: [CMakeFiles/Makefile2:110: CMakeFiles/antilib.dir/all] Fehler 2 ` What am I doing wrong?

juliagoda commented 4 years ago

Do you use any other flags when compiling with CMake? Could you give me a version of the dependencies on this system - version of CMake, Qt and so on?

DaFunkShun commented 4 years ago

I did not use any other flags.

g++ (Raspbian 8.3.0-6+rpi1) 8.3.0 cmake 3.13.4 extra-cmake-modules 5.54.0-1 qttools5-dev 5.11.3-4 qttools5-dev-tools 5.11.3-4 libsdl2-dev 2.0.9+dfsg1-1+rpt1 libxi-dev 2:1.7.9-1 libxtst-dev 2:1.2.3-1 libx11-dev 2:1.6.7-1 itstool 2.0.5-2 gettext 0.19.8.1 libqt5x11extras5-dev 5.11.3-2

This is a fresh install of Raspbian.

juliagoda commented 4 years ago

If it is a freshly installed system, that means that you don't have a native g++. Other users had similar problems, but after installing native version, everything worked. Maybe you should try?

DaFunkShun commented 4 years ago

I updated to gcc-10.1.0 and issued the cmake with following flags:

cmake -D CMAKE_C_COMPILER=gcc-10.1 -D CMAKE_CXX_COMPILER=g++-10.1 ..

No luck so far. Now it complains that it can't find X11, which is installed.

-- The C compiler identification is GNU 10.1.0 -- The CXX compiler identification is GNU 10.1.0 -- Check for working C compiler: /opt/gcc-10.1.0/bin/gcc-10.1 -- Check for working C compiler: /opt/gcc-10.1.0/bin/gcc-10.1 -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /opt/gcc-10.1.0/bin/g++-10.1 -- Check for working CXX compiler: /opt/gcc-10.1.0/bin/g++-10.1 -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Performing Test COMPILER_SUPPORTS_CXX11 -- Performing Test COMPILER_SUPPORTS_CXX11 - Success -- Found PkgConfig: /usr/bin/pkg-config (found version "0.29") -- Checking for module 'sdl2' -- Found sdl2, version 2.0.9 CMake Error at /usr/share/cmake-3.13/Modules/FindX11.cmake:429 (message): Could not find X11 Call Stack (most recent call first): CMakeLists.txt:92 (find_package)

-- Configuring incomplete, errors occurred! See also "/home/pi/Downloads/antimicroX/build/CMakeFiles/CMakeOutput.log".

juliagoda commented 4 years ago

Could you check, where libx11 is installed on Rapsberry? What are the paths? For example libX11.so, Xlib.h

DaFunkShun commented 4 years ago

./usr/lib/arm-linux-gnueabihf/libX11.so ./usr/include/X11/Xlib.h

Hope this helps.

juliagoda commented 4 years ago

The first one is interesting. I'll deal with this on Monday

juliagoda commented 4 years ago

How is it now?

DaFunkShun commented 4 years ago

It finds X11 now and throws the next error. This seems to become a never ending story :(

$ cmake -D CMAKE_C_COMPILER=gcc-10.1 -D CMAKE_CXX_COMPILER=g++-10.1 ..

-- The C compiler identification is GNU 10.1.0 -- The CXX compiler identification is GNU 10.1.0 -- Check for working C compiler: /opt/gcc-10.1.0/bin/gcc-10.1 -- Check for working C compiler: /opt/gcc-10.1.0/bin/gcc-10.1 -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /opt/gcc-10.1.0/bin/g++-10.1 -- Check for working CXX compiler: /opt/gcc-10.1.0/bin/g++-10.1 -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Performing Test COMPILER_SUPPORTS_CXX11 -- Performing Test COMPILER_SUPPORTS_CXX11 - Success -- Found PkgConfig: /usr/bin/pkg-config (found version "0.29") -- Checking for module 'sdl2' -- Found sdl2, version 2.0.9 -- Looking for XOpenDisplay in /usr/lib/arm-linux-gnueabihf/libX11.so;/usr/lib/arm-linux-gnueabihf/libXext.so -- Looking for XOpenDisplay in /usr/lib/arm-linux-gnueabihf/libX11.so;/usr/lib/arm-linux-gnueabihf/libXext.so - found -- Looking for gethostbyname -- Looking for gethostbyname - found -- Looking for connect -- Looking for connect - found -- Looking for remove -- Looking for remove - found -- Looking for shmat -- Looking for shmat - found -- Looking for IceConnectionNumber in ICE -- Looking for IceConnectionNumber in ICE - found -- Found X11: /usr/lib/arm-linux-gnueabihf/libX11.so XTest support allowed for simulating events. uinput support allowed for simulating events. CMake Error at CMakeLists.txt:437 (find_package): By not providing "FindQt5Widgets.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Qt5Widgets", but CMake did not find one.

Could not find a package configuration file provided by "Qt5Widgets" with any of the following names:

Qt5WidgetsConfig.cmake
qt5widgets-config.cmake

Add the installation prefix of "Qt5Widgets" to CMAKE_PREFIX_PATH or set "Qt5Widgets_DIR" to a directory containing one of the above files. If "Qt5Widgets" provides a separate development package or SDK, be sure it has been installed.

-- Configuring incomplete, errors occurred! See also "/home/pi/Downloads/antimicroX/build/CMakeFiles/CMakeOutput.log".

There is no package named "Qt5Widgets" in the raspbian repos that I could install.

juliagoda commented 4 years ago

Do you have a package like "qtbase5-dev" maybe?

DaFunkShun commented 4 years ago

Unfortunately not. These are all the available qt5 packages

qt5-assistant
qt5ct
qt5ct-dbgsym
qt5-default
qt5-doc
qt5-doc-html
qt5dxcb-plugin
qt5-flatpak-platformtheme
qt5-gtk-platformtheme
qt5-image-formats-plugins qt5keychain-dev
qt5qevercloud-dev qt5-qmake qt5-qmake-bin qt5-qmltooling-plugins qt5serialport-examples qt5-style-kvantum qt5-style-kvantum-l10n qt5-style-kvantum-themes qt5-style-plugins qt5-style-plugins-dbgsym

Trying to install native QT5 on this Raspbian now but compilation will take overnight. Reporting back when it's done tomorrow after work.

DaFunkShun commented 4 years ago

Trying to install native QT5 on Raspbian just introduces more problems than it solves and turned out to be a silly idea.

juliagoda commented 4 years ago

I've found some links and I don't have any other ideas. The problem goes far beyond the problems of the programme itself

https://mechatronicsblog.com/cross-compile-and-deploy-qt-5-12-for-raspberry-pi/

https://www.tal.org/tutorials/building-qt-512-raspberry-pi

Zorlin commented 4 years ago

Hi @DaFunkShun

I updated to gcc-10.1.0 and issued the cmake with following flags:

How'd you manage that? I'm trying to get antimicroX working on a Raspberry Pi 3B+ running Raspbian Buster... make failed the same way as you.

sirlucjan commented 4 years ago

If there is no suitable package/library in the Raspbian repository, maybe it would be worthwhile to report the need for one? I don't think that the developer of the program has to deal with the lack of such a package/library.

Of course, you can always compile the package yourself if the "developers" of the operating system fail to do their job.