From b493c6cd39ebbb3d2cda6530075f3236848f8500 Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Tue, 11 Aug 2020 23:59:15 +0200 Subject: [PATCH] DynamicLink: Tell compiler about invisible calls This makes DynamicLink, and in fact all Demos, build cleanly with -Wmissing-declarations. Note that this won't be necessary for 'normal' dynamic shared objects, as those usually already declare their symbols in a header file. --- Demos/DynamicLink/LinkLib/DynamicLib.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Demos/DynamicLink/LinkLib/DynamicLib.cpp b/Demos/DynamicLink/LinkLib/DynamicLib.cpp index 0b92684c36c..547a206468c 100644 --- a/Demos/DynamicLink/LinkLib/DynamicLib.cpp +++ b/Demos/DynamicLink/LinkLib/DynamicLib.cpp @@ -55,6 +55,12 @@ private: Global g_glob { 5 }; extern "C" { + +// Tell the compiler that these symbols might be accessed from other places: +extern int global_lib_variable; +void global_lib_function(); +const char* other_lib_function(int my_argument); + int global_lib_variable = 1234; void global_lib_function()