Problem compiling root_v5.24.00 with VC9.0 on Windows Vista

Dear Christian

[quote=“cstrato”]… I would like to compile root with VC9.0 on Vista from the source code alone since I want to use option /MT.
[/quote] I am afraid you are going to waste your time (If course you are free to spend your time the way your want) . Why do you want that /MT?
/MT implies you need for some reason the statically linked version of root.exe. However, your other entry root.cern.ch/phpBB2/viewtopic.php?t=9182 suggests that you are not going to use “root.exe” at all :open_mouth: . So, what we are speaking about here :confused: ?
I am trying to convince you that your trouble with root.cern.ch/phpBB2/viewtopic.php?t=9182 belongs “R” realm and it is OUT of ROOT scope.

By the way "/MT and /MD options are not the compilation ones. They are the “linker” options defining the default name of the CRT library. It can be adjusted with no ROOT re-compilation (see “http://msdn.microsoft.com/en-us/library/3tz4da4a(VS.71).aspx” ).

Why don’t you want to test your ideas with no ROOT first. You want ROOT team assistance. However, you rejected to fulfill two simple steps you had been advised to do.
[ul]1. Use “Dependency walker” to pin point the reason of your troubles.
2. root.cern.ch/phpBB2/viewtopic.ph … ght=#39790 describes the second step. I can repeat

Hi Valeri,

I don’t see how answers to your questions would help. Bertrand understands the issue; as he said he’ll come back to Christian when he found the time.

Cheers, Axel.

Dear all,

Thanks Axel. And just to make things more clear, as this statement:

Is wrong, or at least misleading…
The /MT compiler flag means link with static runtime libraries, aka all the ROOT DLLs are linked against static MSVC libraries. But they are still DLLs and not static libs so root.exe is still linked against dynamic libraries.
And as I said, I’m going to look at this as soon as I’m done with more urgent tasks.

Cheers, Bertrand.

[quote=“bellenot”]Thanks Axel. And just to make things more clear, as this statement:[quote=“fine”]/MT implies you need for some reason the statically linked version of root.exe[/quote]Is wrong, or at least misleading…
The /MT compiler flag means link with static runtime libraries, aka all the ROOT DLLs are linked against static MSVC libraries. But they are still DLLs and not static libs so root.exe is still linked against dynamic libraries.[/quote]Frankly, I did not spot any contradiction between your explanation and my statement.

It sounds you had reproduced his trouble (I missed your post, sorry) and know “What is the reason for his trouble (with no ROOT) to load several VC++ created DLLs into R session?” and believe it is ROOT problem.
I am happy, there are people willing to help him ( “R” people apparently reluctant to do that) and Christian should not do anything on his side and just wait you. ( I am guilty, I asked him to conduct some investigation )

Dear Valeri,

Converting my R-package to Windows XP turned out to be an important step since it allows Windows users to analyze
data which usually require computers with 16-32GB RAM!! Thus it was not surprising for me that most users of my
package are Windows users.

Please note that I would never have succeeded converting my package to WinXP w/o the extensive help of Bertrand, see:
root.cern.ch/phpBB2/viewtopic.ph … f0381f7539
root.cern.ch/phpBB2/viewtopic.ph … f0381f7539
root.cern.ch/phpBB2/viewtopic.ph … f0381f7539
I am very thankful that Bertrand has spent so much time helping me to convert my package to WinXP, and I appreciate
it very much that he is willing to support my trials to convert my package for Window 7.

I appreciate your suggestion to create two DLLs and I intend to expand my test code for this purpose. When you look
at the links you will see that I have already created some demonstration code for testing purposes during the
conversion of my package to WinXP. However, please note that I have a fulltime job and do all development in my
spare time (mostly on weekends) so it will take some time. Since I have already replied to your suggestion that
"…this is a good idea. Long time ago I have created an example w/o ROOT, which I will try to modify." I do not
understand your statement “… and Christian should not do anything on his side…”.

Best regads
Christian

[quote=“cstrato”]I have a fulltime job and do all development in my spare time (mostly on weekends) [/quote]I did not know that. Sorry.[quote=“cstrato”]… I do not understand your statement “… and Christian should not do anything on his side…”.[/quote]I am sorry. I have to confess I suspected the issue cannot be resolved on ROOT side alone and bother you to get some extra information. On the other hand[quote=“Axel”]Bertrand understands the issue; as he said he’ll come back to Christian [/quote]I understand from that my assistance is not required and welcome, the issue is already clear. I am really quite busy right now. STAR is the working experiment, you know.[quote=“bellenot”]I’m going to look at this as soon as I’m done with more urgent tasks[/quote]I congratulate you. You are certainly the lucky guy, the solution is coming and you should just wait. The experts called my assistance [quote=“bellenot”]Is wrong, or at least misleading[/quote]I see no reason to argue. At this point none asks you to build the stupid primitive “HelloWorld”-level examples. That’s.

Dear All,

Meanwhile I had time to follow Valeri’s suggestion and created a DLL “MyClass.dll” which depends on
another DLL “MyClassIOMT.dll” (I am attatching the source code for both libraries).

As expected when compiling both DLLs with option /MT everything works as expected on Windows XP,
although the output of Dependency Walker displays some error messages, see:

