main.cpp
Code: Select all
#include <kos.h>
#include <time.h>
#include <mutex>
extern uint8 romdisk[];
KOS_INIT_ROMDISK(romdisk);
int main(int argc, char **argv) {
pvr_init_params_t pvrInit = { {PVR_BINSIZE_0, PVR_BINSIZE_0, PVR_BINSIZE_32, PVR_BINSIZE_0, PVR_BINSIZE_0}, 512 * 1024};
pvr_init(&pvrInit);
std::mutex d_mutex;
return 0;
}
Code: Select all
TARGET = example.elf
OBJS = main.o
all: rm-elf $(TARGET)
include $(KOS_BASE)/Makefile.rules
clean:
-rm -f $(TARGET) $(OBJS) romdisk.*
rm-elf:
-rm -f $(TARGET) romdisk.*
$(TARGET): $(OBJS) romdisk.o
kos-c++ -std=c11 -o $(TARGET) $(OBJS) romdisk.o $(OBJEXTRA) -lm
romdisk.img:
$(KOS_GENROMFS) -f romdisk.img -d romdisk -v
romdisk.o: romdisk.img
$(KOS_BASE)/utils/bin2o/bin2o romdisk.img romdisk romdisk.o
run: $(TARGET)
$(KOS_LOADER) $(TARGET)
dist:
rm -f $(OBJS) romdisk.o romdisk.img
$(KOS_STRIP) $(TARGET)
My Error:
Code: Select all
rm -f example.elf romdisk.*
kos-c++ -c main.cpp -o main.o
In file included from /opt/toolchains/dc/sh-elf/lib/gcc/sh-elf/4.7.3/../../../../sh-elf/include/c++/4.7.3/mutex:36:0,
from main.cpp:8:
/opt/toolchains/dc/sh-elf/lib/gcc/sh-elf/4.7.3/../../../../sh-elf/include/c++/4.7.3/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
main.cpp: In function ‘int main(int, char**)’:
main.cpp:19:5: error: ‘mutex’ is not a member of ‘std’
main.cpp:19:18: error: expected ‘;’ before ‘d_mutex’
make: *** [main.o] Error 1