Page 1 of 1

Compile errors on Debian 10.8.0

Posted: Wed Mar 10, 2021 4:32 pm
by kcmc
Hi there

I just tried to get UOX3 running on a freshly installed Debian 10.8.0 x64 but unfortunately I'm getting some errors instead of a binary.

As for the Debian, I downloaded the Netinstall Image and installed only the minimal system requirements.
Then I pretty much followed the "How to compile UOX3......under Linux" from https://github.com/UOX3DevTeam/UOX3.

When I execute the automake.sh I get the following errors:

Code: Select all

UOXJSMethods.cpp: In function ‘JSBool CFile_Open(JSContext*, JSObject*, uintN, jsval*, jsval*)’:
UOXJSMethods.cpp:5348:21: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
  char *folderName = "\0";
                     ^~~~

g++  -MT build/UOPInterface.o -MMD -MP -MF ./.deps/UOPInterface.d -std=c++17 -O2 -pthread -I../spidermonkey -I. -c UOPInterface.cpp -o build/UOPInterface.o
UOPInterface.cpp: In function ‘std::__cxx11::string UOP::fixedWidth(uint32_t, int)’:
UOPInterface.cpp:229:14: error: ‘setfill’ is not a member of ‘std’
     os<<std::setfill('0')<<std::setw(digitsCount)<<value;
              ^~~~~~~
UOPInterface.cpp:229:14: note: suggested alternative: ‘fill’
     os<<std::setfill('0')<<std::setw(digitsCount)<<value;
              ^~~~~~~
              fill
UOPInterface.cpp:229:33: error: ‘setw’ is not a member of ‘std’
     os<<std::setfill('0')<<std::setw(digitsCount)<<value;
                                 ^~~~
UOPInterface.cpp:229:33: note: suggested alternative: ‘beta’
     os<<std::setfill('0')<<std::setw(digitsCount)<<value;
                                 ^~~~
                                 beta
make: *** [Makefile:24: build/UOPInterface.o] Fehler 1
I'd appreciate if someone could point me into the right direction.

Thanks in advance!

Re: Compile errors on Debian 10.8.0

Posted: Wed Mar 10, 2021 5:01 pm
by Xuri
Hi kcmc! This issue should be fixed in the develop branch at https://github.com/UOX3DevTeam/UOX3, please give that a try and see if you encounter the same issue. That branch also has some other fixes that are not in the master branch yet, as outlined in this thread.

For visibility, this was the fix for the issue you mentioned:
Step 1) Add #include <iomanip> at the top of UOPInterface.cpp
Step 2) Modify line 34 in Makefile to look like this: $(CXX) $(CXXFLAGS) -o $(TARGET) $^ $(LDFLAGS) -lstdc++fs

If you need anything else, feel free to ask - either here or in the Discord server!

Re: Compile errors on Debian 10.8.0

Posted: Wed Mar 10, 2021 6:12 pm
by kcmc
Hi Xuri

The develop branch did the trick!
Time to dig back into the good old UO times :wink:

Thanks a lot!