Script Coder wrote: |
---|
Try adding the following flag to your compile |
clang++ -Wall -std=c++11 -D_DEBUG -DSFML_STATIC -I../../lib/json-parser/ -L/usr/local/lib -o ../../bin/chesspp Application.cpp AppStateGame.cpp graphics/Graphics.cpp ../Main.cpp ../../lib/json-parser/json.c log/Logger.cpp board/Bishop.cpp board/Board.cpp board/King.cpp board/Knight.cpp board/Pawn.cpp board/Piece.cpp board/Position.cpp board/Queen.cpp board/Rook.cpp -lsfml-system-s-d -lsfml-graphics -lsfml-window-s-d |
Error: Error loading JSON: 1:0: Unexpected Caught in main: Segmentation fault |
error: ../../lib/json-parser/json.c: No such file or directory |
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated In file included from Application.cpp:1: In file included from ./Application.hpp:4: In file included from ./AppState.hpp:24: In file included from ./AppStateGame.hpp:5: In file included from ./graphics/Graphics.hpp:6: ./graphics/../config/Configuration.hpp:20:10: fatal error: '../log/logger.hpp' file not found #include "../log/logger.hpp" ^ 1 error generated. |
#include "log/logger.hpp"
compiling with `-I dir'C:/Users/Nicholas/AppData/Local/Temp/Application-442877.o:fake:(.text+0x12b): undefined reference to `sf::RenderWindow::RenderWindow(sf::VideoMode, sf::String const&, unsigned int, sf::ContextSettings const&)' |
clang++ -Wall -std=c++11 -D_DEBUG -DSFML_STATIC -I../../lib/json-parser/ -L/usr/local/lib -o ../../bin/chesspp Application.cpp AppStateGame.cpp graphics/Graphics.cpp ../Main.cpp ../../lib/json-parser/json.c log/Logger.cpp board/Bishop.cpp board/Board.cpp board/King.cpp board/Knight.cpp board/Pawn.cpp board/Piece.cpp board/Position.cpp board/Queen.cpp board/Rook.cpp -lsfml-system-s-d -lsfml-graphics -lsfml-window-s-d |
LB wrote: |
---|
How have you been able to compile? |
Program received signal SIGSEGV, Segmentation fault. 0x00007ffff70a852a in __dynamic_cast () from /usr/lib/libstdc++.so.6 (gdb) bt #0 0x00007ffff70a852a in __dynamic_cast () from /usr/lib/libstdc++.so.6 #1 0x0000000000408a81 in chesspp::Exception::operator== (this=0x7a49b0, other=...) at src/Exception.hpp:33 #2 0x0000000000407cad in chesspp::operator== (e1=..., e2=...) at src/Exception.hpp:37 #3 0x0000000000407d8e in chesspp::Exception::fullMessage (this=0x7a49b0) at src/Exception.hpp:55 #4 0x0000000000407b49 in main () at src/Main.cpp:13 |
#0 chesspp::Exception::Exception (this=0x7fffffffd4b0, e="") at src/Exception.hpp:20 #1 0x000000000040e780 in chesspp::util::JsonReader::JsonReader (this=0x7fffffffded8, s=...) at src/util/JsonReader.hpp:29 #2 0x000000000040e5bd in chesspp::util::JsonReader::JsonReader (this=0x7fffffffded8, s=...) at src/util/JsonReader.hpp:31 #3 0x000000000040e58d in chesspp::util::JsonReader::JsonReader(<unknown type in ChessPlusPlus/bin.debug/chesscpp.bin, CU 0x48f1f, DIE 0x6076f>) (this=0x7fffffffded8, s=<unknown type in ChessPlusPlus/bin.debug/chesscpp.bin, CU 0x48f1f, DIE 0x6076f>) at src/util/JsonReader.hpp:33 #4 0x000000000040df47 in chesspp::config::Configuration::Configuration ( this=0x7fffffffdec8, configFile="config.json") at src/config/Configuration.hpp:72 #5 0x000000000040f2b2 in chesspp::config::BoardConfig::BoardConfig (this=0x7fffffffdec8) at src/config/Configuration.hpp:95 #6 0x0000000000409f65 in chesspp::config::BoardConfig::BoardConfig (this=0x7fffffffdec8) at src/config/Configuration.hpp:96 #7 0x00000000004095d2 in chesspp::graphics::GraphicsHandler::GraphicsHandler ( this=0x5a83b0, _display=0x7fffffffe0b0) at src/graphics/Graphics.cpp:11 #8 0x00000000004106b2 in chesspp::AppStateGame::AppStateGame (this=0x5a8390, _app=0x7fffffffe0b0, _display=0x7fffffffe0b0) at src/AppStateGame.cpp:9 #9 0x000000000040f943 in chesspp::Application::Application (this=0x7fffffffe0b0) at src/Application.cpp:10 #10 0x0000000000408ebe in main () at src/Main.cpp:9 |