My function is simple, this is one of my function in mydll.cpp, it is a simple UUID function:
// C LIBRARY FOR INPUT/OUTPUT STREAMS
#include <stdio.h>
// IN ORDER TO HAVE ACCESS TO FLEXSIM FUNCTIONS, INCLUDE FLEXSIMDEFS.H
#include "FlexsimDefs.h"
#include <iostream>
#include <windows.h>
#include <winhttp.h>
#include <websocket.h>
#include <vector>
#include <time.h>
#include <sys/timeb.h>
#include <string>
#include <atlstr.h>
#include <thread>
#pragma comment(lib, "Websocket.lib")
#pragma comment(lib, "winhttp.lib")
using namespace std;
//#define CHROME_USER_AGENT TEXT("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36")
#define CHROME_USER_AGENT TEXT("Apache-HttpClient/4.5.12 (Java/11.0.6)")
__declspec(dllexport) Variant UUIDF(FLEXSIMINTERFACE)
{
//struct timeb stb;
//::ftime(&stb);
//::srand((unsigned)stb.millitm);
LARGE_INTEGER nStartCounter;
::QueryPerformanceCounter(&nStartCounter);
::srand((unsigned)nStartCounter.LowPart);
//srand((unsigned)time(NULL));
CString strRand;
long long time_last = time(NULL);
struct timeb t1;
ftime(&t1);
long long t2 = t1.time * 100000 + t1.millitm * 100 + rand();
int letter1 = 'A' + rand() % 26;
int letter2 = 'A' + rand() % 26;
int letter3 = 'A' + rand() % 26;
string t3 = to_string(t1.time) + (char)letter1 + (char)letter2 + to_string(t1.millitm) + (char)letter3;
return t3
when i build it in debug model, it builds success, but in release model, it occur the error:
error LNK2019: Unresolved external symbol "__declspec(dllimport) public: __cdecl FlexSim::Map::~Map(void)" (__imp_??1Map@FlexSim@@QEAA@XZ)
and in my other mydll function, it occur in release model too.