otland / forgottenserver

A free and open-source MMORPG server emulator written in C++
https://otland.net
GNU General Public License v2.0
1.61k stars 1.07k forks source link

luascript.cpp.o Warning: end of file in string Ubuntu 14.04x64 - SOLVED #1408

Closed cmarfil closed 9 years ago

cmarfil commented 9 years ago

Hello,

I frollowed the instructions for ubuntu and i get this error:

root@otserver2:/home/otserv/forgottenserver-1.1/build# make
[  1%] Generating CXX prefix source cotire/tfs_CXX_prefix.cxx
[  2%] Generating CXX prefix header cotire/tfs_CXX_prefix.hxx
[  3%] Building CXX precompiled header cotire/tfs_CXX_prefix.hxx.gch
Scanning dependencies of target tfs
[  5%] Building CXX object CMakeFiles/tfs.dir/src/otpch.cpp.o
[  6%] Building CXX object CMakeFiles/tfs.dir/src/actions.cpp.o
[  7%] Building CXX object CMakeFiles/tfs.dir/src/ban.cpp.o
[  8%] Building CXX object CMakeFiles/tfs.dir/src/baseevents.cpp.o
[ 10%] Building CXX object CMakeFiles/tfs.dir/src/bed.cpp.o
[ 11%] Building CXX object CMakeFiles/tfs.dir/src/chat.cpp.o
[ 12%] Building CXX object CMakeFiles/tfs.dir/src/combat.cpp.o
[ 14%] Building CXX object CMakeFiles/tfs.dir/src/commands.cpp.o
[ 15%] Building CXX object CMakeFiles/tfs.dir/src/condition.cpp.o
[ 16%] Building CXX object CMakeFiles/tfs.dir/src/configmanager.cpp.o
[ 17%] Building CXX object CMakeFiles/tfs.dir/src/connection.cpp.o
[ 19%] Building CXX object CMakeFiles/tfs.dir/src/container.cpp.o
[ 20%] Building CXX object CMakeFiles/tfs.dir/src/creature.cpp.o
[ 21%] Building CXX object CMakeFiles/tfs.dir/src/creatureevent.cpp.o
[ 23%] Building CXX object CMakeFiles/tfs.dir/src/cylinder.cpp.o
[ 24%] Building CXX object CMakeFiles/tfs.dir/src/database.cpp.o
[ 25%] Building CXX object CMakeFiles/tfs.dir/src/databasemanager.cpp.o
[ 26%] Building CXX object CMakeFiles/tfs.dir/src/databasetasks.cpp.o
[ 28%] Building CXX object CMakeFiles/tfs.dir/src/depotchest.cpp.o
[ 29%] Building CXX object CMakeFiles/tfs.dir/src/depotlocker.cpp.o
[ 30%] Building CXX object CMakeFiles/tfs.dir/src/events.cpp.o
[ 32%] Building CXX object CMakeFiles/tfs.dir/src/fileloader.cpp.o
[ 33%] Building CXX object CMakeFiles/tfs.dir/src/game.cpp.o
[ 34%] Building CXX object CMakeFiles/tfs.dir/src/globalevent.cpp.o
[ 35%] Building CXX object CMakeFiles/tfs.dir/src/guild.cpp.o
[ 37%] Building CXX object CMakeFiles/tfs.dir/src/groups.cpp.o
[ 38%] Building CXX object CMakeFiles/tfs.dir/src/house.cpp.o
[ 39%] Building CXX object CMakeFiles/tfs.dir/src/housetile.cpp.o
[ 41%] Building CXX object CMakeFiles/tfs.dir/src/inbox.cpp.o
[ 42%] Building CXX object CMakeFiles/tfs.dir/src/ioguild.cpp.o
[ 43%] Building CXX object CMakeFiles/tfs.dir/src/iologindata.cpp.o
[ 44%] Building CXX object CMakeFiles/tfs.dir/src/iomap.cpp.o
[ 46%] Building CXX object CMakeFiles/tfs.dir/src/iomapserialize.cpp.o
[ 47%] Building CXX object CMakeFiles/tfs.dir/src/iomarket.cpp.o
[ 48%] Building CXX object CMakeFiles/tfs.dir/src/item.cpp.o
[ 50%] Building CXX object CMakeFiles/tfs.dir/src/items.cpp.o
[ 51%] Building CXX object CMakeFiles/tfs.dir/src/luascript.cpp.o
{standard input}: Assembler messages:
{standard input}:20769: Warning: end of file in string; '"' inserted
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.8/README.Bugs> for instructions.
make[2]: *** [CMakeFiles/tfs.dir/src/luascript.cpp.o] Error 4
make[1]: *** [CMakeFiles/tfs.dir/all] Error 2
make: *** [all] Error 2

