Import run-time dlls into exe file

Import run-time dlls into exe file

imagem de Albert P.

Hello!

I need include run-time dlls (MSVCR110.dll, libmmd.dll, etc) into exe file.

How can I include it?

Thank you.

12 posts / 0 new
Último post
Para obter mais informações sobre otimizações de compiladores, consulte Aviso sobre otimizações.
imagem de Sergey Kostrov

>>...I need include run-time dlls (MSVCR110.dll, libmmd.dll, etc) into exe file.
>>How can I include it?

Many DLLs have import libraries ( look in ..\VC\Lib folder ) and in your case you should look for:

MSVCR110.dll -> MSVCR110.lib
libmmd.dll -> libmmd..lib

There are several ways and two most common are as follows:

- In a VS project settings ( Linker section / Additiomal dependencies or libraries )

or

- In source codes ( in cpp- or h-files ), like:

...
#pragma comment ( lib, "MSVCR110.lib" )
#pragma comment ( lib, "libmmd..lib" )
...

imagem de Albert P.

Thank you for reply, but there is no that libs. Where can I find it?

imagem de Albert P.

I guess, It's impossible to find that libs (see the attach.)

Anexos: 

AnexoTamanho
Download 110.jpg54.11 KB
imagem de Milind Kulkarni (Intel)

take a look at C Runtime libraries of VS2012. as always for all visual studio, the import library for MSVCRT110.dll is again msvcrt.lib (same name for any other visual studio). So you can import that.
the rest is okay. but i think MSVCRT110.dll should be present in your target/host system, being the dll version linking.
I think you should also be able to do well building the project with /MD option, which I think should be default for EXE/dll. also, libmmd.dll, MSVCRT110.dll both can be redistributed.
in some case, you will also likely have to add additional libraries to the Linker -> Input under Additional Dependencies. I think you should not try to mix /MT & /MD in a single application. let us know if still you face any problem.

imagem de Jennifer J. (Intel)
Best Reply

The libmmd.dll is the dll version of the math lib. The static lib version is the libmmt.lib.
The MSVCR110.dll 's static lib is msvcrt.lib.

To link both static .lib files, use /MT compile option. To be certain, add "libmmt.lib" to the link option as well. I don't remember if the "libmmt.lib" will be linked automatically when /MT is specified.

Jennifer

imagem de Albert P.

Thank you very much!

imagem de Sergey Kostrov

>>...take a look at C Runtime libraries of VS2012. as always for all visual studio, the import library for MSVCRT110.dll is again msvcrt.lib...

It is not clear what VS version / edition 'Albert P' is using. Actually, I've never included any MSVCRT*.lib libraries directly because VS project wizards do the job.

imagem de Sergey Kostrov

>>Thank you for reply, but there is no that libs. Where can I find it?

Here are a couple of questions:

- Why do you need these two libraries?
- Did you have some linker errors?
- Could you explain what set of CRT-functions you are going to use / or using?

Please provide some technical details. Thanks in advance.

imagem de Albert P.

Quote:

Sergey Kostrov wrote:

>>Thank you for reply, but there is no that libs. Where can I find it?

Here are a couple of questions:

- Why do you need these two libraries?
- Did you have some linker errors?
- Could you explain what set of CRT-functions you are going to use / or using?

Please provide some technical details. Thanks in advance.

2 libs for 2 programs.
Quote:

1>icl : warning #10121: overriding '/MD' with '/MT'
- but anyway lib is included
imagem de Sergey Kostrov

I'd like to make a follow up:

>>...Actually, I've never included any MSVCRT*.lib libraries directly because VS project wizards do the job...

In case you need to use msvcrt* import libraries please take into account that:

- 'msvcrt.lib' is for Release configurations
- 'msvcrtd.lib' is for Debug configurations

imagem de Albert P.

Thank you Sergey for help!

Faça login para deixar um comentário.