lukka / CppOpenGLWebAssemblyCMake

A C++/OpenGL/OpenAL based application built with CMake for Linux/Windows/macOS/WebAssembly
MIT License
73 stars 5 forks source link

could not open rom file! #2

Closed leordev closed 5 years ago

leordev commented 5 years ago

Hello Lukka, first of all, thanks for building this great repo!

I'm on OSX Mojave 10.14.4, with clang 8, and I was able to compile the project successfully, the problem happens when I try to run the project:

$ mkdir build && cd build
$ cmake ..
$ make  
# project compiles successfully with the final lines:
[100%] Linking CXX executable glfw_app
Copying files from src-dir/data/ to build-dir/data
[100%] Built target glfw_app

# then I try to run the application:
$ ./glfw_app
Loading ROM file: 2600j.bin
Assertion failed: (f != 0 && "could not open rom file!"), function LoadFile, file /Users/leo/Workspace/training/wasm/CppOpenGLWebAssemblyCMake/galaga/GalagaRoms.cpp, line 18.
[1]    71032 abort      ./glfw_app
leordev commented 5 years ago

(Same happens on webassembly, which is actually what I'm looking for):

$ mkdir build && cd build
$ emcmake cmake ..
$ make -j
# project compiles successfully with the final lines:
[100%] Linking CXX executable wasm_app_wasm.js
Copying files from src-dir/data/ to build-dir/data
Copying files from src-dir/WebApplication/ to build-dir/
[100%] Built target wasm_app

$ emrun --no_browser --port 8000 .
$ open http://localhost:8000/wasm_app.html
# javascript console
Uncaught (in promise) abort("Assertion failed: f != 0 && \"could not open rom file!\", at: /Users/leo/Workspace/training/wasm/CppOpenGLWebAssemblyCMake/galaga/GalagaRoms.cpp,18,LoadFile") at Error
    at jsStackTrace (http://localhost:8000/wasm_app_wasm.js:1188:13)
    at stackTrace (http://localhost:8000/wasm_app_wasm.js:1205:12)
    at abort (http://localhost:8000/wasm_app_wasm.js:13045:44)
    at ___assert_fail (http://localhost:8000/wasm_app_wasm.js:1769:7)
    at wasm-function[746]:822
    at wasm-function[744]:1043
    at wasm-function[733]:53
    at wasm-function[941]:680
    at wasm-function[938]:1230
    at wasm-function[666]:1673
lukka commented 5 years ago

@leordev you are right, the ROM files are missing from this repository too, as they are copyrighted. More information about which files are needed in the readme.md documentation file.

leordev commented 5 years ago

awwwwwwwwwwwwwwwwwww ok, I'm sorry! I didn't pay attention to that... Thanks lukka