LoadLibraryA("C:/home/Rabbitus/CRAN/myRlib/MyClass/libs/MyClass.dll") called from "R.DLL" at address 0x6C7102C8.
Loaded "MYCLASS.DLL" at address 0x10000000.  Successfully hooked module.
Loaded "LIBMYCLASSIOMT.DLL" at address 0x02A80000.  Successfully hooked module.
DllMain(0x02A80000, DLL_PROCESS_ATTACH, 0x00000000) in "LIBMYCLASSIOMT.DLL" called.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "FlsAlloc") called from "LIBMYCLASSIOMT.DLL" at address 0x02A8DCEB and returned NULL. Error: Die angegebene Prozedur wurde nicht gefunden (127).
GetProcAddress(0x7C800000 [KERNEL32.DLL], "FlsGetValue") called from "LIBMYCLASSIOMT.DLL" at address 0x02A8DCF8 and returned NULL. Error: Die angegebene Prozedur wurde nicht gefunden (127).
GetProcAddress(0x7C800000 [KERNEL32.DLL], "FlsSetValue") called from "LIBMYCLASSIOMT.DLL" at address 0x02A8DD05 and returned NULL. Error: Die angegebene Prozedur wurde nicht gefunden (127).
GetProcAddress(0x7C800000 [KERNEL32.DLL], "FlsFree") called from "LIBMYCLASSIOMT.DLL" at address 0x02A8DD12 and returned NULL. Error: Die angegebene Prozedur wurde nicht gefunden (127).
GetProcAddress(0x7C800000 [KERNEL32.DLL], "EncodePointer") called from "LIBMYCLASSIOMT.DLL" at address 0x02A8D89A and returned 0x7C923917.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "EncodePointer") called from "LIBMYCLASSIOMT.DLL" at address 0x02A8D89A and returned 0x7C923917.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "EncodePointer") called from "LIBMYCLASSIOMT.DLL" at address 0x02A8D89A and returned 0x7C923917.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "EncodePointer") called from "LIBMYCLASSIOMT.DLL" at address 0x02A8D89A and returned 0x7C923917.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "EncodePointer") called from "LIBMYCLASSIOMT.DLL" at address 0x02A8D89A and returned 0x7C923917.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "EncodePointer") called from "LIBMYCLASSIOMT.DLL" at address 0x02A8D89A and returned 0x7C923917.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "EncodePointer") called from "LIBMYCLASSIOMT.DLL" at address 0x02A8D89A and returned 0x7C923917.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "DecodePointer") called from "LIBMYCLASSIOMT.DLL" at address 0x02A8D915 and returned 0x7C92393D.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "DecodePointer") called from "LIBMYCLASSIOMT.DLL" at address 0x02A8D915 and returned 0x7C92393D.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "EncodePointer") called from "LIBMYCLASSIOMT.DLL" at address 0x02A8D9E9 and returned 0x7C923917.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "DecodePointer") called from "LIBMYCLASSIOMT.DLL" at address 0x02A8D9F9 and returned 0x7C92393D.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "IsProcessorFeaturePresent") called from "LIBMYCLASSIOMT.DLL" at address 0x02A91006 and returned 0x7C80ACB2.
DllMain(0x02A80000, DLL_PROCESS_ATTACH, 0x00000000) in "LIBMYCLASSIOMT.DLL" returned 1 (0x1).
DllMain(0x10000000, DLL_PROCESS_ATTACH, 0x00000000) in "MYCLASS.DLL" called.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "FlsAlloc") called from "MYCLASS.DLL" at address 0x1000BBAE and returned NULL. Error: Die angegebene Prozedur wurde nicht gefunden (127).
GetProcAddress(0x7C800000 [KERNEL32.DLL], "FlsGetValue") called from "MYCLASS.DLL" at address 0x1000BBBB and returned NULL. Error: Die angegebene Prozedur wurde nicht gefunden (127).
GetProcAddress(0x7C800000 [KERNEL32.DLL], "FlsSetValue") called from "MYCLASS.DLL" at address 0x1000BBC8 and returned NULL. Error: Die angegebene Prozedur wurde nicht gefunden (127).
GetProcAddress(0x7C800000 [KERNEL32.DLL], "FlsFree") called from "MYCLASS.DLL" at address 0x1000BBD5 and returned NULL. Error: Die angegebene Prozedur wurde nicht gefunden (127).
GetProcAddress(0x7C800000 [KERNEL32.DLL], "EncodePointer") called from "MYCLASS.DLL" at address 0x1000B75D and returned 0x7C923917.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "EncodePointer") called from "MYCLASS.DLL" at address 0x1000B75D and returned 0x7C923917.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "EncodePointer") called from "MYCLASS.DLL" at address 0x1000B75D and returned 0x7C923917.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "EncodePointer") called from "MYCLASS.DLL" at address 0x1000B75D and returned 0x7C923917.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "EncodePointer") called from "MYCLASS.DLL" at address 0x1000B75D and returned 0x7C923917.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "EncodePointer") called from "MYCLASS.DLL" at address 0x1000B75D and returned 0x7C923917.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "EncodePointer") called from "MYCLASS.DLL" at address 0x1000B75D and returned 0x7C923917.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "DecodePointer") called from "MYCLASS.DLL" at address 0x1000B7D8 and returned 0x7C92393D.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "DecodePointer") called from "MYCLASS.DLL" at address 0x1000B7D8 and returned 0x7C92393D.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "EncodePointer") called from "MYCLASS.DLL" at address 0x1000B8AC and returned 0x7C923917.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "DecodePointer") called from "MYCLASS.DLL" at address 0x1000B8BC and returned 0x7C92393D.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "IsProcessorFeaturePresent") called from "MYCLASS.DLL" at address 0x1000E7C4 and returned 0x7C80ACB2.
DllMain(0x10000000, DLL_PROCESS_ATTACH, 0x00000000) in "MYCLASS.DLL" returned 1 (0x1).
LoadLibraryA("C:/home/Rabbitus/CRAN/myRlib/MyClass/libs/MyClass.dll") returned 0x10000000.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "SetDllDirectoryA") called from "R.DLL" at address 0x6C710149 and returned 0x7C85EB26.
GetProcAddress(0x10000000 [MYCLASS.DLL], "R_init_MyClass") called from "R.DLL" at address 0x6C71011B and returned NULL. Error: Die angegebene Prozedur wurde nicht gefunden (127).
GetProcAddress(0x10000000 [MYCLASS.DLL], "WriteFileC") called from "R.DLL" at address 0x6C71011B and returned 0x10007C00.

In contrast, compiling both DLLs with option /MT on Vista crashes R and the result of Dependency Walker is:

