Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7875 Discussions

dll cannot be loaded in other machines


Dear all,

I am a very new beginner to the c/c++ programming. I wrote some C code and compiled it to a dll which is used as a plugin in another application. The problem I have now is that the dll compiled using the Intel C++ Compiler 19.0 loads fine to the application in my laptop where the dll is compiled, but it could not be loaded to the same application ("could not load the plugin") in two other Wintel machines. This happens even if I stripped off all machine-specific options in the compilation. On the other hand, the dll compiled using Visual C++ compiler can be loaded to multiple Wintel machines without problems. I much prefer the Intel version of the dll since the application runs much faster with it (when it works, that is). The followings are some details.

* programing language: C (not C++);
* environment: Microsoft Visual Studio 2017 Community Version + Intel Parallel Studio XE 2019;
* machine used to compile the dll: notebook, Win10 (64bit), Intel Core i7-8550U CPU (Kaby Lake R);
* machines to be tested: (1) desktop, Win7 (64bit), Intel Core i7-6700K CPU (Skylake); (2) desktop, Win10 (64bit), Intel Core i7-8700 CPU (Coffee Lake).

The code is compiled using either the Intel compiler or the MS Visual compiler, both are done in MS VS2017. I did not use command lines.

The compilation options are the follows.

/MP /GS- /TC /W3 /Zc:wchar_t- /Zi /Od /Fd"x64\Release\vc141.pdb" /fp:precise /D "NDEBUG" /D "MSLE8C_EXPORTS" /D "_WINDOWS" /D "_USRDLL" /D "_WINDLL" /D "_UNICODE" /D "UNICODE" /Zc:forScope- /MD /FC /Fa"x64\Release\" /nologo /Fo"x64\Release\" /Qprof-dir "x64\Release\" /Fp"x64\Release\msle8c.pch" 

I'll appreciate if anyone can share insights. Thanks in advance.


0 Kudos
3 Replies

I dont see any command line options which could be fail to run on another platform. Not so sure what happened in your ENV.

0 Kudos

you can use the dependency walker to find which dll are missing.


0 Kudos

Thanks to Viet and Vladimir for the replies and suggestions. Here is the update.

(1) In one of the desktops that previously didn't load the dll, I installed VS 2017 and Intel Parallel Studio XE 2019. After the installation, the dll, which is compiled in the notebook, can now be loaded successfully. I think it indicates that the dll requires some libraries that come with the VS and/or the Intel Studio.

(2) In another desktop that does not have the VS and the Studio, the dll still does not load. I run the dependency walker but do not know how to interpret the results. In the follows I cut and paste a relevant part of the log file. Note that MSLE8C.DLL is the dll I compiled and tried to load. Any guidance will be appreciated!


