summaryrefslogtreecommitdiff
path: root/example-cross-compile-cpp/win.cc
diff options
context:
space:
mode:
authorJohannes Stoelp <johannes.stoelp@gmail.com>2024-07-05 00:26:27 +0200
committerJohannes Stoelp <johannes.stoelp@gmail.com>2025-02-07 21:54:55 +0100
commit962f29ba59b3b064d2e6e4d6274f4b4ff09a6412 (patch)
treeabda33f33ede207f9b57a93663bb4a1cc666f8b9 /example-cross-compile-cpp/win.cc
parentb07a942993efe44e5dbdff8088b0ed87c79fc433 (diff)
downloadzig-playground-962f29ba59b3b064d2e6e4d6274f4b4ff09a6412.tar.gz
zig-playground-962f29ba59b3b064d2e6e4d6274f4b4ff09a6412.zip
cross: mini cpp cross compile using zig compiler
Diffstat (limited to 'example-cross-compile-cpp/win.cc')
-rw-r--r--example-cross-compile-cpp/win.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/example-cross-compile-cpp/win.cc b/example-cross-compile-cpp/win.cc
new file mode 100644
index 0000000..abb0f6d
--- /dev/null
+++ b/example-cross-compile-cpp/win.cc
@@ -0,0 +1,9 @@
+#include <windows.h>
+#include <winuser.h>
+
+__declspec(dllimport) void say(const char*);
+
+int main() {
+ say("hello dll");
+ MessageBoxA(nullptr, "world", "hello", 0);
+}