LoadLibraryA("C:/home/Rabbitus/CRAN/myRlib/MyClass/libs/MyClass.dll") called from "R.DLL" at address 0x6C7102C8.
Loaded "MYCLASS.DLL" at address 0x10000000.  Successfully hooked module.
Loaded "LIBMYCLASSIOMT.DLL" at address 0x02300000.  Successfully hooked module.
DllMain(0x02300000, DLL_PROCESS_ATTACH, 0x00000000) in "LIBMYCLASSIOMT.DLL" called.
GetProcAddress(0x769D0000 [KERNEL32.DLL], "FlsAlloc") called from "LIBMYCLASSIOMT.DLL" at address 0x0230DCEB and returned 0x769F4C08.
GetProcAddress(0x769D0000 [KERNEL32.DLL], "FlsGetValue") called from "LIBMYCLASSIOMT.DLL" at address 0x0230DCF8 and returned 0x76A1C714.
GetProcAddress(0x769D0000 [KERNEL32.DLL], "FlsSetValue") called from "LIBMYCLASSIOMT.DLL" at address 0x0230DD05 and returned 0x76A144B9.
GetProcAddress(0x769D0000 [KERNEL32.DLL], "FlsFree") called from "LIBMYCLASSIOMT.DLL" at address 0x0230DD12 and returned 0x769FF3C8.
GetProcAddress(0x769D0000 [KERNEL32.DLL], "EncodePointer") called from "LIBMYCLASSIOMT.DLL" at address 0x0230D89A and returned 0x76DDFB66.
GetProcAddress(0x769D0000 [KERNEL32.DLL], "EncodePointer") called from "LIBMYCLASSIOMT.DLL" at address 0x0230D89A and returned 0x76DDFB66.
GetProcAddress(0x769D0000 [KERNEL32.DLL], "EncodePointer") called from "LIBMYCLASSIOMT.DLL" at address 0x0230D89A and returned 0x76DDFB66.
GetProcAddress(0x769D0000 [KERNEL32.DLL], "EncodePointer") called from "LIBMYCLASSIOMT.DLL" at address 0x0230D89A and returned 0x76DDFB66.
GetProcAddress(0x769D0000 [KERNEL32.DLL], "EncodePointer") called from "LIBMYCLASSIOMT.DLL" at address 0x0230D89A and returned 0x76DDFB66.
GetProcAddress(0x769D0000 [KERNEL32.DLL], "EncodePointer") called from "LIBMYCLASSIOMT.DLL" at address 0x0230D89A and returned 0x76DDFB66.
GetProcAddress(0x769D0000 [KERNEL32.DLL], "EncodePointer") called from "LIBMYCLASSIOMT.DLL" at address 0x0230D89A and returned 0x76DDFB66.
GetProcAddress(0x769D0000 [KERNEL32.DLL], "DecodePointer") called from "LIBMYCLASSIOMT.DLL" at address 0x0230D915 and returned 0x76DEDB15.
GetProcAddress(0x769D0000 [KERNEL32.DLL], "DecodePointer") called from "LIBMYCLASSIOMT.DLL" at address 0x0230D915 and returned 0x76DEDB15.
GetProcAddress(0x769D0000 [KERNEL32.DLL], "EncodePointer") called from "LIBMYCLASSIOMT.DLL" at address 0x0230D9E9 and returned 0x76DDFB66.
GetProcAddress(0x769D0000 [KERNEL32.DLL], "DecodePointer") called from "LIBMYCLASSIOMT.DLL" at address 0x0230D9F9 and returned 0x76DEDB15.
GetProcAddress(0x769D0000 [KERNEL32.DLL], "IsProcessorFeaturePresent") called from "LIBMYCLASSIOMT.DLL" at address 0x02311006 and returned 0x769F0A06.
DllMain(0x02300000, DLL_PROCESS_ATTACH, 0x00000000) in "LIBMYCLASSIOMT.DLL" returned 1 (0x1).
DllMain(0x10000000, DLL_PROCESS_ATTACH, 0x00000000) in "MYCLASS.DLL" called.
GetProcAddress(0x769D0000 [KERNEL32.DLL], "FlsAlloc") called from "MYCLASS.DLL" at address 0x1000BBAE and returned 0x769F4C08.
GetProcAddress(0x769D0000 [KERNEL32.DLL], "FlsGetValue") called from "MYCLASS.DLL" at address 0x1000BBBB and returned 0x76A1C714.
GetProcAddress(0x769D0000 [KERNEL32.DLL], "FlsSetValue") called from "MYCLASS.DLL" at address 0x1000BBC8 and returned 0x76A144B9.
GetProcAddress(0x769D0000 [KERNEL32.DLL], "FlsFree") called from "MYCLASS.DLL" at address 0x1000BBD5 and returned 0x769FF3C8.
GetProcAddress(0x769D0000 [KERNEL32.DLL], "EncodePointer") called from "MYCLASS.DLL" at address 0x1000B75D and returned 0x76DDFB66.
GetProcAddress(0x769D0000 [KERNEL32.DLL], "EncodePointer") called from "MYCLASS.DLL" at address 0x1000B75D and returned 0x76DDFB66.
GetProcAddress(0x769D0000 [KERNEL32.DLL], "EncodePointer") called from "MYCLASS.DLL" at address 0x1000B75D and returned 0x76DDFB66.
GetProcAddress(0x769D0000 [KERNEL32.DLL], "EncodePointer") called from "MYCLASS.DLL" at address 0x1000B75D and returned 0x76DDFB66.
GetProcAddress(0x769D0000 [KERNEL32.DLL], "EncodePointer") called from "MYCLASS.DLL" at address 0x1000B75D and returned 0x76DDFB66.
GetProcAddress(0x769D0000 [KERNEL32.DLL], "EncodePointer") called from "MYCLASS.DLL" at address 0x1000B75D and returned 0x76DDFB66.
GetProcAddress(0x769D0000 [KERNEL32.DLL], "EncodePointer") called from "MYCLASS.DLL" at address 0x1000B75D and returned 0x76DDFB66.
GetProcAddress(0x769D0000 [KERNEL32.DLL], "DecodePointer") called from "MYCLASS.DLL" at address 0x1000B7D8 and returned 0x76DEDB15.
GetProcAddress(0x769D0000 [KERNEL32.DLL], "DecodePointer") called from "MYCLASS.DLL" at address 0x1000B7D8 and returned 0x76DEDB15.
GetProcAddress(0x769D0000 [KERNEL32.DLL], "EncodePointer") called from "MYCLASS.DLL" at address 0x1000B8AC and returned 0x76DDFB66.
GetProcAddress(0x769D0000 [KERNEL32.DLL], "DecodePointer") called from "MYCLASS.DLL" at address 0x1000B8BC and returned 0x76DEDB15.
GetProcAddress(0x769D0000 [KERNEL32.DLL], "IsProcessorFeaturePresent") called from "MYCLASS.DLL" at address 0x1000E7C4 and returned 0x769F0A06.
DllMain(0x10000000, DLL_PROCESS_ATTACH, 0x00000000) in "MYCLASS.DLL" returned 1 (0x1).
LoadLibraryA("C:/home/Rabbitus/CRAN/myRlib/MyClass/libs/MyClass.dll") returned 0x10000000.
GetProcAddress(0x769D0000 [KERNEL32.DLL], "SetDllDirectoryA") called from "R.DLL" at address 0x6C710149 and returned 0x76A61B1E.
GetProcAddress(0x10000000 [MYCLASS.DLL], "R_init_MyClass") called from "R.DLL" at address 0x6C71011B and returned NULL. Error: Die angegebene Prozedur wurde nicht gefunden (127).
GetProcAddress(0x10000000 [MYCLASS.DLL], "WriteFileC") called from "R.DLL" at address 0x6C71011B and returned 0x100049D0.
HEAP[RTERM.EXE]: Invalid address specified to RtlFreeHeap( 02380000, 02472ED8 )

At the moment I do not know how to interpret these results since strangely Dependency Walker reports
errors for “FlsAlloc”, “FlsGetValue” and “FlsSetValue” on WinXP only but NOT on Vista. Nevertheless,
the DLLs work on WinXP but not on Vista

