提示画面ですが実行するとSegmentation fault (core dumped)
というエラーが出るのでデバッガで調べたのですが結果の意味を理解できません。これは何を意味しているのでしょうか? Main.cppを全てコメントアウトしても同じ現象が起きます。ソースファイルの保存もしました。
ソースコード全文 : https://54.gigafile.nu/0430-b11ef3ad0805dbde55d7d301a2f429006
環境
OS: ubuntu
利用ライブラリ opengl glew glfw,stb freetype
参考サイト:https://sunadarake.github.io/entry/2019/05/24/112315/
shigurechan@shigurechan-System-Product-Name:~/ドキュメント/FrameWork$ gdb Game GNU gdb (Ubuntu 9.2-0ubuntu1~20.04.1) 9.2 Copyright (C) 2020 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: youshigurechan@shigurechan-System-Product-Name:~/ドキュメント/FrameWork$ gdb Game GNU gdb (Ubuntu 9.2-0ubuntu1~20.04.1) 9.2 Copyright (C) 2020 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from Game... (gdb) run Starting program: /home/shigurechan/ドキュメント/FrameWork/Game [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Program received signal SIGSEGV, Segmentation fault. 0x0000000000000000 in ?? () (gdb) run The program being debugged has been started already. Start it from the beginning? (y or n) y Starting program: /home/shigurechan/ドキュメント/FrameWork/Game [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Program received signal SIGSEGV, Segmentation fault. 0x0000000000000000 in ?? () (gdb) are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from Game... (gdb) run Starting program: /home/shigurechan/ドキュメント/FrameWork/Game [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Program received signal SIGSEGV, Segmentation fault. 0x0000000000000000 in ?? () (gdb) run The program being debugged has been started already. Start it from the beginning? (y or n) y Starting program: /home/shigurechan/ドキュメント/FrameWork/Game [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Program received signal SIGSEGV, Segmentation fault. 0x0000000000000000 in ?? () (gdb)
Main.cpp
cpp
1#include <iostream> 2#include <GL/glew.h> 3#include <GLFW/glfw3.h> 4 5#include "../FrameWork/header/FrameWork.hpp" 6 7int main() 8{ 9 /* 10 if (glfwInit() == GL_FALSE) 11 { 12 std::cerr << "glfw を初期化出来ません。" << std::endl; 13 } 14 15 std::shared_ptr<FrameWork::Window> window = std::make_shared<FrameWork::Window>(glm::ivec2(640,480),"sample"); 16 FrameWork::SetCurrentWindowContext(window); 17 18 if (glewInit() != GLEW_OK) 19 { 20 std::cerr << "glew を初期化出来ません。" << std::endl; 21 } 22 23 while(*window) 24 { 25 26 27 28 29 30 31 32 window->SwapBuffer(); 33 } 34 35*/ 36 37 return 0; 38}
makefile
makeifle
1PRG :=Game 2SRC_DIR :=FrameWork/source 3SRC_USE_DIR :=source 4 5OBJ_DIR :=FrameWork/object 6OBJ_USE_DIR :=object 7 8DEP_DIR :=FrameWork/object 9DEP :=$(wildcard $(DEP_DIR)/*.d) 10 11SRC :=$(wildcard $(SRC_DIR)/*.cpp) 12SRC_USE :=$(wildcard $(SRC_USE_DIR)/*.cpp) 13 14OBJ :=$(addprefix $(OBJ_DIR)/,$(patsubst %.cpp,%.o,$(notdir $(SRC)))) 15OBJ_USE :=$(addprefix $(OBJ_USE_DIR)/,$(patsubst %.cpp,%.o,$(notdir $(SRC_USE)))) 16 17$(PRG): $(OBJ) $(OBJ_USE) 18 $(CXX) $^ -o $@ -ldl -lGLESv2 -lGLU -lGL -lglfw3 -pthread -lGL -lGLEW -lfreetype -ldl -lX11 19 20$(OBJ_DIR)/%.o: FrameWork/source/%.cpp 21 $(CXX) -g -c -MMD -MP $< -o $@ 22-include $(DEP) 23 24$(OBJ_USE_DIR)/%.o: source/%.cpp 25 $(CXX) -g -c -MMD -MP $< -o $@ 26-include $(DEP) 27 28 29 30 31clean: 32 rm -f ./$(OBJ_USE_DIR)/*.o ./$(OBJ_DIR)/*.o *.out ./$(OBJ_DIR)/*.d ./$(OBJ_USE_DIR)/*.d $(PRG) 33

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2022/04/23 10:51
2022/04/23 23:45