Meson Build Failed
ALEEF02 opened this issue · 3 comments
When I try to build your project using Meson, I get this error:
Build started at 2018-07-20T13:03:21.759307
Main binary: C:\Program Files\Meson\meson.exe
Python system: Windows
The Meson build system
Version: 0.47.1
Source dir: C:\Users\fordf\Downloads\EasyRP
Build dir: C:\Users\fordf\Downloads\EasyRP\builddir
Build type: native build
Project name: EasyRP
Project version: 3.0
meson.build:1:0: ERROR: Unknown compiler(s): ['cl', 'c++', 'g++', 'clang++']
The follow exceptions were encountered:
Running "cl /?" gave "[WinError 2] The system cannot find the file specified"
Running "c++ --version" gave "[WinError 2] The system cannot find the file specified"
Running "g++ --version" gave "[WinError 2] The system cannot find the file specified"
Running "clang++ --version" gave "[WinError 2] The system cannot find the file specified"
How can I fix this?
From your error, it looks like meson did not detect your c++ or gcc compiler.
You need to at least install c++ or gcc compiler to build anything, not only to build using meson. The compilers are available under cygwin package manager for Windows (among others, there's many ways to install them). And make sure the compiler's path is added to system variable PATH
so that other programs like meson could use the compilers.
Though I also seems to stuck at building the project, in my case it is problem with ninja (yes, you also need to install ninja, not just meson).
On my side, meson seems to not have problem:
The Meson build system
Version: 0.47.1
Source dir: W:\works\EasyRP
Build dir: W:\works\EasyRP\buildir
Build type: native build
Project name: EasyRP
Project version: 3.0
Native C++ compiler: c++ (gcc 7.3.0 "c++ (GCC) 7.3.0")
Build machine cpu family: x86_64
Build machine cpu: x86_64
Library discord-rpc found: YES
Build targets in project: 2
Found ninja-1.8.2 at 'C:\ninja\ninja.EXE'
However when running ninja, it failed as:
[5/5] Linking target easyrp.exe.
FAILED: easyrp.exe
c++ @easyrp.exe.rsp
easyrp@exe/discord.cpp.obj: In function `refreshDiscord()':
/cygdrive/w/works/EasyRP/buildir/../discord.cpp:88: undefined reference to `Disc
ord_UpdateConnection'
/cygdrive/w/works/EasyRP/buildir/../discord.cpp:88:(.text+0x3ed): relocation tru
ncated to fit: R_X86_64_PC32 against undefined symbol `Discord_UpdateConnection'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
I'm guessing the library file discord-rpc.lib
the author originally used is different from the library file that I use, but I'm sot sure which library file the author originally used since there's many releases, and even in each of the releases there's four different types of library.
@MuhdNurHidayat is correct you need a c++ compiler ;). For the link error I have updated the readme with build instructions. The important thing to fix the Discord_UpdateConnection part is to pass -DENABLE_IO_THREAD=OFF to cmake when building discord-rpc.
I'm still getting the link issue even when I build discord-rpc with DENABLE_IO_THREAD. Any idea what could be happening?
Edit: actually, I realized I need the c++ compiler. Not a link error yet.