Author Topic: Segmentation fault (core dumped) on starting  (Read 27554 times)

Online Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: Segmentation fault (core dumped) on starting
« Reply #45 on: June 14, 2016, 10:29:15 pm »
This deepens on build tool you use, I usually use Makefile to build OXC.
In Makefile you need add lines:
Code: [Select]
SRCS_YAML = ../../lib/yaml-cpp/
SRCS_YAML_CPP = $(wildcard $(SRCS_YAML)src/*.cpp $(SRCS_YAML)src/contrib/*.cpp)
and
Code: [Select]
$(OBJDIR)yaml/%.o:: $(SRCS_YAML)src/%.cpp
@mkdir -p $(OBJDIR)yaml
$(CXX) $(CXXFLAGS) -c -o $@ $<

$(OBJDIR)yaml/%.o:: $(SRCS_YAML)src/contrib/%.cpp
@mkdir -p $(OBJDIR)yaml
$(CXX) $(CXXFLAGS) -c -o $@ $<
Its shodul placed it like in https://github.com/Yankes/OpenXcom/blob/OpenXcomExtended/src/Makefile.mingw but this file is for Windows
Proper Makefile for linux is https://github.com/Yankes/OpenXcom/blob/OpenXcomExtended/src/Makefile.simple but build yaml dynamically from system headers.
You would need add this lines to it and remove yam from `$(shell $(PKG-CONFIG) --libs sdl yaml-cpp)`.

For cmake it will be probably bit harder, I don't know it how properly do it but fast hack would be adding manually new parts to https://github.com/Yankes/OpenXcom/blob/OpenXcomExtended/src/CMakeLists.txt
Code: [Select]
set ( yaml_src
  yaml/SomeYamlFile.cpp
  yaml/AnotherYamlFile.cpp
)
You will need probably list all cpp files manually to made it work (similar how rest of oxc is handled). Maybe is possible to use wild char like `*` to skip listing all files but I don't know without some googling.

Offline buenaventura

  • Sergeant
  • **
  • Posts: 21
    • View Profile
Re: Segmentation fault (core dumped) on starting
« Reply #46 on: June 15, 2016, 03:32:25 pm »
Thank you, that is very thorough! I will start trying this soon.