n0la / rcon

Source RCON client for command line
BSD 2-Clause "Simplified" License
140 stars 18 forks source link

Make Errors #3

Closed tielur closed 7 years ago

tielur commented 7 years ago

I'm getting the following errors when trying to run make:

∴ cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DINSTALL_BASH_COMPLETION=OFF
-- The C compiler identification is AppleClang 8.0.0.8000042
-- The CXX compiler identification is AppleClang 8.0.0.8000042
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- 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: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PkgConfig: /usr/local/bin/pkg-config (found version "0.29.1") 
-- Checking for module 'glib-2.0'
--   Found glib-2.0, version 2.50.1
-- Looking for arc4random_uniform
-- Looking for arc4random_uniform - found
-- Looking for pledge
-- Looking for pledge - not found
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/tielur/sites/rcon/build
∴ make
Scanning dependencies of target rcon
[ 25%] Building C object CMakeFiles/rcon.dir/main.c.o
/Users/tielur/sites/rcon/main.c:219:11: error: implicit declaration of function
      'open_memstream' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    cmd = open_memstream(&c, &size);
          ^
/Users/tielur/sites/rcon/main.c:219:9: error: incompatible integer to pointer conversion
      assigning to 'FILE *' (aka 'struct __sFILE *') from 'int' [-Werror,-Wint-conversion]
    cmd = open_memstream(&c, &size);
        ^ ~~~~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.
make[2]: *** [CMakeFiles/rcon.dir/main.c.o] Error 1
make[1]: *** [CMakeFiles/rcon.dir/all] Error 2
make: *** [all] Error 2

Info:

∴ make -v
GNU Make 3.81
tielur commented 7 years ago

I guess OSX doesn't include: open_memstream(char **bufp, size_t *sizep) or fmemopen(void *buf, size_t size, const char *mode)

So I guess this would have to be ported for it to work.

n0la commented 7 years ago

Yes, it seems that OS X is not fully POSIX and does not have open_memstream. I will look into this.

n0la commented 7 years ago

With recent master you can now build and test under OS X. Travis OS X build image at least has no issues doing that. Would you mind testing it again to see if and how well it works for you under OS X?

tielur commented 7 years ago

I just tested it and it builds now, which is awesome! The only error I got was during installation:

∴ sudo make install
Password:
[ 54%] Built target rcon
[100%] Built target srcrcontest
Install the project...
-- Install configuration: ""
-- Installing: /usr/bin/rcon
CMake Error at cmake_install.cmake:31 (file):
  file INSTALL cannot copy file "/Users/tielur/sites/rcon/build/rcon" to
  "/usr/bin/rcon".
tielur commented 7 years ago

This may or may not be related, and I can open a different issue if you want. But after trying to use the command with status. I see the connection on the server and the server outputs the results but the results never show via rcon.

n0la commented 7 years ago

I just tested it and it builds now, which is awesome! The only error I got was during installation:

If you don't have /usr/bin you can set path to your installation like this:

cmake .. -DCMAKE_INSTALL_PREFIX=/path/to/somewhere

It will then install the binary to /path/to/somewhere/bin.

This may or may not be related, and I can open a different issue if you want. But after trying to use the command with status. I see the connection on the server and the server outputs the results but the results never show via rcon.

Against what kind of game server are you using it?

tielur commented 7 years ago

I'm running it against a Rust game server

n0la commented 7 years ago

I'm running I against a Rust game server

I haven't not been able to test it yet against a Rust server. I will do some tests and see if can be fixed.

tielur commented 7 years ago

Awesome! Thanks for all your work @n0la!

n0la commented 7 years ago

I have made a new issue for RUST compatibility: #4