1
0
mirror of https://git.kore.io/kore.git synced 2024-11-18 16:08:29 +01:00
kore/examples/cpp
2019-09-27 20:00:35 +02:00
..
conf Allow multiple binds on new server directive. 2019-09-27 20:00:35 +02:00
src Style changes. 2015-04-07 13:11:31 +02:00
.gitignore
dh2048.pem
README.md kore -> kodev where appropriate 2017-03-06 11:00:53 +01:00

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++):

	# kodev run

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

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

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

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