Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ATL library :warning LNK4254 and LNK4078

I am making a project using Visual C++ 2010 under Windows 7. I need to use ATL library, in fact I installed Windows WDK (version 7600.16385.1) In particular I using the following libraries from WDK

  • setupapi.lib
  • atls.lib
  • atlsd.lib
  • atl.lib
  • atlthunk.lib

Compiling my code I have the following warnings:

atls.lib(stdafx.obj) : warning LNK4254: section 'ATL' (50000040) merged into '.rdata' (40000040) with different attributes

atls.lib(stdafx.obj) : warning LNK4078: multiple 'ATL' sections found with different attributes (40301040)

Does anyone know how to fix it? I am worried of possible memory leaks or having some problem to access my data. Thanks

like image 377
Giorgio Avatar asked Mar 04 '12 22:03

Giorgio


1 Answers

I had the same warnings with Visual Studio 2010 Express Edition and the ATL taken from WDK 7.1. It seems that the atl libs were built with different options than your project takes from atlbase.h. I changed the settings in atlbase.h

#pragma section("ATL$__a", read, shared) => #pragma section("ATL$__a", read)
#pragma section("ATL$__z", read, shared) => #pragma section("ATL$__z", read)
#pragma section("ATL$__m", read, shared) => #pragma section("ATL$__m", read)

and the warnings were gone.

like image 105
Oliver Avatar answered Nov 09 '22 14:11

Oliver