Compilation issues with rev709-710
Moderator: Community Managers
- Blackstorm
- Retired
- Posts: 354
- Joined: Thu Sep 04, 2014 11:11 am
- Location: Paris, FRANCE
- Contact:
Compilation issues with rev709-710
Hi,
Follow this trick to compile the rev710 under Linux (Debian).
I only have updated the Gcc 4.7.2 to the new one on unstable sources (4.9.1) in case of the problem was with the c++11 directives but it should work with gcc 4.7+
- First, like John said, add in the "Makefile", at the end after "Combat.o" this :
- 2nd : You need to edit the MasterSpawnList.cpp and find this code :
Line 110 :
replace by :
Line 134 :
replace by :
Line 170 :
replace by :
- 3rd, edit MasterSpawnList.h
Line 157-158 should be only :
Do "make" ^^
You could have a warning/notice about Lua :
but not sure, maybe it's only on my server ^^
Enjoy!!
Twuce ^^
Follow this trick to compile the rev710 under Linux (Debian).
I only have updated the Gcc 4.7.2 to the new one on unstable sources (4.9.1) in case of the problem was with the c++11 directives but it should work with gcc 4.7+
- First, like John said, add in the "Makefile", at the end after "Combat.o" this :
Code: Select all
Combat.o \
PatchServer.o \
MasterSpawnList.o
Line 110 :
Code: Select all
npc_list.AddNpc(make_shared<Npc>(npc_spawns[spawn_id], itr.second));
Code: Select all
auto myNpc = make_shared<Npc>(npc_spawns[spawn_id], itr.second);
npc_list.AddNpc(myNpc);
Code: Select all
ppo_list.AddPPO(make_shared<PlayerPlacedObject>(ppo_spawns[itr2.spawn_id], itr.second));
Code: Select all
auto myPPO = make_shared<PlayerPlacedObject>(ppo_spawns[itr2.spawn_id], itr.second);
ppo_list.AddPPO(myPPO);
Code: Select all
mover_list.AddMover(make_shared<Mover>(itr));
Code: Select all
auto myMover = make_shared<Mover>(itr);
mover_list.AddMover(myMover);
Line 157-158 should be only :
Code: Select all
MasterSpawnList();
~MasterSpawnList();
Do "make" ^^
You could have a warning/notice about Lua :
Code: Select all
../Lua/liblua5-2-3.a(loslib.o): dans la fonction « os_tmpname »:
loslib.c:(.text+0x29c): AVERTISSEMENT: the use of `tmpnam' is dangerous, better use `mkstemp'
Enjoy!!
Twuce ^^
Last edited by Blackstorm on Tue Oct 14, 2014 1:07 pm, edited 4 times in total.
Re: Compilation issues with rev709-710
You can also declare (in the AddNpc/PPO/Mover functions in their respective classes) the const qualifier before the shared_ptr<Npc/PlayerPlacedObject/etc> and it will compile. Thanks to Ratief for finding this particular solution.
Thanks for sleuthing this out, Blackstorm!
Thanks for sleuthing this out, Blackstorm!
- John Adams
- Retired
- Posts: 4581
- Joined: Wed Aug 28, 2013 9:40 am
- Location: Phoenix, AZ.
- Contact:
Re: Compilation issues with rev709-710
Ratief has made an official fix for this, and my linux world is once again compiling. After I've had some time to test a few recent code commits, and possible fix to recent crashes, I will update Public SVN with fixed Linux, code and new vgo_world.sql schema.
- Blackstorm
- Retired
- Posts: 354
- Joined: Thu Sep 04, 2014 11:11 am
- Location: Paris, FRANCE
- Contact:
Re: Compilation issues with rev709-710
Can i have a concret example for the fix please ? i would like to understand the solution ^^ (i understand the looked's post but i am not a c++ dev so i don't see how the code fully works^^)
- John Adams
- Retired
- Posts: 4581
- Joined: Wed Aug 28, 2013 9:40 am
- Location: Phoenix, AZ.
- Contact:
Re: Compilation issues with rev709-710
Example, very simple fix which is exactly what StackOverflow responses suggested:
Change:
To
Change:
Code: Select all
void NpcList::AddNpc(shared_ptr<Npc>& npc)
Code: Select all
void NpcList::AddNpc(const shared_ptr<Npc>& npc)
- Blackstorm
- Retired
- Posts: 354
- Joined: Thu Sep 04, 2014 11:11 am
- Location: Paris, FRANCE
- Contact:
Re: Compilation issues with rev709-710
ahh ^^ ok, thanks a lot for the example ^^