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

libmmd.lib and other static libs usage for projects built using MSVC

Abhijit_D_
Beginner
1,899 Views

Hi All,

We are using MS Visual Studio 2015 and Intel C++ Compiler 2017. All of our code is built using Intel compiler. We provide this code to others in form of dll files and associated lib that are  expected to be dynamically linked in their application. These applications are not built using Intel Compiler. When dynamically linking the application, we get an error that libmmd.lib is required. The application of course does not explicitly linked with libmmd.lib nor is it built using Intel compiler. 

Is the libmmd.lib required for the application or are we missing anything here?

If yes, the .lib files are of course not included in Intel redistributables. Are we required to provide them if somebody wants to dynamically link with dll files generated using Intel compiler?

What are the distribution licenses for these libs as far as Intel is concerned?

 

More information. 

We use the /MD switch for code generation. Using the Multi threaded static library this leads to errors.

Detailed design

basicfunctionality.lib written by us, generated using Intel compiler.

consolidatedfunctionality.dll written by us, links with basicfunctionality.lib and is generated using Intel compiler. consolidatedfunctionality.lib is also generated. 

thirdparty.exe written by others, expected to dynamically link with consolidatedfunctionality.dll. consolidatedfunctionality.lib is explicitly specified in linked libraries input. thirdparty.exe is not generated using Intel compiler, rather it uses MSVC. While building thirdparty.exe, we get an error message libmmd.lib not found. Why is it looking for libmmd.lib when libmmd.dll is already present as runtime library? I can understand consolidatedfunctionality.dll requiring libmmd.dll at runtime but cannot understand why the .lib file is required for building thirdparty.exe. Are we missing something or is this by design.

0 Kudos
1 Solution
JenniferJ
Moderator
1,899 Views

if "basicfunctionality.lib" is not using anything from libmmd.lib, the libmmd.dll is not needed.

Like any other default library used by MSVC, icl also embedded all the default libraries into the .lib (.obj too). It's why the linker requests the libmmd.lib. (can use "dumpbin /DIRECTIVES basicfunctionality.lib"to see the embedded default .lib files from Intel Compiler)

To ignore the default libraries, use "/Zl" (lower case 'L') when compiling files in "basicfunctionality.lib". you will need to add "libirc.lib" & other needed .lib files at linker time explicitly because icl does not emit any libraries in the .obj. When generating "consolidatedfunctionality.dll", if it needs symbols from libmmd.lib,  you need to link libmmd.lib and redistribute libmmd.dll.

This is the basic idea. It's developer's responsibility to test and make sure all the needed libraries are linked, and the necessary redistributables are in your pkg.

Please submit to Intel Online Service Center for more specific or further questions/ issues:

https://software.intel.com/en-us/articles/how-to-create-a-support-request-at-online-service-center 

Jennifer

View solution in original post

0 Kudos
2 Replies
JenniferJ
Moderator
1,900 Views

if "basicfunctionality.lib" is not using anything from libmmd.lib, the libmmd.dll is not needed.

Like any other default library used by MSVC, icl also embedded all the default libraries into the .lib (.obj too). It's why the linker requests the libmmd.lib. (can use "dumpbin /DIRECTIVES basicfunctionality.lib"to see the embedded default .lib files from Intel Compiler)

To ignore the default libraries, use "/Zl" (lower case 'L') when compiling files in "basicfunctionality.lib". you will need to add "libirc.lib" & other needed .lib files at linker time explicitly because icl does not emit any libraries in the .obj. When generating "consolidatedfunctionality.dll", if it needs symbols from libmmd.lib,  you need to link libmmd.lib and redistribute libmmd.dll.

This is the basic idea. It's developer's responsibility to test and make sure all the needed libraries are linked, and the necessary redistributables are in your pkg.

Please submit to Intel Online Service Center for more specific or further questions/ issues:

https://software.intel.com/en-us/articles/how-to-create-a-support-request-at-online-service-center 

Jennifer

0 Kudos
Abhijit_D_
Beginner
1,899 Views

Thanks Jennifer,

I also got support from Intel support for this problem and it is resolved for me now. They suggested the exact same solution as you did to resolve this problem. 

Regards,

Abhijit

0 Kudos
Reply