OneLoneCoder / olcNES

NES Emulator, and Tutorial Video Code
1.35k stars 225 forks source link

Part #3: segfault after compilation #44

Open lis6502 opened 2 years ago

lis6502 commented 2 years ago

Hi! thank you for really deep dive into NES internals :) I wanted to play around with part 3's "cpu monitor" but i am unable to.

Looking around part 2's source i figured out possible g++ invocation lis6502@e595:/var/tmp/auda/olcNES/Part #3 - Buses, Rams, Roms & Mappers$ g++ -o example Mapper.cpp Mapper_000.cpp Cartridge.cpp Bus.cpp olc2C02.cpp olc6502.cpp olcNes_Video2_2C02.cpp -lX11 -lGL -lpthread -lpng -lstdc++fs -std=c++17 -I ../../olcPixelGameEngine/ my g++ version lis6502@e595:/var/tmp/auda/olcNES/Part #3 - Buses, Rams, Roms & Mappers$ g++ --version g++ (Debian 11.3.0-3) 11.3.0 Copyright (C) 2021 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

with -Wall it threws some undefined pragma warnings, but other than that produces executable file.

lis6502@e595:/var/tmp/auda/olcNES/Part #3 - Buses, Rams, Roms & Mappers$ ./example Segmentation fault

I am not much into cpp, especially when i realized that order of arguments like sources, executable name and include paths are significant. What am i doing wrong here?

ps.1 olcPGE example complies just fine. ps.2 at Cartridge.h you've missed #include <memory> ;p

brccabral commented 1 year ago

Probably it is the same error described in #51