In addition I have also compiled a standolone DLL with option /MT, which works ok on both WinXP and Vista.
However, the output of Dependency Walker on WinXP shows some errors:

LoadLibraryA("C:/home/Rabbitus/CRAN/myRlib/MyClass/libs/MyClass.dll") called from "R.DLL" at address 0x6C7102C8.
Loaded "MYCLASS.DLL" at address 0x10000000.  Successfully hooked module.
DllMain(0x10000000, DLL_PROCESS_ATTACH, 0x00000000) in "MYCLASS.DLL" called.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "FlsAlloc") called from "MYCLASS.DLL" at address 0x1000E2DB and returned NULL. Error: Die angegebene Prozedur wurde nicht gefunden (127).
GetProcAddress(0x7C800000 [KERNEL32.DLL], "FlsGetValue") called from "MYCLASS.DLL" at address 0x1000E2E8 and returned NULL. Error: Die angegebene Prozedur wurde nicht gefunden (127).
GetProcAddress(0x7C800000 [KERNEL32.DLL], "FlsSetValue") called from "MYCLASS.DLL" at address 0x1000E2F5 and returned NULL. Error: Die angegebene Prozedur wurde nicht gefunden (127).
GetProcAddress(0x7C800000 [KERNEL32.DLL], "FlsFree") called from "MYCLASS.DLL" at address 0x1000E302 and returned NULL. Error: Die angegebene Prozedur wurde nicht gefunden (127).
GetProcAddress(0x7C800000 [KERNEL32.DLL], "EncodePointer") called from "MYCLASS.DLL" at address 0x1000DE8A and returned 0x7C923917.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "EncodePointer") called from "MYCLASS.DLL" at address 0x1000DE8A and returned 0x7C923917.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "EncodePointer") called from "MYCLASS.DLL" at address 0x1000DE8A and returned 0x7C923917.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "EncodePointer") called from "MYCLASS.DLL" at address 0x1000DE8A and returned 0x7C923917.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "EncodePointer") called from "MYCLASS.DLL" at address 0x1000DE8A and returned 0x7C923917.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "EncodePointer") called from "MYCLASS.DLL" at address 0x1000DE8A and returned 0x7C923917.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "EncodePointer") called from "MYCLASS.DLL" at address 0x1000DE8A and returned 0x7C923917.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "DecodePointer") called from "MYCLASS.DLL" at address 0x1000DF05 and returned 0x7C92393D.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "DecodePointer") called from "MYCLASS.DLL" at address 0x1000DF05 and returned 0x7C92393D.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "EncodePointer") called from "MYCLASS.DLL" at address 0x1000DFD9 and returned 0x7C923917.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "DecodePointer") called from "MYCLASS.DLL" at address 0x1000DFE9 and returned 0x7C92393D.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "IsProcessorFeaturePresent") called from "MYCLASS.DLL" at address 0x10010F34 and returned 0x7C80ACB2.
DllMain(0x10000000, DLL_PROCESS_ATTACH, 0x00000000) in "MYCLASS.DLL" returned 1 (0x1).
LoadLibraryA("C:/home/Rabbitus/CRAN/myRlib/MyClass/libs/MyClass.dll") returned 0x10000000.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "SetDllDirectoryA") called from "R.DLL" at address 0x6C710149 and returned 0x7C85EB26.
GetProcAddress(0x10000000 [MYCLASS.DLL], "R_init_MyClass") called from "R.DLL" at address 0x6C71011B and returned NULL. Error: Die angegebene Prozedur wurde nicht gefunden (127).
GetProcAddress(0x10000000 [MYCLASS.DLL], "WriteFileC") called from "R.DLL" at address 0x6C71011B and returned 0x10007C00.

Interestingly, the output of Dependency Walker on Vista does not show these errors:

LoadLibraryA("C:/home/Rabbitus/CRAN/myRlib/MyClass/libs/MyClass.dll") called from "R.DLL" at address 0x6C7102C8.
Loaded "MYCLASS.DLL" at address 0x10000000.  Successfully hooked module.
DllMain(0x10000000, DLL_PROCESS_ATTACH, 0x00000000) in "MYCLASS.DLL" called.
GetProcAddress(0x769D0000 [KERNEL32.DLL], "FlsAlloc") called from "MYCLASS.DLL" at address 0x1000E2DB and returned 0x769F4C08.
GetProcAddress(0x769D0000 [KERNEL32.DLL], "FlsGetValue") called from "MYCLASS.DLL" at address 0x1000E2E8 and returned 0x76A1C714.
GetProcAddress(0x769D0000 [KERNEL32.DLL], "FlsSetValue") called from "MYCLASS.DLL" at address 0x1000E2F5 and returned 0x76A144B9.
GetProcAddress(0x769D0000 [KERNEL32.DLL], "FlsFree") called from "MYCLASS.DLL" at address 0x1000E302 and returned 0x769FF3C8.
GetProcAddress(0x769D0000 [KERNEL32.DLL], "EncodePointer") called from "MYCLASS.DLL" at address 0x1000DE8A and returned 0x76DDFB66.
GetProcAddress(0x769D0000 [KERNEL32.DLL], "EncodePointer") called from "MYCLASS.DLL" at address 0x1000DE8A and returned 0x76DDFB66.
GetProcAddress(0x769D0000 [KERNEL32.DLL], "EncodePointer") called from "MYCLASS.DLL" at address 0x1000DE8A and returned 0x76DDFB66.
GetProcAddress(0x769D0000 [KERNEL32.DLL], "EncodePointer") called from "MYCLASS.DLL" at address 0x1000DE8A and returned 0x76DDFB66.
GetProcAddress(0x769D0000 [KERNEL32.DLL], "EncodePointer") called from "MYCLASS.DLL" at address 0x1000DE8A and returned 0x76DDFB66.
GetProcAddress(0x769D0000 [KERNEL32.DLL], "EncodePointer") called from "MYCLASS.DLL" at address 0x1000DE8A and returned 0x76DDFB66.
GetProcAddress(0x769D0000 [KERNEL32.DLL], "EncodePointer") called from "MYCLASS.DLL" at address 0x1000DE8A and returned 0x76DDFB66.
GetProcAddress(0x769D0000 [KERNEL32.DLL], "DecodePointer") called from "MYCLASS.DLL" at address 0x1000DF05 and returned 0x76DEDB15.
GetProcAddress(0x769D0000 [KERNEL32.DLL], "DecodePointer") called from "MYCLASS.DLL" at address 0x1000DF05 and returned 0x76DEDB15.
GetProcAddress(0x769D0000 [KERNEL32.DLL], "EncodePointer") called from "MYCLASS.DLL" at address 0x1000DFD9 and returned 0x76DDFB66.
GetProcAddress(0x769D0000 [KERNEL32.DLL], "DecodePointer") called from "MYCLASS.DLL" at address 0x1000DFE9 and returned 0x76DEDB15.
GetProcAddress(0x769D0000 [KERNEL32.DLL], "IsProcessorFeaturePresent") called from "MYCLASS.DLL" at address 0x10010F34 and returned 0x769F0A06.
DllMain(0x10000000, DLL_PROCESS_ATTACH, 0x00000000) in "MYCLASS.DLL" returned 1 (0x1).
LoadLibraryA("C:/home/Rabbitus/CRAN/myRlib/MyClass/libs/MyClass.dll") returned 0x10000000.
GetProcAddress(0x769D0000 [KERNEL32.DLL], "SetDllDirectoryA") called from "R.DLL" at address 0x6C710149 and returned 0x76A61B1E.
GetProcAddress(0x10000000 [MYCLASS.DLL], "R_init_MyClass") called from "R.DLL" at address 0x6C71011B and returned NULL. Error: Die angegebene Prozedur wurde nicht gefunden (127).
GetProcAddress(0x10000000 [MYCLASS.DLL], "WriteFileC") called from "R.DLL" at address 0x6C71011B and returned 0x10007C00.

