n0la/rcon

Build Error

codingJWilliams opened this issue · 3 comments

Hi, I'm getting the following error when trying to build your package, is this a known issue and is there a resolution to this?

[root@templates build]# make
Scanning dependencies of target rcon
[  9%] Building C object CMakeFiles/rcon.dir/main.c.o
/root/rcon/main.c: In function ‘debug_dump’:
/root/rcon/main.c:114:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
     for (size_t i = 0; i < sz; i++) {
     ^
/root/rcon/main.c:114:5: note: use option -std=c99 or -std=gnu99 to compile your code

Just ran into this myself. Assuming that you're running on CentOS 7, you can just add the following to line 50 of "CMakeLists.txt" in the project root. The final block should look like this:

Line to Add: set_property(TARGET rcon PROPERTY C_STANDARD 99)

INSTALL(TARGETS rcon RUNTIME DESTINATION bin)
INSTALL(FILES rcon.1 DESTINATION share/man/man1)
set_property(TARGET rcon PROPERTY C_STANDARD 99)

EDIT: Seems that broke authentication with the game I'm doing this for (Avorion). Using the latest release though works without requiring this workaround.

Seems to work for me, thanks for the quick reply!

n0la commented

Hi, and thanks for the report. This has been fixed in the master branch.