dllimport

Linking errors while exporting std::vector from dll

邮差的信 提交于 2021-01-28 04:55:15
问题 I have a dll ( my_library.dll ) that exports a struct using __ declspec(dllexport) . Since this struct contains an std::vector<std::wstring> member , I've also exported functions for it like so: template class __declspec(dllexport) std::allocator<std::wstring>; template class __declspec(dllexport) std::vector<std::wstring>; Please note that I've defined macros such that dll exports above struct and vector when compiling and they are imported (via __declspec(dllimport)) when the dll is being

C# calling a DLL function that returns a pointer to pointer to an array of structures

陌路散爱 提交于 2021-01-28 03:30:56
问题 I have tried many different combinations of the various methods to marshal this call. This is a DLL that returns a pointer to a pointer to an array of structures. The types like debugPort are actually enums. /** * \struct debugConnectParameters * \brief Get device characterization and specify connection parameters through ST-LINK interface. */ typedef struct debugConnectParameters { debugPort dbgPort; /**< Select the type of debug interface #debugPort. */ int index; /**< Select one of the

C# calling a DLL function that returns a pointer to pointer to an array of structures

拈花ヽ惹草 提交于 2021-01-28 02:14:16
问题 I have tried many different combinations of the various methods to marshal this call. This is a DLL that returns a pointer to a pointer to an array of structures. The types like debugPort are actually enums. /** * \struct debugConnectParameters * \brief Get device characterization and specify connection parameters through ST-LINK interface. */ typedef struct debugConnectParameters { debugPort dbgPort; /**< Select the type of debug interface #debugPort. */ int index; /**< Select one of the

How to overwrite macro definition in CMake

杀马特。学长 韩版系。学妹 提交于 2021-01-27 21:40:51
问题 I am on Windows 10, Visual Studio 2015. Suppose I am building library A with CMakeLists looking like cmake_minimum_required(VERSION 3.7) project(A) set(DLLIMPORT "__declspec(dllimport)") set(DLLEXPORT "__declspec(dllexport)") set(PROJECT_SRCS ${PROJECT_SOURCE_DIR}/src/TestA.cpp) set(PROJECT_INCS ${PROJECT_SOURCE_DIR}/include/TestA.h) add_library(${PROJECT_NAME} SHARED ${PROJECT_SRCS} ${PROJECT_INCS}) target_compile_definitions(${PROJECT_NAME} INTERFACE WINDOWS_DLL_API=${DLLIMPORT}) target

Rust linker seeks a LIB, rather than a DLL

穿精又带淫゛_ 提交于 2020-12-10 07:59:07
问题 I'm experimenting with Rust on Windows. My code declares and calls a function in an external library. The declaration is like this: #[link(name = "Rvea0326nc-64")] extern "C" { fn WeibullSpeedProbability(wa: &f32, wk: &f32, qu: &f32, prob: &f32, theerr: &i32) -> (); } (It's all ByRef because the DLL is Fortran. It's built with the Intel compiler.) Note that the file name has no extension. The DLL is in the \target\debug\deps folder of the Rust project. According to the documentation here

c# How to use the new Version Helper API

安稳与你 提交于 2020-12-05 06:22:38
问题 Since OSVersion is now not reliable since Windows 10 has been released (this function reports Windows 8 for Windows 10), I'm attempting to use the new Version Helper API functions in my C# application. Here they are. I apologize if this is simply a issue with my DLL import, but here is my attempt to pull in these new methods to detect the OS correctly. [DllImport("kernel32.dll", CharSet = CharSet.Auto)] public static extern bool IsWindows7OrGreater(); [DllImport("kernel32.dll", CharSet =

c# How to use the new Version Helper API

牧云@^-^@ 提交于 2020-12-05 06:22:13
问题 Since OSVersion is now not reliable since Windows 10 has been released (this function reports Windows 8 for Windows 10), I'm attempting to use the new Version Helper API functions in my C# application. Here they are. I apologize if this is simply a issue with my DLL import, but here is my attempt to pull in these new methods to detect the OS correctly. [DllImport("kernel32.dll", CharSet = CharSet.Auto)] public static extern bool IsWindows7OrGreater(); [DllImport("kernel32.dll", CharSet =