I have a window project in C# VS2005 and using P/Invoke to import a dll file from the API c/c++ and have this error message: "Runtime Error R6034, An application has made an attempt to load the C runtime lib incorrectly. Please contact the application's
support team for more information" So I'm wondering does anyone knows this problem is and how do you solve it? Thanks
Without knowing more about the DLL and entry point it is hard to give more assistance, other than the general: this could be a conflict between the C runtime loaded by .NET and that loaded by your target DLL.
Richard
Marked as answer by Figo Fei - MSFT on Apr 08, 2008 08:17 AM
At first, I thought this could be the manifest problem, So I asked the person to re-modified the program and re-built it with the manifest dll, but still I couldn't import or load the dll into my c# project and call one of the function in the dll. I tested
the program itself and it works fine but when I imported it into my c# project and it fails because of Runtime Error R6034, An application has made an attempt to load the C runtime lib incorrectly
SergeyK's comment - in your case it is not clear what is going on, but I share my experience with solving that problem...
Microsoft's recommendation is very confusing. That is, it recommends to include a manifest file and to re-compile the project.
I recently had a problem with 'R6034' error message even with a manifest file already included!
In my case, Visual Studio 2005 compiles and builds a DEBUG-configuration of some DLL. But, as soon as I try to start an application that uses that DLL the loader can't load the DLL and displays an error message with error code 'R6034'.
It happened because two Run-Time DLLs were referenced in my DLL by some reason! As soon as I looked inside of my DLL I found two strings: 'msvcr80d.dll' and 'msvcr80.dll', and the 2nd one is the reason of that run-time problem.
In order to resolve the problem I added 'msvcrt.lib' to the list of ignored libraries for DEBUG-configuration:
boston_ma
Member
162 Points
604 Posts
Runtime Error R6034, An application has made an attempt to load the C runtime lib incorrectly
Apr 04, 2008 03:34 PM|LINK
Hello everyone,
I have a window project in C# VS2005 and using P/Invoke to import a dll file from the API c/c++ and have this error message: "Runtime Error R6034, An application has made an attempt to load the C runtime lib incorrectly. Please contact the application's support team for more information" So I'm wondering does anyone knows this problem is and how do you solve it? Thanks
rjcox
Contributor
7064 Points
1444 Posts
Re: Runtime Error R6034, An application has made an attempt to load the C runtime lib incorrectly
Apr 05, 2008 03:09 PM|LINK
That error is documented here: http://msdn2.microsoft.com/en-us/library/ms235560.aspx
Without knowing more about the DLL and entry point it is hard to give more assistance, other than the general: this could be a conflict between the C runtime loaded by .NET and that loaded by your target DLL.
boston_ma
Member
162 Points
604 Posts
Re: Runtime Error R6034, An application has made an attempt to load the C runtime lib incorrectly
Apr 08, 2008 12:36 PM|LINK
Thanks rjcox for replying,
At first, I thought this could be the manifest problem, So I asked the person to re-modified the program and re-built it with the manifest dll, but still I couldn't import or load the dll into my c# project and call one of the function in the dll. I tested the program itself and it works fine but when I imported it into my c# project and it fails because of Runtime Error R6034, An application has made an attempt to load the C runtime lib incorrectly
Sergey Kostr...
Member
2 Points
1 Post
Re: Runtime Error R6034, An application has made an attempt to load the C runtime lib incorrectly
Jul 09, 2009 05:29 PM|LINK
SergeyK's comment - in your case it is not clear what is going on, but I share my experience with solving that problem...
Microsoft's recommendation is very confusing. That is, it recommends to include a manifest file and to re-compile the project.
I recently had a problem with 'R6034' error message even with a manifest file already included!
In my case, Visual Studio 2005 compiles and builds a DEBUG-configuration of some DLL. But, as soon as I try to start an application that uses that DLL the loader can't load the DLL and displays an error message with error code 'R6034'.
It happened because two Run-Time DLLs were referenced in my DLL by some reason! As soon as I looked inside of my DLL I found two strings: 'msvcr80d.dll' and 'msvcr80.dll', and the 2nd one is the reason of that run-time problem.
In order to resolve the problem I added 'msvcrt.lib' to the list of ignored libraries for DEBUG-configuration:
[Configuration Properties] -> [Linker] -> [Input] -> 'Ignore Specific Library' - msvcrt.lib