Once again Dependency Walker reports errors for “FlsAlloc”, “FlsGetValue” and “FlsSetValue” on WinXP
only but NOT on Vista. However in this case the single DLL works on both WinXP AND Vista.

From my current results it seems that at the moment it does not make sense to try to compile ROOT with
option /MT (although it may still be worthwile for other purposes).

Best regads
Christian

P.S.:
It is quite clear to me that this problem is an R problem and not a ROOT problem, but the R developers
are reluctant to help since they have abandoned VC++ long time ago.
In contrast the ROOT developers are ALWAYS very helpful, even when I am asking questions which are NOT
directly related to ROOT. I appreciate this very much!!!
MyClass_0.6.0.tar.gz (12.6 KB)
MyClassIO_0.6.0.tar.gz (221 KB)

Hi Christian

[quote=“cstrato”]In contrast, compiling both DLLs with option /MT on Vista crashes R … [/quote]Ehh. Axel knew that[quote=“Axel”]I don’t see how answers to your questions would help. Bertrand understands the issue[/quote]I’ve looked up your test suite briefly (sorry I have no time to investigate it deep enough).

There are two things:

[ul] 1) I paid my attention that you commented out “cout”. Why?
It is CRUCIAL for THIS test to use very “cout/cerr/clog” (i.e. “iostream” and “std::string” C++ classes) from BOTH of your DLLs simultaneously.

[quote=“cstrato”]Meanwhile I had time to follow Valeri’s suggestion and created a DLL “MyClass.dll” which depends on
another DLL “MyClassIOMT.dll” (I am attatching the source code for both libraries). [/quote]
2) It does not show what I wanted the example to demonstrate.
Namely, I wanted the method to “open” file (“fstream::open” to be precise ) been invoked from ONE DLL and the method to write (fstream !!! method) to that file been invoked from ANOTHER DLL. In your case, all I/O operations are provided from one single class (aka DLL). Of course, this is fine for the normal program/ design. However, to understand this /MT vs /MD you have to separate it.
3) There is no “MyClassA” class method that is invoked from “MyClassIO”. i.e. DLL2 calls no function from DLL1.

It is crucial. [/ul]Can you make one step further, change the test suite and re-run it under Windows XP (no reason to run it under Vista)?
I’ll be able to follow this thread on next weekend only. Sorry.

Dear Valeri,

I must admit that I do not understand what you mean. Nevertheless, I am attaching the updated code for both DLLs.

When compiling both DLLs with option /MT on Windows XP, everything is ok and I get the following output from DependencyWalker:

