Page 1 of 1

Compile error: Rev 766

Posted: Tue Nov 04, 2014 5:28 pm
by Blackstorm
Actually i have an error on the rev766

Code: Select all

root@sd-56056:/vgoemu/src/world# make
g++ -c `mysql_config --cflags` -march=native -pipe -O -pthread -std=c++0x -Wall -g -DVG_WORLD -DVG_DEBUG -D_GNU_SOURCE WorldDatabase.cpp -o WorldDatabase.o
WorldDatabase.cpp:424:2: warning: multi-line comment [-Wcomment]
  // Load the character's titles\
  ^
WorldDatabase.cpp: In member function 'uint32_t WorldDatabase::LoadSpawnPlacements(uint32_t)':
WorldDatabase.cpp:1221:63: error: invalid initialization of non-const reference of type 'std::__detail::_Node_iterator<std::pair<const unsigned int, SpawnPlacement>, false, false>&' from an rvalue of type 'std::unordered_map<unsigned int, SpawnPlacement>::iterator {aka std::__detail::_Node_iterator<
std::pair<const unsigned int, SpawnPlacement>, false, false>}'
     for (auto &itr = master_spawn_list.spawn_placements.begin(); itr != master_spawn_list.spawn_placements.end();) {
                                                               ^
Makefile:136: recipe for target 'WorldDatabase.o' failed
make: *** [WorldDatabase.o] Error 1
working on ^^

Re: Compile error: Rev 766

Posted: Tue Nov 04, 2014 5:31 pm
by shargash
I did not recompile, but I get an error during WorldServer startup:

19:26:09.714 E LUA Error reading lua script file at samples/generic.lua!
19:26:09.714 E LUA Error reading lua script file at samples/TanFenGreatcloud.lua!

The lua files are there. I know squat about lua, so I have no idea how to go about figuring out what's missing.

Re: Compile error: Rev 766

Posted: Tue Nov 04, 2014 5:37 pm
by Lokked
Blackstorm, make it a for (const auto &itr : ....).

I'll try and remember to put this in a commit tonight. I'm surprised this hasn't come up before, though, as I don't recall changing that.

Re: Compile error: Rev 766

Posted: Tue Nov 04, 2014 5:40 pm
by Blackstorm
ok for the first error :

In WorldDatabase.cpp : line 1221

Code: Select all

for (auto &itr = master_spawn_list.spawn_placements.begin(); itr != master_spawn_list.spawn_placements.end();) {
change it by :

Code: Select all

for (auto itr = master_spawn_list.spawn_placements.begin(); itr != master_spawn_list.spawn_placements.end();) {

after that you have another error for the MasterSpawnList.cpp line 267 : do the same thing, remove the "&" before "itr"

edit : arf, thanks Looked should be better to add the "const" declaration ^^

Re: Compile error: Rev 766

Posted: Tue Nov 04, 2014 5:42 pm
by shargash
[quote="shargash"]I did not recompile, but I get an error during WorldServer startup:[/quote]

Never mind. I figured it out. I have been copying world server to a run-time directory, and I didn't realize I had to copy the samples subdirectory as well as WorldServer.exe. It started fine after I did the copy.

Re: Compile error: Rev 766

Posted: Tue Nov 04, 2014 5:50 pm
by Blackstorm
In addition, the Linux binary require always the generic.lua in the same directory... (in 744 too)

Code: Select all

root@sd-56056:/vgoemu/src/world# service vgoemu_init restart
Error, The file generic.lua is not in the daemon directory, exit

Re: Compile error: Rev 766

Posted: Tue Nov 04, 2014 6:43 pm
by John Adams
[quote="Lokked"]Blackstorm, make it a for (const auto &itr : ....).

I'll try and remember to put this in a commit tonight. I'm surprised this hasn't come up before, though, as I don't recall changing that.[/quote]
We need to not use auto &itr, as the & breaks linux compile. I keep removing them after every commit. That was how I was told to fix it. There's probably some other reason the & doesn't work, so we need to figure out one or the other so we're on the same page.

Rev 766 compiles and runs perfectly for me on both Windows 7 x64 and Ubuntu Linux 14.04 x64. be sure you do a make clean each time.



[quote="shargash"]Never mind. I figured it out. I have been copying world server to a run-time directory, and I didn't realize I had to copy the samples subdirectory as well as WorldServer.exe. It started fine after I did the copy.[/quote]
Your LUA scripts can exist anywhere, you just have to point to them in the `lua_scripts` table. I have never tried fully-qualified paths, but have always used relative. Can't say D:\lua\stuff.lua will work if world is outside D:\lua, for example.