Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Meson Build Failed #49

Open
ALEEF02 opened this issue Jul 20, 2018 · 3 comments
Open

Meson Build Failed #49

ALEEF02 opened this issue Jul 20, 2018 · 3 comments

Comments

@ALEEF02
Copy link

ALEEF02 commented Jul 20, 2018

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?

@mnh48
Copy link

mnh48 commented Jul 21, 2018

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.

@Pizzabelly
Copy link
Owner

@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.

@seasew
Copy link

seasew commented Apr 6, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants