Firstly, what follows is all unofficial. This ChatScript bot officially works excellent. For the sake of discussion only (not to compete with the official support by Bruce), here are a few unofficial tricks that may prove useful for someone to read about, when they may first try compiling ChatScript in LINUX.
The Windows and Linux file formats, I found, were a bit different, when it comes to line breaks, so I got these errors while trying to run LinuxCompile.sh
EXAMPLE 1: Line break errors [SOLVED]
~/CS4/LINUX$ ./LinuxCompile.sh
./LinuxCompile.sh: line 2: $’\r’: command not found
./LinuxCompile.sh: line 3: !//: No such file or directory
./LinuxCompile.sh: line 4: $’\r’: command not found
./LinuxCompile.sh: line 5: $’\r’: command not found
./LinuxCompile.sh: line 6: $’\r’: command not found
Let’s resolve all of them at once by just making a new bash shell script in Linux, then saving it to, and running it from, the main ChatScript directory (like Bruce said alternatively above).
EXAMPLE 2: mycompile.sh
#!/bin/bash
g++ -w -funsigned-char src/*.cpp -O2 -DDISCARDDATABASE=1 -o chatscript.go -lpthread -lrt 2>>errors.txt
So if saving this to file: mycompile.sh
Then making it executable with: chmod +x mycompile.sh
It may be run from the main Chatscript directory with: ./mycompile.sh
Hey checkout the -w switch ... That suppresses all those warnings from scrolling all over the place. But, they are still saved to the file: errors.txt if you need them. Otherwise, it is real easy to erase -w, whenever echoing loads warnings in console is preferred. Opinion: All those gazillion warnings are not ChatScript, rather they may relate to portability issues with the compiler design, and seen in lots of existing C++ code being compiled.
This is completely optional, but to explain EXAMPLE 2… I personally prefer using the .go file extension in Linux which is similiar to .exe (execute) in Windows, but .go starts with the letter g which is cool since it was compiled with g++ which also starts with the letter g.