Loaded "MYCLASS.DLL" at address 0x10000000.  Successfully hooked module.
Loaded "LIBMYCLASSIOMT.DLL" at address 0x02A40000.  Successfully hooked module.
DllMain(0x02A40000, DLL_PROCESS_ATTACH, 0x00000000) in "LIBMYCLASSIOMT.DLL" called.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "FlsAlloc") called from "LIBMYCLASSIOMT.DLL" at address 0x02A4E1F8 and returned NULL. Error: Die angegebene Prozedur wurde nicht gefunden (127).
GetProcAddress(0x7C800000 [KERNEL32.DLL], "FlsGetValue") called from "LIBMYCLASSIOMT.DLL" at address 0x02A4E205 and returned NULL. Error: Die angegebene Prozedur wurde nicht gefunden (127).
GetProcAddress(0x7C800000 [KERNEL32.DLL], "FlsSetValue") called from "LIBMYCLASSIOMT.DLL" at address 0x02A4E212 and returned NULL. Error: Die angegebene Prozedur wurde nicht gefunden (127).
GetProcAddress(0x7C800000 [KERNEL32.DLL], "FlsFree") called from "LIBMYCLASSIOMT.DLL" at address 0x02A4E21F and returned NULL. Error: Die angegebene Prozedur wurde nicht gefunden (127).
GetProcAddress(0x7C800000 [KERNEL32.DLL], "EncodePointer") called from "LIBMYCLASSIOMT.DLL" at address 0x02A4DDA7 and returned 0x7C923917.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "EncodePointer") called from "LIBMYCLASSIOMT.DLL" at address 0x02A4DDA7 and returned 0x7C923917.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "EncodePointer") called from "LIBMYCLASSIOMT.DLL" at address 0x02A4DDA7 and returned 0x7C923917.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "EncodePointer") called from "LIBMYCLASSIOMT.DLL" at address 0x02A4DDA7 and returned 0x7C923917.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "EncodePointer") called from "LIBMYCLASSIOMT.DLL" at address 0x02A4DDA7 and returned 0x7C923917.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "EncodePointer") called from "LIBMYCLASSIOMT.DLL" at address 0x02A4DDA7 and returned 0x7C923917.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "EncodePointer") called from "LIBMYCLASSIOMT.DLL" at address 0x02A4DDA7 and returned 0x7C923917.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "DecodePointer") called from "LIBMYCLASSIOMT.DLL" at address 0x02A4DE22 and returned 0x7C92393D.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "DecodePointer") called from "LIBMYCLASSIOMT.DLL" at address 0x02A4DE22 and returned 0x7C92393D.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "EncodePointer") called from "LIBMYCLASSIOMT.DLL" at address 0x02A4DEF6 and returned 0x7C923917.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "DecodePointer") called from "LIBMYCLASSIOMT.DLL" at address 0x02A4DF06 and returned 0x7C92393D.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "IsProcessorFeaturePresent") called from "LIBMYCLASSIOMT.DLL" at address 0x02A4FA6F and returned 0x7C80ACB2.
DllMain(0x02A40000, DLL_PROCESS_ATTACH, 0x00000000) in "LIBMYCLASSIOMT.DLL" returned 1 (0x1).
DllMain(0x10000000, DLL_PROCESS_ATTACH, 0x00000000) in "MYCLASS.DLL" called.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "FlsAlloc") called from "MYCLASS.DLL" at address 0x1000D558 and returned NULL. Error: Die angegebene Prozedur wurde nicht gefunden (127).
GetProcAddress(0x7C800000 [KERNEL32.DLL], "FlsGetValue") called from "MYCLASS.DLL" at address 0x1000D565 and returned NULL. Error: Die angegebene Prozedur wurde nicht gefunden (127).
GetProcAddress(0x7C800000 [KERNEL32.DLL], "FlsSetValue") called from "MYCLASS.DLL" at address 0x1000D572 and returned NULL. Error: Die angegebene Prozedur wurde nicht gefunden (127).
GetProcAddress(0x7C800000 [KERNEL32.DLL], "FlsFree") called from "MYCLASS.DLL" at address 0x1000D57F and returned NULL. Error: Die angegebene Prozedur wurde nicht gefunden (127).
GetProcAddress(0x7C800000 [KERNEL32.DLL], "EncodePointer") called from "MYCLASS.DLL" at address 0x1000D107 and returned 0x7C923917.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "EncodePointer") called from "MYCLASS.DLL" at address 0x1000D107 and returned 0x7C923917.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "EncodePointer") called from "MYCLASS.DLL" at address 0x1000D107 and returned 0x7C923917.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "EncodePointer") called from "MYCLASS.DLL" at address 0x1000D107 and returned 0x7C923917.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "EncodePointer") called from "MYCLASS.DLL" at address 0x1000D107 and returned 0x7C923917.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "EncodePointer") called from "MYCLASS.DLL" at address 0x1000D107 and returned 0x7C923917.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "EncodePointer") called from "MYCLASS.DLL" at address 0x1000D107 and returned 0x7C923917.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "DecodePointer") called from "MYCLASS.DLL" at address 0x1000D182 and returned 0x7C92393D.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "DecodePointer") called from "MYCLASS.DLL" at address 0x1000D182 and returned 0x7C92393D.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "EncodePointer") called from "MYCLASS.DLL" at address 0x1000D256 and returned 0x7C923917.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "DecodePointer") called from "MYCLASS.DLL" at address 0x1000D266 and returned 0x7C92393D.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "IsProcessorFeaturePresent") called from "MYCLASS.DLL" at address 0x10012388 and returned 0x7C80ACB2.
DllMain(0x10000000, DLL_PROCESS_ATTACH, 0x00000000) in "MYCLASS.DLL" returned 1 (0x1).
LoadLibraryA("C:/home/Rabbitus/CRAN/myRlib/MyClass/libs/MyClass.dll") returned 0x10000000.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "SetDllDirectoryA") called from "R.DLL" at address 0x6C710149 and returned 0x7C85EB26.
GetProcAddress(0x10000000 [MYCLASS.DLL], "R_init_MyClass") called from "R.DLL" at address 0x6C71011B and returned NULL. Error: Die angegebene Prozedur wurde nicht gefunden (127).
GetProcAddress(0x10000000 [MYCLASS.DLL], "WriteOutFile") called from "R.DLL" at address 0x6C71011B and returned 0x100071B0.
HEAP[RTERM.EXE]: Invalid Address specified to RtlFreeHeap( 02A70000, 02A82360 )

However, when compiling both DLLs with option /MD on Windows XP, R crashes and I get the following output from DependencyWalker:

