kore/examples/cpp
Corbin Hughes 698b3f374f Compile and link C++ with g++ instead of gcc 2016-06-26 15:49:59 -05:00
..
conf Compile and link C++ with g++ instead of gcc 2016-06-26 15:49:59 -05:00
src Style changes. 2015-04-07 13:11:31 +02:00
.gitignore Add C++ example. 2015-04-01 07:59:32 -04:00
README.md Update README.md for cpp example. 2015-04-07 13:10:28 +02:00
dh2048.pem Add C++ example. 2015-04-01 07:59:32 -04:00

README.md

Kore example showing how to use C++ support!

All functions accessible to kore must have their prototypes wrapped with the extern keyword like so:

extern “C” {
	int pageA(struct http_request *);
	int pageB(struct http_request *);
	int validatorA(struct http_request *, char *);
}

In order to run this example with the default C++ settings (default compiler dialect, libstdc++):

	# kore run

In order to run with a specific dialect and C++ runtime:

	# env CXXSTD=c++11 CXXLIB=c++ kore run

You can also supply your own compiler combined with the above:

	# env CC=clang++ CXXSTD=c++11 CXXLIB=c++ kore run