We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4af3ad9 commit 96fc0fdCopy full SHA for 96fc0fd
examples/cpp/lib/.gitignore
@@ -0,0 +1,2 @@
1
+# cmake
2
+build/
examples/cpp/lib/CMakeLists.txt
@@ -0,0 +1,5 @@
+cmake_minimum_required(VERSION 3.16) # default of ubuntu:20.04
+project(ocipkg_example_cpp_lib)
3
+add_library(ocipkg_static_cpp STATIC lib.cpp)
4
+install(TARGETS ocipkg_static_cpp ARCHIVE)
5
+include(CPack)
examples/cpp/lib/lib.cpp
@@ -0,0 +1,7 @@
+#include <iostream>
+
+extern "C" {
+ void hello_from_cpp() {
+ std::cout << "Hello from C++!" << std::endl;
6
+ }
7
+}
0 commit comments