Machine: Ubuntu 14.04x64 fresh installation from DigitalOcean.

¿Any idea?

Thanks.

WibbenZ commented 9 years ago

Are you using the newest TFS? The error is saying that you are msising EOF, = add a new line at the end of luascript.cpp. Just checked the last commit there(mine) and there is a new line.

cmarfil commented 9 years ago

I think yes, I followed https://github.com/otland/forgottenserver/wiki/Compiling-on-Ubuntu

The same process on my mac with: https://github.com/otland/forgottenserver/wiki/Compiling-on-Mac-OS-X has ended successfully.

But on ubuntu server from DigitalOcean always return error like:

[ 33%] Building CXX object CMakeFiles/tfs.dir/src/game.cpp.o
{standard input}: Assembler messages:
{standard input}:11417: Warning: end of file not at end of a line; newline inserted
{standard input}: Error: open CFI at the end of file; missing .cfi_endproc directive

I'm a web developer but I'm not familiar with this environment, maybe i'm failing at something simple but in my mac has worked at first.

Thanks 4 reply @WibbenZ

WibbenZ commented 9 years ago

Im not that experiences in C++ aswell, but trying to learn more Can you upload your luascript.cpp to paste-ots.me or some other paste site?

Edit: Aswell as luascript.h

diath commented 9 years ago

How much RAM do you have? Are you using swap? Both files are quite heavy to crunch, maybe that's why GCC chokes and crashes.

cmarfil commented 9 years ago

Can you upload your luascript.cpp to paste-ots.me or some other paste site?

I can't download now from server but is last version of TFS

How much RAM do you have?

512MB, I can test droplet with more ram if is need.

Thanks.

WibbenZ commented 9 years ago

Id say 512 is abit to low tbh, so try to increase it to 1-2gb and you will be fine even for starting and hosting it.

djarek commented 9 years ago

512 MiB of RAM is definitely too low to compile a Release build (even a x86 one) without swap (though adding swap is just going to be a waste of time). If you want to run the server on that 512 MiB droplet, you'll need to compile the server on an another machine and send the compiled executable there (you'll also need to make sure that libraries are at the same versions to avoid problems, preferably compile on a local Linux installation, or if you don't have one, use a virtual machine). You should also consider running an x86 install of Ubuntu - the OS is going to use less memory.

ranisalt commented 9 years ago

I have compiled successfully the release build several times on 512M machines without swap. Hardly ever there is a possibility of problems with cotire depending on the distro (Ubuntu is a lot more memory hungry than Arch, for example).

If possible, consider moving to a more lightweight distro for running on such a low memory space, I suggest the previously mentioned Arch Linux and CoreOS, but I can confirm it also works on Amazon Linux and Fedora. Just avoid Ubuntu.

You can also edit the CMakeLists to comment out the cotire stuff (line 10) and remove the -pipe CXX flag (end of line 13) if you run into problems with those distros or you still want to use Ubuntu.

@djarek mentioned compiling the release build on another machine and copying to your server; DON'T do that as release build is configured with native optimizations and, if your computer and the server run different processors (and probably do, as I don't see many home computers running on Xeons and Opterons), it might run slower or even don't run at all. Learn about the -march flag if you really want to try that.

Another possibility: you can try using Ninja as a build system instead of make. To do that, install Ninja (its package is called ninja-build), run CMake with the flag -GNinja, then run ninja instead of make. It is lighter and tends to be faster.

cmarfil commented 9 years ago

Guys, thanks 4 replies! I tested with a 2GB server instead of 512 and it worked perfect!!

Thanks!