MCMrARM / mcpelauncher-linux

Please note this is a legacy repository, please go to: https://github.com/minecraft-linux/mcpelauncher-manifest/wiki
GNU General Public License v3.0
312 stars 46 forks source link

Ubuntu 18.04 cmake error #414

Closed pepa65 closed 6 years ago

pepa65 commented 6 years ago

Installed all the mentioned packages for Ubuntu. Cloned the repo, and then:

cd mcpelauncher-linux
./setup_cef.sh
./download_icon.sh 
./setup_bin_libs.sh
mkdir build/ && cd build/
cmake ..

Output:

CMake Error at CMakeLists.txt:106 (add_subdirectory):
  add_subdirectory given source "gplay_api" which is not an existing
  directory.

CMake Error at CMakeLists.txt:107 (set_target_properties):
  set_target_properties Can not find target to add properties to: gplaydl

-- Configuring incomplete, errors occurred!
See also "/home/pp/git/mcpelauncher-linux/build/CMakeFiles/CMakeOutput.log".
See also "/home/pp/git/mcpelauncher-linux/build/CMakeFiles/CMakeError.log".

CMakeError.log:

Determining if the pthread_create exist failed with the following output:
Change Dir: /home/pp/git/mcpelauncher-linux/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_586f0/fast"
/usr/bin/make -f CMakeFiles/cmTC_586f0.dir/build.make CMakeFiles/cmTC_586f0.dir/build
make[1]: Entering directory '/home/pp/git/mcpelauncher-linux/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_586f0.dir/CheckSymbolExists.c.o
/usr/bin/cc   -m32    -o CMakeFiles/cmTC_586f0.dir/CheckSymbolExists.c.o   -c /home/pp/git/mcpelauncher-linux/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
Linking C executable cmTC_586f0
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_586f0.dir/link.txt --verbose=1
/usr/bin/cc  -m32     -rdynamic CMakeFiles/cmTC_586f0.dir/CheckSymbolExists.c.o  -o cmTC_586f0 
CMakeFiles/cmTC_586f0.dir/CheckSymbolExists.c.o: In function `main':
CheckSymbolExists.c:(.text+0x15): undefined reference to `pthread_create'
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_586f0.dir/build.make:97: recipe for target 'cmTC_586f0' failed
make[1]: *** [cmTC_586f0] Error 1
make[1]: Leaving directory '/home/pp/git/mcpelauncher-linux/build/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_586f0/fast' failed
make: *** [cmTC_586f0/fast] Error 2

File /home/pp/git/mcpelauncher-linux/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <pthread.h>

int main(int argc, char** argv)
{
  (void)argv;
#ifndef pthread_create
  return ((int*)(&pthread_create))[argc];
#else
  (void)argc;
  return 0;
#endif
}

Determining if the function pthread_create exists in the pthreads failed with th
e following output:
Change Dir: /home/pp/git/mcpelauncher-linux/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_fe780/fast"
/usr/bin/make -f CMakeFiles/cmTC_fe780.dir/build.make CMakeFiles/cmTC_fe780.dir/build
make[1]: Entering directory '/home/pp/git/mcpelauncher-linux/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_fe780.dir/CheckFunctionExists.c.o
/usr/bin/cc   -m32 -DCHECK_FUNCTION_EXISTS=pthread_create   -o CMakeFiles/cmTC_fe780.dir/CheckFunctionExists.c.o   -c /usr/share/cmake-3.10/Modules/CheckFunctionExists.c
Linking C executable cmTC_fe780
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_fe780.dir/link.txt --verbose=1
/usr/bin/cc  -m32 -DCHECK_FUNCTION_EXISTS=pthread_create    -rdynamic CMakeFiles/cmTC_fe780.dir/CheckFunctionExists.c.o  -o cmTC_fe780 -lpthreads 
/usr/bin/x86_64-linux-gnu-ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_fe780.dir/build.make:97: recipe for target 'cmTC_fe780' failed
make[1]: *** [cmTC_fe780] Error 1
make[1]: Leaving directory '/home/pp/git/mcpelauncher-linux/build/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_fe780/fast' failed
make: *** [cmTC_fe780/fast] Error 2
denny-z commented 6 years ago

I had the same issue. I found, that the reason is that gplay_api directory is empty. Try to clone the repo using next command: git clone --recurse-submodules <put here repo url>

lukeeey commented 6 years ago

You should've cloned with the --recursive option. Not to worry though, just cd into the repo directory and run git submodule update --init --recursive

pepa65 commented 6 years ago

After the long CEF download, that's what I did: git submodule update --init. (In this case recursive is not necessary? At least, nothing more seemed to happen when I tried it later with --recurse...)

pepa65 commented 6 years ago

And it works! Must have overlooked the proper cloning in the instructions... Thanks!

pepa65 commented 6 years ago

So to summarize, for a full install on Ubuntu:

mkdir -p "$HOME/git"
cd "$HOME/git"
git clone --recurse-submodules https://github.com/MCMrARM/mcpelauncher-linux
cd mcpelauncher-linux
sudo dpkg --add-architecture i386
sudo apt install cmake gcc-multilib g++-multilib zlib1g-dev:i386 libx11-dev:i386 libzip-dev:i386 libpng-dev:i386 libcurl4-openssl-dev:i386 libssl-dev:i386 libgles2-mesa-dev:i386 libudev-dev:i386 libevdev-dev:i386
sudo apt install libgtk2.0-0:i386 libgtkglext1:i386 libasound2:i386 libnss3:i386 libxss1:i386 libgconf2-4:i386 libxtst6:i386 libudev1:i386
sudo apt install protobuf-compiler libprotobuf-dev:i386
sudo apt install libgles2-mesa-dev:i386 and libegl1-mesa-dev:i386
./setup_cef.sh
./download_icon.sh
./setup_bin_libs.sh
mkdir build
cd build
cmake ..
make -j$(nproc)
sudo make install
./mcpelauncher
lukeeey commented 6 years ago

Sorry im used to adding --recursive but it does no harm adding it