Error 2Error C2491: “SDK_functions::pinstance_” : definition of dllimport static data member is not allowed
This error occurred because I changed the export macro vs automatically created for me:
// The following ifdef blocks are a great way to make exporting from a DLL easier.
// Standard method for macros. All files in this DLL are defined on the command line using CYAPI_2013_EXPORTS
// Symbolic compilation. When using this DLL's
// This symbol should not be defined on any other project. In this way, any other item in the source file that contains this file will be
// The CYAPI_2013_API function is treated as imported from a DLL, which will be defined with this macro.
// Symbols are considered to be exported.
#ifdef CYAPI_EXPORTS
#define CYAPI_API __declspec(dllexport)
#else
#define CYAPI_API __declspec(dllimport)
#endif
As you can see, I manually dropped the 2013 characters, leaving the macro undefined by CYAPI_EXPORTS, and using succspec (DLlimport). Per declspec(DLlexport) is to be exported, for the person I have to write the export library with this; Succinct/DECLspec (DLlimport) is the import to be used by the people using the library.
In MSDN it says: you can compile the code correctly without using succdeclspec (DLlimport), but using succdeclspec (DLlimport) allows the compiler to produce better code. The compiler generates better code because it can determine whether a function exists in a DLL, which allows the compiler to generate code that skips the indirection level, which would normally occur in function calls across DLL boundaries. However, you must use succspec (DLlimport) to import the variables used in the DLL.
If someone wants to use the static variables in my library, they have to use succdeclspec (DLlimport) to import the variables in the DLL, so they have to export the variable using succdeclspec (DLlexport). For general variables, you don’t have to.
Read More:
- Mac Docker pull Error: Error response from daemon: Get https://xx.xx.xx.xx/v2/: Service Unavailable
- [Solved] target_link_libraries error: a missing vtable usually means the first non-inline virtual member function has no definition.
- [Solved] C++ Compile: error LNK2019: unresolved external “XX“
- error LNK2019: Unresolvable external symbols “__declspec(dllimport) public: int __thiscall QString::toWCharArray(wchar_t
- How to Solve error C2039: “to_ String “: not a member of” STD “
- [Solved] A-LOAM Ceres Compile Error: error: ‘integer_sequence’ is not a member of ‘std‘
- [Solved] error: value createSchemaRDD is not a member of org.apache.spark.sql.SQLContext
- [How to Fix] manual close is not allowed over a Spring managed SqlSession
- Fuseki failed with message “Parse error: [line:1, col: 1] Content is not allowed in prolog.“
- AUC Error – ValueError: Data is not binary and pos_label is not specified
- [Solved] VINS-MONO: integer_sequence_algorithm.h:64:21: error: ‘integer_sequence’ is not a member of ‘std’
- [Solved] Unity Error: ‘BuildPipeline‘ does not contain a definition for ‘GetBuildTargetName‘
- errorThrown:ReferenceError: data is not defined [How to Solve]
- Solve the data transfer between vue irrelevant components error: this.$store.commit is not a function
- Vscode pylint reported an error of “no member”, but it is running normally
- error A2031: gisters not allowed [How to Solve]
- [Solved] MindSpore Error: Data type conversion of ‘Parameter’ is not supporte
- [Fixed] error: ‘start‘ is a private member of ‘QThread‘
- C Language error: two or more data types in declaration specifiers
- The uibot database connection is unrecognized error: The object definition error