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

'size_t' not available in namespace 'std'. #4

Closed the-code-innovator closed 6 years ago

the-code-innovator commented 6 years ago

Error @ make :

Step Output :

$ mkdir ./build/
$ cd ./build/
$ cmake ..
-- The C compiler identification is AppleClang 9.0.0.9000039
-- The CXX compiler identification is AppleClang 9.0.0.9000039
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found BISON: /usr/bin/bison (found version "2.3")
-- Found FLEX: /usr/bin/flex (found version "2.5.35")
-- Boost version: 1.67.0
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/${user}/Desktop/smb/smb-c/build
$ make
[  5%] [FLEX][scanner] Building scanner with flex 2.5.35
[ 11%] [BISON][parser] Building parser with bison 2.3
asm6502.y: conflicts: 14 shift/reduce
Scanning dependencies of target codegen
[ 17%] Building CXX object codegen/CMakeFiles/codegen.dir/parser.cpp.o
[ 23%] Building CXX object codegen/CMakeFiles/codegen.dir/lexer.cpp.o
[ 29%] Building CXX object codegen/CMakeFiles/codegen.dir/ast.cpp.o
[ 35%] Building CXX object codegen/CMakeFiles/codegen.dir/translator.cpp.o
[ 41%] Building CXX object codegen/CMakeFiles/codegen.dir/util.cpp.o
[ 47%] Linking CXX executable codegen
[ 47%] Built target codegen
Scanning dependencies of target smbc
[ 52%] Building CXX object CMakeFiles/smbc.dir/source/Main.cpp.o
[ 58%] Building CXX object CMakeFiles/smbc.dir/source/Emulation/APU.cpp.o
[ 64%] Building CXX object CMakeFiles/smbc.dir/source/Emulation/Controller.cpp.o
[ 70%] Building CXX object CMakeFiles/smbc.dir/source/Emulation/MemoryAccess.cpp.o
In file included from /Users/${user}/Desktop/smb/smb-c/source/Emulation/MemoryAccess.cpp:1:
/Users/${user}/Desktop/smb/smb-c/source/Emulation/../SMB/SMBEngine.hpp:174:64: error: no type named 'size_t' in namespace 'std'
    void writeData(uint16_t address, const uint8_t* data, std::size_t length);
                                                                                              ~~~~~^
1 error generated.
make[2]: *** [CMakeFiles/smbc.dir/source/Emulation/MemoryAccess.cpp.o] Error 1
make[1]: *** [CMakeFiles/smbc.dir/all] Error 2
make: *** [all] Error 2

System Information :

shaunlebron commented 6 years ago

I had the same problem on mac, and fixed it with the following changes: https://github.com/shaunlebron/SuperMarioBros-C/commit/9a38b0af99488e8cc4e3a11572d558d56490e529

It should work as is on my mac-fix branch.