===== excerpt from Dependency Walker log file =====

     [*E6] MSLE8C.DLL

          Import  Ordinal     Hint        Function    Entry Point
          ------  ----------  ----------  ----------  -----------

          Export  Ordinal     Hint        Function    Entry Point
          ------  ----------  ----------  ----------  -----------
          [C  ]   1 (0x0001)  0 (0x0000)  pginit      0x000043A0
          [C  ]   2 (0x0002)  1 (0x0001)  stata_call  0x00001700

          [ ? ] LIBMMD.DLL

               Import  Ordinal  Hint          Function  Entry Point
               ------  -------  ------------  --------  -----------
               [CE ]       N/A  626 (0x0272)  exp       Not Bound
               [CE ]       N/A  776 (0x0308)  log       Not Bound

               Export  Ordinal  Hint          Function  Entry Point
               ------  -------  ------------  --------  -----------

          [ ? ] SVML_DISPMD.DLL

               Import  Ordinal  Hint           Function        Entry Point
               ------  -------  -------------  --------------  -----------
               [CE ]       N/A  5278 (0x149E)  __svml_erf4_l9  Not Bound
               [CE ]       N/A  6634 (0x19EA)  __svml_exp4_l9  Not Bound

               Export  Ordinal  Hint           Function        Entry Point
               ------  -------  -------------  --------------  -----------

          [ ^6] VCRUNTIME140.DLL

               Import  Ordinal  Hint         Function                      Entry Point
               ------  -------  -----------  ----------------------------  -----------
               [C  ]       N/A   8 (0x0008)  __C_specific_handler          Not Bound
               [C  ]       N/A  37 (0x0025)  __std_type_info_destroy_list  Not Bound
               [C  ]       N/A  62 (0x003E)  memset                        Not Bound

          [ ? ] API-MS-WIN-CRT-RUNTIME-L1-1-0.DLL

               Import  Ordinal  Hint         Function                        Entry Point
               ------  -------  -----------  ------------------------------  -----------
               [CE ]       N/A  22 (0x0016)  _cexit                          Not Bound
               [CE ]       N/A  24 (0x0018)  _configure_narrow_argv          Not Bound
               [CE ]       N/A  33 (0x0021)  _errno                          Not Bound
               [CE ]       N/A  34 (0x0022)  _execute_onexit_table           Not Bound
               [CE ]       N/A  51 (0x0033)  _initialize_narrow_environment  Not Bound
               [CE ]       N/A  52 (0x0034)  _initialize_onexit_table        Not Bound
               [CE ]       N/A  54 (0x0036)  _initterm                       Not Bound
               [CE ]       N/A  55 (0x0037)  _initterm_e                     Not Bound
               [CE ]       N/A  63 (0x003F)  _seh_filter_dll                 Not Bound
               [CE ]       N/A  85 (0x0055)  exit                            Not Bound

          [ ? ] API-MS-WIN-CRT-HEAP-L1-1-0.DLL

               Import  Ordinal  Hint         Function  Entry Point
               ------  -------  -----------  --------  -----------
               [CE ]       N/A  24 (0x0018)  free      Not Bound
               [CE ]       N/A  25 (0x0019)  malloc    Not Bound

          [ ? ] API-MS-WIN-CRT-ENVIRONMENT-L1-1-0.DLL

               Import  Ordinal  Hint         Function  Entry Point
               ------  -------  -----------  --------  -----------
               [CE ]       N/A  16 (0x0010)  getenv    Not Bound

          [ ? ] API-MS-WIN-CRT-STRING-L1-1-0.DLL

               Import  Ordinal  Hint          Function  Entry Point
               ------  -------  ------------  --------  -----------
               [CE ]       N/A  133 (0x0085)  strcat_s  Not Bound
               [CE ]       N/A  139 (0x008B)  strlen    Not Bound
               [CE ]       N/A  143 (0x008F)  strncpy   Not Bound

          [ ^6] KERNEL32.DLL

               Import  Ordinal  Hint           Function                     Entry Point
               ------  -------  -------------  ---------------------------  -----------
               [C  ]       N/A   290 (0x0122)  DisableThreadLibraryCalls    Not Bound
               [C  ]       N/A   309 (0x0135)  EnterCriticalSection         Not Bound
               [C  ]       N/A   428 (0x01AC)  FormatMessageA               Not Bound
               [C  ]       N/A   541 (0x021D)  GetCurrentProcess            Not Bound
               [C  ]       N/A   542 (0x021E)  GetCurrentProcessId          Not Bound
               [C  ]       N/A   546 (0x0222)  GetCurrentThreadId           Not Bound
               [C  ]       N/A   575 (0x023F)  GetEnvironmentVariableA      Not Bound
               [C  ]       N/A   636 (0x027C)  GetModuleHandleExA           Not Bound
               [C  ]       N/A   693 (0x02B5)  GetProcAddress               Not Bound
               [C  ]       N/A   752 (0x02F0)  GetSystemTimeAsFileTime      Not Bound
               [C  ]       N/A   774 (0x0306)  GetThreadLocale              Not Bound
               [C  ]       N/A   871 (0x0367)  InitializeCriticalSection    Not Bound
               [C  ]       N/A   876 (0x036C)  InitializeSListHead          Not Bound
               [C  ]       N/A   898 (0x0382)  IsDebuggerPresent            Not Bound
               [C  ]       N/A   905 (0x0389)  IsProcessorFeaturePresent    Not Bound
               [C  ]       N/A   960 (0x03C0)  LeaveCriticalSection         Not Bound
               [C  ]       N/A   964 (0x03C4)  LoadLibraryA                 Not Bound
               [C  ]       N/A   965 (0x03C5)  LoadLibraryExA               Not Bound
               [C  ]       N/A  1104 (0x0450)  QueryPerformanceCounter      Not Bound
               [C  ]       N/A  1235 (0x04D3)  RtlCaptureContext            Not Bound
               [C  ]       N/A  1242 (0x04DA)  RtlLookupFunctionEntry       Not Bound
               [C  ]       N/A  1249 (0x04E1)  RtlVirtualUnwind             Not Bound
               [C  ]       N/A  1403 (0x057B)  SetUnhandledExceptionFilter  Not Bound
               [C  ]       N/A  1434 (0x059A)  TerminateProcess             Not Bound
               [C  ]       N/A  1468 (0x05BC)  UnhandledExceptionFilter     Not Bound

               [F^6] NTDLL.DLL

                    Import  Ordinal  Hint  Function                      Entry Point
                    ------  -------  ----  ----------------------------  -----------
                    [C  ]       N/A   N/A  RtlLeaveCriticalSection       Not Bound
                    [C  ]       N/A   N/A  RtlInitializeSListHead        Not Bound
                    [C  ]       N/A   N/A  RtlEnterCriticalSection       Not Bound
                    [C  ]       N/A   N/A  RtlInitializeCriticalSection  Not Bound

0 Kudos