From 61c3d48bca06e840026aac8c45248b7f29bcebc1 Mon Sep 17 00:00:00 2001 From: Tim Uebelhoer <tim.uebelhoer@rwth-aachen.de> Date: Mon, 18 Dec 2017 23:24:59 +0100 Subject: [PATCH] Few fixes for DLL export --- ModeliRpc/ModeliRpcNative/IRpcFrontend.h | 5 +++-- ModeliRpc/ModeliRpcNative/ModeliRpcNative.vcxproj | 6 ++++++ ModeliRpc/ModeliRpcNative/RpcFrontend.h | 5 ++--- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/ModeliRpc/ModeliRpcNative/IRpcFrontend.h b/ModeliRpc/ModeliRpcNative/IRpcFrontend.h index e859903..a830cd0 100644 --- a/ModeliRpc/ModeliRpcNative/IRpcFrontend.h +++ b/ModeliRpc/ModeliRpcNative/IRpcFrontend.h @@ -54,5 +54,6 @@ public: /// Returns fmi2Status virtual int setValues(ValuesStruct values) = 0; }; -// Factory signature -extern "C" __declspec(dllexport) IRpcFrontend* createRpcFrontend(); \ No newline at end of file + +// Export a function of this type +typedef IRpcFrontend* (*createRpcFrontendType)(); \ No newline at end of file diff --git a/ModeliRpc/ModeliRpcNative/ModeliRpcNative.vcxproj b/ModeliRpc/ModeliRpcNative/ModeliRpcNative.vcxproj index 39aa961..51988ea 100644 --- a/ModeliRpc/ModeliRpcNative/ModeliRpcNative.vcxproj +++ b/ModeliRpc/ModeliRpcNative/ModeliRpcNative.vcxproj @@ -71,15 +71,21 @@ <PropertyGroup Label="UserMacros" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <LinkIncremental>true</LinkIncremental> + <OutDir>$(Platform)\$(Configuration)\</OutDir> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <LinkIncremental>true</LinkIncremental> + <OutDir>$(Platform)\$(Configuration)\</OutDir> + <IntDir>$(Platform)\$(Configuration)\</IntDir> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <LinkIncremental>false</LinkIncremental> + <OutDir>$(Platform)\$(Configuration)\</OutDir> + <IntDir>$(Platform)\$(Configuration)\</IntDir> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <LinkIncremental>false</LinkIncremental> + <OutDir>$(Platform)\$(Configuration)\</OutDir> </PropertyGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <ClCompile> diff --git a/ModeliRpc/ModeliRpcNative/RpcFrontend.h b/ModeliRpc/ModeliRpcNative/RpcFrontend.h index d81fe70..8b514da 100644 --- a/ModeliRpc/ModeliRpcNative/RpcFrontend.h +++ b/ModeliRpc/ModeliRpcNative/RpcFrontend.h @@ -33,8 +33,7 @@ private: }; /// Factory method that returns an implementation of IRpcFrontend. -IRpcFrontend* createRpcFrontend() +extern "C" __declspec(dllexport) IRpcFrontend* createRpcFrontend() { return new RpcFrontend(); -} - +} \ No newline at end of file -- GitLab