473,395 Members | 1,631 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

error LNK2005: _DllMain@12 when using /clr compiler flag

When building a COM DLL project with /clr the following errors
occures:
error LNK2005: _DllMain@12 already defined in msvcrt.lib(dllmain.obj)
warning LNK4243: DLL containing objects compiled with /clr is not
linked with /NOENTRY; image may not run correctly

I already tried to solve this problem with linking order correction
(http://support.microsoft.com/default...b;en-us;148652) and
the /NOENRTY addition
(http://support.microsoft.com/default...;en-us;814472). This
only solves the warning but not the linking problem.

The COM DLL project was initially built without /clr with the .Net
compiler and everything was ok.
Nov 17 '05 #1
1 3199
What happens if you also specify /NODEFAULTLIB to the linker? It is likely
that you are including 2 versions of the runtime library.

Ronald Laeremans
Visual C++ team

"Duncan" <du*************@philips.com> wrote in message
news:24**************************@posting.google.c om...
When building a COM DLL project with /clr the following errors
occures:
error LNK2005: _DllMain@12 already defined in msvcrt.lib(dllmain.obj)
warning LNK4243: DLL containing objects compiled with /clr is not
linked with /NOENTRY; image may not run correctly

I already tried to solve this problem with linking order correction
(http://support.microsoft.com/default...b;en-us;148652) and
the /NOENRTY addition
(http://support.microsoft.com/default...;en-us;814472). This
only solves the warning but not the linking problem.

The COM DLL project was initially built without /clr with the .Net
compiler and everything was ok.

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Cui | last post by:
Hello, I make an application in ASP.NET (using VB.NET and some web services). For my needs, I use also the SQL DMO library (with the SQL DMO.interop assembly) and the Microsoft Web UI controls...
2
by: Iwer M?rck | last post by:
Hi I'm trying to get started with ASP.NET and have installed the .net framework and ran into a strange problem. The name of my PC is imxp01, and when I navigate to http://imxp01/, it works...
2
by: Spottswoode | last post by:
Hi I have developed a client/server application in C# that worked perfectly in my office but not so perfectly after deploying it to our client. A little information about the architecture first:...
2
by: =?Utf-8?B?U3VuaWwgUGFuZGl0YQ==?= | last post by:
Hi All, I have created a VB.Net application that used classic ADO to access the oracle database. I have mentained a persistant connection in it. When i start the application and it works fine....
1
by: Bombtrack | last post by:
I have some javascript code that errors in FireFox, but only when I use a DOCTYPE expression at the top of the page - until I added that, it worked fine in both IE and FireFox. Here is the...
4
by: sebastian.dau | last post by:
Hello Newsgroup, I have a link error that I did not manage to fix. I basically consume a VC 8.0 C++ dll that exports a class with a method containing CString declaration as follows: class...
2
by: sharmilah | last post by:
I have the following code in my script and it's giving a syntax error at line *** when using the password function. My password in the mysql database is encrypted using the password function itself...
1
by: Boot2TheHead | last post by:
http://msdn2.microsoft.com/en-us/library/system.reflection.assembly.reflectiononlyloadfrom.aspx When I open an assembly using Assembly.ReflectionOnlyLoadFrom it loads fine, but when I try to...
2
by: randa zaghdan | last post by:
Hi I have a problem with my program in vc 2008 When I compile it, the following errors are listed. I try to resolve it but no hope Does any one can help me ? thanks . Linking......
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.