How do you compile this? And is it possible to convert this to c#?
I'm trying to compile this in Visual Studio 2014.
Oh porting to Visual Studio is going to be tough. I've never even used that thing. On Windows the best way is to use Mingw.
The reason I'm using it is because I got it free because I'm going to college 😀 Its really nice.
When installing, what do I need for MinGW?
I think it's easier to install Linux and compile on that, getting the right MinGW (hint: full c++11 support) and all dependencies was a nightmare. You can find the dependencies here, they are the same for Win and Linux.
In Linux, trying to compile there, I get this error:
g++ -MMD -Werror -Wall -std=c++0x -Wno-sign-compare -Wno-unused-variable -Wfatal-errors -I. -I./extern -DRELEASE -O3 -c music.cpp -o obj-opt/music.o
window_view.cpp: In member function ‘Rectangle WindowView::getMapGuiBounds() const’:
window_view.cpp:92:1: error: control reaches end of non-void function [-Werror=return-type]
compilation terminated due to -Wfatal-errors.
cc1plus: all warnings being treated as errors
g++ -MMD -Werror -Wall -std=c++0x -Wno-sign-compare -Wno-unused-variable -Wfatal-errors -I. -I./extern -DRELEASE -O3 -c test.cpp -o obj-opt/test.o
make: *** [obj-opt/window_view.o] Error 1
make: *** Waiting for unfinished jobs….
Hold on, I'll fix it in a moment.
I'm using clang normally, that's why gcc may give some errors.
This is the last thing I did. Installed the angel scripts and ran the compile code again. This is the output:
root@ubuntu:/home/snow/keeperrl# make -j 8 OPT=true RELEASE=true
g++ -Werror -Wall -std=c++0x -Wno-sign-compare -Wno-unused-variable -Wfatal-errors -I. -I./extern -DRELEASE -O3 -o keeper obj-opt/time_queue.o obj-opt/level.o obj-opt/model.o obj-opt/square.o obj-opt/util.o obj-opt/monster.o obj-opt/square_factory.o obj-opt/view.o obj-opt/creature.o obj-opt/item_factory.o obj-opt/item.o obj-opt/inventory.o obj-opt/debug.o obj-opt/player.o obj-opt/window_view.o obj-opt/field_of_view.o obj-opt/view_object.o obj-opt/creature_factory.o obj-opt/quest.o obj-opt/shortest_path.o obj-opt/effect.o obj-opt/equipment.o obj-opt/level_maker.o obj-opt/monster_ai.o obj-opt/attack.o obj-opt/tribe.o obj-opt/name_generator.o obj-opt/event.o obj-opt/location.o obj-opt/skill.o obj-opt/fire.o obj-opt/ranged_weapon.o obj-opt/map_layout.o obj-opt/trigger.o obj-opt/map_memory.o obj-opt/view_index.o obj-opt/pantheon.o obj-opt/enemy_check.o obj-opt/collective.o obj-opt/player_control.o obj-opt/task.o obj-opt/controller.o obj-opt/village_control.o obj-opt/poison_gas.o obj-opt/minion_equipment.o obj-opt/statistics.o obj-opt/options.o obj-opt/renderer.o obj-opt/tile.o obj-opt/map_gui.o obj-opt/gui_elem.o obj-opt/item_attributes.o obj-opt/creature_attributes.o obj-opt/serialization.o obj-opt/unique_entity.o obj-opt/entity_set.o obj-opt/gender.o obj-opt/main.o obj-opt/gzstream.o obj-opt/singleton.o obj-opt/technology.o obj-opt/encyclopedia.o obj-opt/creature_view.o obj-opt/input_queue.o obj-opt/user_input.o obj-opt/window_renderer.o obj-opt/minimap_gui.o obj-opt/music.o obj-opt/test.o obj-opt/sectors.o obj-opt/vision.o obj-opt/animation.o obj-opt/clock.o obj-opt/square_type.o obj-opt/creature_action.o obj-opt/collective_control.o obj-opt/script_context.o obj-opt/renderable.o obj-opt/bucket_map.o obj-opt/task_map.o obj-opt/movement_type.o obj-opt/collective_builder.o obj-opt/player_message.o obj-opt/extern/scriptbuilder.o obj-opt/extern/scripthelper.o obj-opt/extern/scriptstdstring.o -L/usr/lib/x86_64-linux-gnu -lsfml-audio -lsfml-graphics -lsfml-window -lsfml-system -lboost_serialization -lz -langelscript -lpthread -Wl,-rpath=. -static-libstdc++
obj-opt/item_factory.o: In function `TrapItem::apply(Creature*, Level*)':
item_factory.cpp:(.text._ZN8TrapItem5applyEP8CreatureP5Level[_ZN8TrapItem5applyEP8CreatureP5Level]+0x9c): undefined reference to `Trigger::getTrap(ViewObject const&, Level*, Vec2, EnumVariant<EffectId, boost::variant, TypeAssign<LastingEffect, EffectId > >, Tribe*)'
obj-opt/level_maker.o: In function `Connector::connect(Level::Builder*, Vec2, Vec2, Rectangle)':
level_maker.cpp:(.text._ZN9Connector7connectEPN5Level7BuilderE4Vec2S3_9Rectangle[_ZN9Connector7connectEPN5Level7BuilderE4Vec2S3_9Rectangle]+0x233): undefined reference to `isWall(EnumVariant<SquareId, boost::variant, TypeAssign<DeityHabitat, SquareId >, TypeAssign<Creature const*, SquareId >, TypeAssign<CreatureFactory::SingleCreature, SquareId >, TypeAssign<Tribe const*, SquareId > >)'
collect2: error: ld returned 1 exit status
make: *** [keeper] Error 1
What version of gcc do you have? (try gcc -v) You need at least 4.8.3
I just compiled everything with gcc and it worked fine.
What do I have to do to install that version?
What do I need to do to install from scratch. New OS new everything.
Just upgrade your ubuntu to the newest version, google it 🙂
I upgraded and the version I have is 4.9
The error never went away. I still am unable to compile the game. 🙁
Do you get the same error with clang?
It's probably a problem with how I used boost::variant. If you tell me your version of boost, I could try compiling against it and see if I get the same error.
Sorry I haven't replied in a while. I go to college so I do not always have time to mess with things. Yes I am still getting that error. I have put a fresh Ubuntu on a serpent computer and am going to try to compile from there. Yes but with clang it does not display the exact error it just tells me an error happened while compiling. I'm having some problems apt-get install gcc 4.8.3 I was at one time in my vm able to get version 4.9 but I was getting the same error. I am doing it on another machine this weekend to see what happens and to see if it was because it was in a virtual machine.
For future readers/compilers;
In Ubuntu 16.04 for KeeperRL Alpha 20.1 I had to deviate a little from the Github instructions. I had to install:
Then it compiled correctly with
make -j 8 OPT=true RELEASE=true CLANG=true
The Docker method gave me errors on missing packages, and after adding them, SDL2 library errors (maybe someone with Docker experience can look into that?).
You must be logged in to reply to this topic.