LoadLibraryA("C:/home/Rabbitus/CRAN/myRlib/MyClass/libs/MyClass.dll") called from "R.DLL" at address 0x6C7102C8.
Loaded "MYCLASS.DLL" at address 0x10000000.  Successfully hooked module.
Loaded "LIBMYCLASSIOMD.DLL" at address 0x02A40000.  Successfully hooked module.
Loaded "MSVCP90.DLL" at address 0x78480000.  Successfully hooked module.
Loaded "MSVCR90.DLL" at address 0x78520000.  Successfully hooked module.
DllMain(0x78520000, DLL_PROCESS_ATTACH, 0x00000000) in "MSVCR90.DLL" called.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "FlsAlloc") called from "MSVCR90.DLL" at address 0x78543ACC and returned NULL. Error: Die angegebene Prozedur wurde nicht gefunden (127).
GetProcAddress(0x7C800000 [KERNEL32.DLL], "FlsGetValue") called from "MSVCR90.DLL" at address 0x78543AD9 and returned NULL. Error: Die angegebene Prozedur wurde nicht gefunden (127).
GetProcAddress(0x7C800000 [KERNEL32.DLL], "FlsSetValue") called from "MSVCR90.DLL" at address 0x78543AE6 and returned NULL. Error: Die angegebene Prozedur wurde nicht gefunden (127).
GetProcAddress(0x7C800000 [KERNEL32.DLL], "FlsFree") called from "MSVCR90.DLL" at address 0x78543AF3 and returned NULL. Error: Die angegebene Prozedur wurde nicht gefunden (127).
GetProcAddress(0x7C800000 [KERNEL32.DLL], "EncodePointer") called from "MSVCR90.DLL" at address 0x785435E2 and returned 0x7C923917.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "EncodePointer") called from "MSVCR90.DLL" at address 0x785435E2 and returned 0x7C923917.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "EncodePointer") called from "MSVCR90.DLL" at address 0x785435E2 and returned 0x7C923917.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "EncodePointer") called from "MSVCR90.DLL" at address 0x785435E2 and returned 0x7C923917.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "EncodePointer") called from "MSVCR90.DLL" at address 0x785435E2 and returned 0x7C923917.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "EncodePointer") called from "MSVCR90.DLL" at address 0x785435E2 and returned 0x7C923917.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "EncodePointer") called from "MSVCR90.DLL" at address 0x785435E2 and returned 0x7C923917.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "DecodePointer") called from "MSVCR90.DLL" at address 0x78543667 and returned 0x7C92393D.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "DecodePointer") called from "MSVCR90.DLL" at address 0x78543667 and returned 0x7C92393D.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "EncodePointer") called from "MSVCR90.DLL" at address 0x7854379B and returned 0x7C923917.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "DecodePointer") called from "MSVCR90.DLL" at address 0x785437AB and returned 0x7C92393D.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "IsProcessorFeaturePresent") called from "MSVCR90.DLL" at address 0x785A34FB and returned 0x7C80ACB2.
GetProcAddress(0x7C800000 [KERNEL32.DLL], "FindActCtxSectionStringW") called from "MSVCR90.DLL" at address 0x78542822 and returned 0x7C823537.
LoadLibraryA("USER32.DLL") called from "MSVCR90.DLL" at address 0x7858D616.
LoadLibraryA("USER32.DLL") returned 0x77D10000.
GetProcAddress(0x77D10000 [USER32.DLL], "MessageBoxA") called from "MSVCR90.DLL" at address 0x7858D62E and returned 0x77D5050B.
GetProcAddress(0x77D10000 [USER32.DLL], "GetActiveWindow") called from "MSVCR90.DLL" at address 0x7858D64B and returned 0x77D1DF1E.
GetProcAddress(0x77D10000 [USER32.DLL], "GetLastActivePopup") called from "MSVCR90.DLL" at address 0x7858D660 and returned 0x77D34E3E.
GetProcAddress(0x77D10000 [USER32.DLL], "GetUserObjectInformationA") called from "MSVCR90.DLL" at address 0x7858D675 and returned 0x77D35656.
GetProcAddress(0x77D10000 [USER32.DLL], "GetProcessWindowStation") called from "MSVCR90.DLL" at address 0x7858D68D and returned 0x77D19172.
LoadLibraryA("UxTheme.dll") called from "COMCTL32.DLL" at address 0x773A3F9F.
LoadLibraryA("UxTheme.dll") returned 0x5B0F0000.
GetProcAddress(0x5B0F0000 [UXTHEME.DLL], "EnableThemeDialogTexture") called from "COMCTL32.DLL" at address 0x773A4000 and returned 0x5B0FC5AF.
GetProcAddress(0x5B0F0000 [UXTHEME.DLL], "OpenThemeData") called from "COMCTL32.DLL" at address 0x773A4000 and returned 0x5B0F7CB8.
GetProcAddress(0x5B0F0000 [UXTHEME.DLL], "IsThemeBackgroundPartiallyTransparent") called from "COMCTL32.DLL" at address 0x773A4000 and returned 0x5B10DAAF.
GetProcAddress(0x5B0F0000 [UXTHEME.DLL], "DrawThemeParentBackground") called from "COMCTL32.DLL" at address 0x773A4000 and returned 0x5B10DB3A.
GetProcAddress(0x5B0F0000 [UXTHEME.DLL], "DrawThemeBackground") called from "COMCTL32.DLL" at address 0x773A4000 and returned 0x5B0F2C28.
GetProcAddress(0x5B0F0000 [UXTHEME.DLL], "GetThemeBackgroundContentRect") called from "COMCTL32.DLL" at address 0x773A4000 and returned 0x5B0F3F9F.
GetProcAddress(0x5B0F0000 [UXTHEME.DLL], "DrawThemeText") called from "COMCTL32.DLL" at address 0x773A4000 and returned 0x5B0F3031.
GetProcAddress(0x7C910000 [NTDLL.DLL], "RtlDllShutdownInProgress") called from "MSCTF.DLL" at address 0x746DEE00 and returned 0x7C937F10.
GetProcAddress(0x5B0F0000 [UXTHEME.DLL], "HitTestThemeBackground") called from "COMCTL32.DLL" at address 0x773A4000 and returned 0x5B0FD7CB.
GetProcAddress(0x5B0F0000 [UXTHEME.DLL], "CloseThemeData") called from "COMCTL32.DLL" at address 0x773A4000 and returned 0x5B0F4940.
DllMain(0x78520000, DLL_PROCESS_ATTACH, 0x00000000) in "MSVCR90.DLL" returned 0 (0x0).
DllMain(0x78520000, DLL_PROCESS_DETACH, 0x00000000) in "MSVCR90.DLL" called.
DllMain(0x78520000, DLL_PROCESS_DETACH, 0x00000000) in "MSVCR90.DLL" returned 0 (0x0).
Unloaded "MYCLASS.DLL" at address 0x10000000.
Unloaded "LIBMYCLASSIOMD.DLL" at address 0x02A40000.
Unloaded "MSVCP90.DLL" at address 0x78480000.
Unloaded "MSVCR90.DLL" at address 0x78520000.
LoadLibraryA("C:/home/Rabbitus/CRAN/myRlib/MyClass/libs/MyClass.dll") returned NULL. Error: Eine DLL-Initialisierungsroutine ist fehlgeschlagen (1114).
GetProcAddress(0x7C800000 [KERNEL32.DLL], "SetDllDirectoryA") called from "R.DLL" at address 0x6C710149 and returned 0x7C85EB26.

It is still not clear to me why compiling/linking with option /MD causes R to crash.

Best regards
Christian
MyClass_0.6.1.tar.gz (11.8 KB)
MyClassIO_0.6.1.tar.gz (98.3 KB)

It is strange, why “DependencyWalker” does not show you how RTERM.exe starts.
Is there any output that you did not attach?

