MitchellSternke / SuperMarioBros-C

An attempt to translate the original Super Mario Bros. for the NES to readable C/C++
625 stars 70 forks source link

Manjaro can't compile this #14

Open xcom169 opened 4 years ago

xcom169 commented 4 years ago

Manjaro can't compile this because of missing SDL?

ain.cpp:(.text+0x58c): undefined reference to SDL_GetTicks' /usr/bin/ld: Main.cpp:(.text+0x5b8): undefined reference toSDL_PollEvent' /usr/bin/ld: Main.cpp:(.text+0x604): undefined reference to SDL_GetKeyboardState' /usr/bin/ld: Main.cpp:(.text+0x7d6): undefined reference toSDL_SetWindowFullscreen' /usr/bin/ld: Main.cpp:(.text+0x81b): undefined reference to SDL_UpdateTexture' /usr/bin/ld: Main.cpp:(.text+0x82a): undefined reference toSDL_RenderClear' /usr/bin/ld: Main.cpp:(.text+0x843): undefined reference to SDL_RenderSetLogicalSize' /usr/bin/ld: Main.cpp:(.text+0x863): undefined reference toSDL_RenderCopy' /usr/bin/ld: Main.cpp:(.text+0x885): undefined reference to SDL_RenderSetLogicalSize' /usr/bin/ld: Main.cpp:(.text+0x8a5): undefined reference toSDL_RenderCopy' /usr/bin/ld: Main.cpp:(.text+0x8b4): undefined reference to SDL_RenderPresent' /usr/bin/ld: Main.cpp:(.text+0x8b9): undefined reference toSDL_GetTicks' /usr/bin/ld: Main.cpp:(.text+0x922): undefined reference to SDL_Delay' /usr/bin/ld: CMakeFiles/smbc.dir/source/Emulation/APU.cpp.o: in functionAPU::stepFrame()': APU.cpp:(.text+0x3f4): undefined reference to SDL_LockAudio' /usr/bin/ld: APU.cpp:(.text+0x4f1): undefined reference toSDL_UnlockAudio' /usr/bin/ld: CMakeFiles/smbc.dir/source/Util/Video.cpp.o: in function generateScanlineTexture(SDL_Renderer*)': Video.cpp:(.text+0x3f2): undefined reference toSDL_CreateTexture' /usr/bin/ld: Video.cpp:(.text+0x4fe): undefined reference to SDL_SetTextureBlendMode' /usr/bin/ld: Video.cpp:(.text+0x518): undefined reference toSDL_UpdateTexture' collect2: error: ld returned 1 exit status make[2]: [CMakeFiles/smbc.dir/build.make:219: smbc] Error 1 make[1]: [CMakeFiles/Makefile2:96: CMakeFiles/smbc.dir/all] Error 2 make: *** [Makefile:84: all] Error 2

xcom169 commented 4 years ago

I think FIND SDL PACKAGE is not working in CMAKE

F0bes commented 4 years ago

I know I'm a month late but changing the cmake file to contain this line: target_link_libraries(smbc SDL2) Worked for me on Manjaro Linux

tan-wei commented 4 years ago

Both ${SDL2_LIBRARY} and ${SDL2_LIBRARIES} are empty, seems bug of the new version CMake (for me is 3.17.1 now).

Uriegas commented 3 years ago

I'm in Manjaro too, I get this error while executing cmake .. in build directory:

CMake Error at /usr/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:218 (message):
  Could NOT find Boost (missing: Boost_INCLUDE_DIR)
Call Stack (most recent call first):
  /usr/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:582 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.19/Modules/FindBoost.cmake:2208 (find_package_handle_standard_args)
  CMakeLists.txt:22 (find_package)

-- Configuring incomplete, errors occurred!
coreybruce commented 3 years ago

Can confirm this is also a issue for me on the Raspberry pi 4

By editing CMakeLists.txt and replacing target_link_libraries(smbc ${SDL2_LIBRARY} ${SDL2_LIBRARIES}) with target_link_libraries(smbc SDL2) it will compile, can the CMakeLists.txt file be updated place?