O
O
Oleksandr2015-05-28 13:59:48
C++ / C#
Oleksandr, 2015-05-28 13:59:48

Will there be any problems with static compilation of the C++ library?

Now I'm compiling the library with the "Multi-threaded DLL (/MD)" key - but some users get an error.
It is important to note that the program, or rather the plug-in, works in the 3ds Max environment.
I started to supply files msvcp110.dll and msvcr110.dll with my library.
I just put them in the same folder with my library, but another problem arose - some users began to run some functions slowly in 3ds max.
As far as I understand, when calling my library, the msvc * 110.dll libraries are loaded and in the future they are also used by 3ds max.
A possible solution is to compile with the "Multi-threaded (/MT)" key - that is, these libraries (msvc*110.dll and others) will be built into my dll.
Will this help in my case, and will 3ds max in this case load the "correct" libraries, ignoring those built into my library?
Do I need to set the "Use of MFC" option to "Use MFC in a Static Library"
Thank you!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Stanislav Makarov, 2015-05-28
@Track77

If you compile the rints statically, in theory there should be no problems, because you will have your own set of functions that does not overlap with what 3dmax is loading. It simply won't "see" your copy of the runtime libraries. they will be a monolith with your plugin.
If you are sure that the matter is in a library conflict (what else you need to make sure - you can see which modules are loaded by 3dmax when your plugin is running using Process Explorer - in theory, both its libraries and yours, which lie next to the plugin), then you can try to set the rints in a more serious way - using the installation package. If your plugin already has an installer, then you need to integrate the runtime redistributable-installer into it, if not, then users will have to run the installation themselves. The advantage of this method is that the operating system itself must resolve potential conflicts (side-by-side, that's all).
And yet, check whether your libraries really "replace" 3d-max ones and whether they differ from each other at all. The 2012 studio runtime does not seem to have many versions in the world (MS released 2013 rather quickly and raised the vc++ version).

V
Vladislav Yaroslavlev, 2015-05-28
@vladon

Do I need to set the "Use of MFC" option to "Use MFC in a Static Library"

If you're not using MFC (I hope not, because it's HELL), then no.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question