@Kha I was having several errors of the form ``` 224: /Users/leonardodemoura/projects/lean4/build/release/stage0.5/bin/../include/lean/runtime/exception.h:23:13: error: exception specification of overriding function is more lax than base version 224: virtual ~throwable() noexcept; 224: ^ 224: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/exception:102:13: note: overridden virtual function is here 224: virtual ~exception() _NOEXCEPT; 224: ^ 224: In file included from myfuns.cpp:1: ``` As far as I can tell, the error ocurrs because my compiler uses an old C++ standard if the option `-std` is not used. I guess `-std=c++11` would also works, but I decided to use the same standard we used to compile Lean.
15 lines
356 B
Makefile
15 lines
356 B
Makefile
PKG = main
|
|
CPPFLAGS = -O3
|
|
include lean.mk
|
|
|
|
CPP_SRCS = myfuns.cpp
|
|
CPP_OBJS = $(addprefix $(OUT)/testcpp/,$(CPP_SRCS:.cpp=.o))
|
|
|
|
all: $(BIN_OUT)/test
|
|
|
|
$(OUT)/testcpp/%.o: %.cpp
|
|
@mkdir -p "$(@D)"
|
|
c++ -std=c++14 -c -o $@ $< $(CPPFLAGS) `leanc -print-cflags`
|
|
|
|
$(BIN_OUT)/test: $(LIB_OUT)/libmain.a $(CPP_OBJS) | $(BIN_OUT)
|
|
c++ -o $@ $^ `leanc -print-ldflags`
|