Unity3d master server on FreeBSD ???

The Master Server by unity3d can be compiled and run on the linux or windows…

Can this master server be compiled and run on the FreeBSD?

???

Try it and see?

I’ve already tried to compile it, but displays lots of error,~~, whereas on the linux(ubuntu) platform was compiled successfully, …Are there some pre-requisite libraries ? or isn’t it intended to be compiled on the freebsd platform???

If you have specific errors you could post them.

On some platforms you need to modify the Makefile. Search for $(CFLAGS) and move it to the end of the line.

I extracted the master server file on the fresbsd 10.1-RELEASE version
I changed in Makefile
from
CC= g++
to
CC=gcc48

Like I said, last time I did this I needed to edit the makefile, find the line that links the program, and move “CFLAGS” to the end. But that was several years ago. It is a shame if the source distribution doesn’t already include this fix.

After I extracted the master file, I edited 3 lines in Makefile according the tip…
From : CC=g++ TO: CC=gcc48
From : CFLAGs= -Wall -lpthread … , TO: …-pthread …
From : (CC) -c -Wall ... TO: (CC) -c -Wall -fpermissive

I replaced the ‘g++’ to ‘gcc’ , because I couldn’t find the ‘g++’ ports at the freebsd ports directory(/usr/ports/lang)…
Is this replacement may be the cause of the error???

Because that I have little knowledge of the compiler and compiling process, I don’t know the meaning of the changed line exactly.
Regardless of the meaning of the edited line, it produces the compiling error…

Is the gcc compiler

I downloade the MasterServer from the Unity3d.com in a few days ago,
and the version of the Master Server and Faciliator Server is the same 2.0.1f1 …

And my server platform is FreeBSD 10.1-Release.

Yes, you need to use g++ not gcc, as it is a C++ app. Maybe try g++48 if that is what it is called, or ask on a FreeBSD forum how to run g++ on that platform.

Also make sure you did what I said - on line 91 of the Makefile, move the bit that says “$(CFLAGS)” to the very end of the line. Otherwise you may get more errors about missing pthreads symbols.

Hummm~~~… I realized the freebsd has the built-in c++ compiler , I channged the compiler to ‘c++’ and moved whole line(line 91 which has …$(CFLAGS) ) to the bottom of the Makefile

and compiled again.

But, there are several errors

'/RakNET/Sources/DS_BinarySearchTree.h:276:7: error: use of undeclared identifier ‘FindParent’ …blah blash… and
11 errors generated and stopped…

For FreeBSD just need a couple of patch
It was for server version: 2.0.1f1

First the Makefile (maybe it could work just by replacing CC=c++)
I prefer to use clang instead of gcc on FreeBSD

diff Makefile.orig Makefile
4c4
< CC=g++

CC=c++
6c6,7
< CFLAGS=-Wall -lpthread $(DEFINES)


CFLAGS=-Wall -lpthread $(DEFINES) -I/usr/local/include
LDFLAGS= -L/usr/local/lib

then MasterServer.cpp

diff MasterServer.cpp.orig MasterServer.cpp
22a23

#include <time.h>

And finnaly: RakNet/Sources/DS_BinarySearchTree.h

diff RakNet/Sources/DS_BinarySearchTree.h.orig RakNet/Sources/DS_BinarySearchTree.h
169c169
< left_height = Height( current->left );

left_height = this->Height( current->left );
174c174
< right_height = Height( current->right );


right_height = this->Height( current->right );
202c202
< current = FindParent( *( current->item ) );


current = this->FindParent( *( current->item ) );
229c229
< return Height( A->right ) > Height( A->left );


return this->Height( A->right ) > this->Height( A->left );
238c238
< return Height( A->left ) > Height( A->right );


return this->Height( A->left ) > this->Height( A->right );
275,276c275,276
< B = FindParent( *( C->item ) );
< A = FindParent( *( B->item ) );


B = this->FindParent( *( C->item ) );
A = this->FindParent( *( B->item ) );
339,340c339,340
< B = FindParent( *( C->item ) );
< A = FindParent( *( B->item ) );


B = this->FindParent( *( C->item ) );
A = this->FindParent( *( B->item ) );