What about the error,
msdn.microsoft.com/en-us/library/ms683146(VS.85.aspx :

[quote]Requirements
Minimum supported client Windows Vista [/quote]

Dear Valeri,

To keep the output short I did only inlcude the part loading my libraries.
Now I am attaching files for WinXP and Vista showing the complete output of Dependency Walker.

Best regards
Christian
Dependency_WinXP_MT.txt (35.8 KB)
Dependency_WinXP_MD.txt (31.3 KB)
Dependency_Vista_MT.txt (32.3 KB)
Dependency_Vista_MD.txt (35.3 KB)

Ohh! :open_mouth: It seems to me you forgot to tell us that you used the DIFFERENT versions of “R” under Windows XP and Vista, don’t you ?

Anyway, your logs have provided a clear proof that the advice
root.cern.ch/phpBB2/viewtopic.ph … ght=#39689
and assessment:
root.cern.ch/phpBB2/viewtopic.ph … ght=#39914

[quote=“fine”]the Rterm.exe loads some correct CRT at startup time. That “CRT” is not compatible with the DLL you linked your custom DLL with. [/quote]were correct. (Yes, I know Axel knew that too, for sure )
See yourself:

[code] grep Loaded Dependency_Vista_MT.txt > Dependency_Vista_MT.txt.loaded grep Loaded Dependency_Vista_MD.txt > Dependency_Vista_MD.txt.loaded

$ diff Dependency_Vista_MT.txt.loaded Dependency_Vista_MD.txt.loaded
31c31,33
< Loaded “LIBMYCLASSIOMT.DLL” at address 0x02300000. Successfully hooked module.

Loaded “LIBMYCLASSIOMD.DLL” at address 0x022E0000. Successfully hooked module.
Loaded “MSVCP90.DLL” at address 0x73300000. Successfully hooked module.
Loaded “MSVCR90.DLL” at address 0x73250000. Successfully hooked module.[/code]

[code] grep Loaded Dependency_WinXP_MD.txt > Dependency_WinXP_MD.txt.loaded grep Loaded Dependency_WinXP_MT.txt > Dependency_WinXP_MT.txt.loaded

$ diff Dependency_WinXP_MT.txt.loaded Dependency_WinXP_MD.txt.loaded
26c26,28
< Loaded “LIBMYCLASSIOMT.DLL” at address 0x02A40000. Successfully hooked module.

Loaded “LIBMYCLASSIOMD.DLL” at address 0x02A40000. Successfully hooked module.
Loaded “MSVCP90.DLL” at address 0x78480000. Successfully hooked module.
Loaded “MSVCR90.DLL” at address 0x78520000. Successfully hooked module.[/code]

[code]$ grep -n VC *.txt | grep Loaded
Dependency_Vista_MD.txt:30:Loaded “MSVCRT.DLL” at address 0x75E70000. Successfully hooked module.
Dependency_Vista_MD.txt:278:Loaded “MSVCP90.DLL” at address 0x73300000. Successfully hooked module.
Dependency_Vista_MD.txt:279:Loaded “MSVCR90.DLL” at address 0x73250000. Successfully hooked module.

Dependency_Vista_MT.txt:30:Loaded “MSVCRT.DLL” at address 0x75E70000. Successfully hooked module.

Dependency_WinXP_MD.txt:33:Loaded “MSVCRT.DLL” at address 0x77BE0000. Successfully hooked module.
Dependency_WinXP_MD.txt:252:Loaded “MSVCP90.DLL” at address 0x78480000. Successfully hooked module.
Dependency_WinXP_MD.txt:253:Loaded “MSVCR90.DLL” at address 0x78520000. Successfully hooked module.

Dependency_WinXP_MT.txt:33:Loaded “MSVCRT.DLL” at address 0x77BE0000. Successfully hooked module.[/code]
where “MSVCRT.DLL” and “MSVCR90.DLL/MSVCP90.DLL” are mutually exclusive DLLs and it should not be loaded into one and the same application. “/MT” does not change that. (re-read my posts) “/MT” just to include the copy of the “MSVCR90/MSVCP90” into your DLL (i.e. it merely hides the problem). To see the difference start root.exe under “Dependency walker” (Axel made it correctly, he knows the issue very well )
(Please, do not ask me to investigate why it did work under XP. Use Google instead. I had answered that question too, read back my posts ) Pay your attention that only one of your DLL is loaded dynamically. I.e. your example did not reproduce the “real life ROOT condition” yet, . . . but it doesn’t matter now.

Dear Valeri,

You are right I forgot the combination of compiling DLL MyClass with /MT while using MyClassIOMD. Thus I am now attaching the
output of Dependency Walker for this combination, see “DependencyWinXP_MyClass061_MT_MyClassIOMD.txt”. As you can see from
the output this combination does NOT work, which lets me indeed wonder what is so special with ROOT that this combination
does work with ROOT!?

Since I have now also installed Windows 7 I am also attaching the output of Windows 7 for all three combinations.

Best regards
Christian
DependencyWinXP_MyClass061_MT_MyClassIOMD.txt (35.9 KB)
DependencyWin7_MyClass_MT_MyClassIOMT.txt (50.4 KB)
DependencyWin7_MyClass_MT_MyClassIOMD.txt (37 KB)
DependencyWin7_MyClass_MD_MyClassIOMD.txt (37 KB)

:open_mouth: Why did you send this? I thought the issue had been made clear.
It is well described by Microsoft:
msdn.microsoft.com/en-us/library/ms235265.aspx
msdn.microsoft.com/en-us/library/8kche8ah.aspx
msdn.microsoft.com/en-us/library/abx4dbyh.aspx

Have you tried ROOT Builder?
rootbuilder.codeplex.com/

I tried it on the latest trunk, and it almost built everything completely. There were few errors, but it saved a lot of time.

Hi thatalias

Please note that I could compile root from source, however I want to compile it with option /MT and this is not supported in rootbuilder.

Regards
Christian

:imp: You was explained 30 days ago on Oct 15, 2009 root.cern.ch/phpBB2/viewtopic.ph … ght=#39613

[quote=“fine”]"you actually need the SAME system DLLs too. I.e. you need the same version of the MS VC DLL "[/quote]To achieve this :exclamation: NO COMPILATION :exclamation: is required. You have to force your R.exe to load the standard Visual C++ run-time library.
Had you tried that? Did it help? See “http://msdn.microsoft.com/en-us/library/3tz4da4a(VS.80).aspx” also. I believe you can fix “R.exe” CRT depedency yourself. You were given the links.

Dear Valeri,

I really appreciate your comments, however I must admit that I have no idea what you mean:
Do you want me to create a manifest to force R.exe to use MSVCR90.DLL instead of MSVCRT.DLL?
Do you want me to remove the default libraries from the list of libraries which R.exe searches when resolving external references?
Do you want me to create a side-by-side assembly (whatever that means)?

First, please note that I have never programmed on Windows and have never used Visual Studio since I do all programming on my Mac, so I have
no idea how to use Windows-specific features such as creating a manifest or doing side-by-side assembly! Thus giving me the links does not
help me. Futhermore, usually I can check other people’s source code to see how they have solved a problem, but there seem not to be any examples
that show me how to do these kind of things.

Second, both ROOT and R have been mainly developed on Linux and converted to Windows, however while ROOT uses VC++ the R developers have
created their own environment “Rtools” (based on MinGW) to port R to Windows. Moreover, in contrast to ROOT there exist now more than thousand
add-on packages for R which were developed by independent developers like me and which R users can download from e.g.:
cran.r-project.org/ (click on “Packages”)
bioconductor.org/packages/re … tware.html

While ROOT users will usually only load their on libraries when starting a new ROOT session, R users usually load many R-packages when starting
a new R-session, and many packages load other packages on which they depend.

Many of these R-packages contain also source code written in C, which is usually compiled with “Rtools”, too. Windows users download not only
the binary version of R but also pre-compiled binaries of different R-packages. Thus trying to “fix” R.exe will most probably break a lot of
code so that R-packages will no longer work. At least this is my understanding.

Best regards
Christian

[quote=“cstrato”]… Do you want me … [/quote]No, I do not want you :confused:

[quote=“cstrato”]… to force R.exe to use MSVCR90.DLL instead of MSVCRT.DLL?[/quote]It is what I have been speaking about for month. It should remove a source of your troubles. I can not say “the last one”, just “one” :unamused:

It requires no re-compilation with the option /MT you want us to apply.

I have no idea why did you write here the R accolades . How can that help?

Sorry, I can not give an example of fixing “R”. l have no idea what it is :blush: .