uTox / uTox

µTox the lightest and fluffiest Tox client
Other
1.01k stars 190 forks source link

Compilation issues/doubts #1520

Open siburec opened 3 years ago

siburec commented 3 years ago

Overview

  1. uTox version: develop (commit 4789)
  2. Operating system: Windows 10-x64 & Debian 9.8 x64
  3. Desktop Environment/Window Manager (Linux/BSD only):

Issue

When I follow the Windows installation guide, I get the next error message.

$ cmake -DCMAKE_TOOLCHAIN_FILE="../cmake/toolchain-win64.cmake" -DSTATIC_TOXCORE=ON -DCMAKE_BUILD_TYPE=Release .. -- The C compiler identification is GNU 9.2.0 -- Check for working C compiler: /cygdrive/c/TDM-GCC-64/bin/x86_64-w64-mingw32-gcc.exe -- Check for working C compiler: /cygdrive/c/TDM-GCC-64/bin/x86_64-w64-mingw32-gcc.exe - broken CMake Error at /usr/share/cmake-3.17.3/Modules/CMakeTestCCompiler.cmake:60 (message): The C compiler

"/cygdrive/c/TDM-GCC-64/bin/x86_64-w64-mingw32-gcc.exe"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: /cygdrive/c/projects/uTox/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make.exe cmTC_34389/fast && /usr/bin/make  -f CMakeFiles/cmTC_34389.dir/build.make CMakeFiles/cmTC_34389.dir/build
make[1]: Entering directory '/cygdrive/c/projects/uTox/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_34389.dir/testCCompiler.c.obj
/cygdrive/c/TDM-GCC-64/bin/x86_64-w64-mingw32-gcc.exe  @CMakeFiles/cmTC_34389.dir/includes_C.rsp -DAL_LIBTYPE_STATIC -D_FILE_OFFSET_BITS=64    -o CMakeFiles/cmTC_34389.dir/testCCompiler.c.obj   -c /cygdrive/c/projects/uTox/build/CMakeFiles/CMakeTmp/testCCompiler.c
x86_64-w64-mingw32-gcc.exe: error: /cygdrive/c/projects/uTox/build/CMakeFiles/CMakeTmp/testCCompiler.c: No such file or directory
x86_64-w64-mingw32-gcc.exe: fatal error: no input files
compilation terminated.
make[1]: *** [CMakeFiles/cmTC_34389.dir/build.make:87: CMakeFiles/cmTC_34389.dir/testCCompiler.c.obj] Error 1
make[1]: Leaving directory '/cygdrive/c/projects/uTox/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:141: cmTC_34389/fast] Error 2

CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:2 (project)

-- Configuring incomplete, errors occurred! See also "/cygdrive/c/projects/uTox/build/CMakeFiles/CMakeOutput.log". See also "/cygdrive/c/projects/uTox/build/CMakeFiles/CMakeError.log".

siburec commented 3 years ago

I am not sure if I am following the correct steps. I create the windows-x64 folder inside libs and build at the same level as libs. Afterwards, inside libs I copy and unzip all zip files and then go to build and run cmake

siburec commented 3 years ago

I would also want to note that to build the project in Ubuntu 20.04 I had also followed the recomended steps in BUILD.md for Ubuntu 18.04 and I only had to install libsodium to get it working, so maybe it can be added to the guide.

I have seen that the libsodium dependence was removed because it is only necessary if statically linking, but I think that it could be mentioned that it will have to be installed if the guide is followed.

ghost commented 3 years ago

Oh, I think the guide requires libsodium because it compiles toxcore, which depends on libsodium. I was assuming that toxcore is already in distro's repos. (uTox used to depend on libsodium, but not anymore.)

It seems that in Ubuntu 18.04 toxcore indeed isn't in the repo, but in 20.04 it is in the repo as libtoxcore2 and libtoxcore-dev: https://packages.ubuntu.com/search?keywords=toxcore&searchon=names&suite=all&section=all So you should be able to just install the -dev package in Ubuntu 20.04, instead of compiling it.

ghost commented 3 years ago

Uhh… I mean install the libtoxcore2 package instead of compiling. When you install libtoxcore2, it should already pull in libsodium as a dependency.

siburec commented 3 years ago

Thanks @avoidr , good to know that it can be downloaded from the repo. Maybe it can be explained in the guide to help future developers.

ghost commented 3 years ago

Thanks @avoidr , good to know that it can be downloaded from the repo. Maybe it can be explained in the guide to help future developers.

Yeah, of course, the installation guides will be reviewed and updated soon enough!