How to resolve "inconsistent dll linkage"

2,110 views
Skip to first unread message

Ryan Hamilton

unread,
Mar 20, 2015, 10:51:21 PM3/20/15
to chromium-dev
Howdy Folks,

I'm trying to land https://codereview.chromium.org/1017973002, in which I'm attempting to add some tests of some classes that I recently landed in a different CL. Those classes were part of a new target I created in net.gyp. It builds fine for me locally on Linux and fine for a colleague on Windows. It seems to build fine on some of the win bots, but fails on the DBG win bots with errors like:

FAILED: ninja -t msvc -e environment.x86 -- E:\b\build\goma/gomacc "E:\b\depot_tools\win_toolchain\vs2013_files\VC\bin\amd64_x86\cl.exe" /nologo /showIncludes /FC @obj\net\tools\quic\simple_quic_tools.quic_simple_client.obj.rsp /c ..\..\net\tools\quic\quic_simple_client.cc /Foobj\net\tools\quic\simple_quic_tools.quic_simple_client.obj /Fdobj\net\simple_quic_tools.cc.pdb 
e:\b\build\slave\win\build\src\net\tools\quic\quic_simple_client.cc(28) : error C2220: warning treated as error - no 'object' file generated
e:\b\build\slave\win\build\src\net\tools\quic\quic_simple_client.cc(28) : warning C4273: 'net::tools::QuicSimpleClient::QuicSimpleClient' : inconsistent dll linkage
        e:\b\build\slave\win\build\src\net\tools\quic\quic_simple_client.h(58) : see previous definition of '{ctor}'

My first guess was that this was related to it being a component build and needing to EXPORT the various classes, but that doesn't seem to be the case. The target these classes are defined in are marked as:

      'type': 'static_library',

I thought that might be a problem for a debug/component build but I see other similar targets so I'm not sure that's the problem. Anyway, I would really appreciate some help. I have no idea what I'm doing wrong here :(

Cheers,

Ryan

Brett Wilson

unread,
Mar 20, 2015, 10:57:54 PM3/20/15
to r...@chromium.org, chromium-dev
The debug bots are doing a component build. Basically this error means the value of the FOO_EXPORT macro for this class/function isn't consistent, which in turn means that the FOO_IMPLEMENTATION macro for that module isn't being set properly for this code.

Brett

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev

Ryan Hamilton

unread,
Mar 20, 2015, 11:50:02 PM3/20/15
to Brett Wilson, chromium-dev
​​Wow. I thought I understood EXPORT but somehow I totally missed the IMPLEMENTATION stuff. In this case, the solution appears to be to *remove* the EXPORT tag from these classes. It seems to be working.

Thank you so much! I would not have figured this out by myself!
Reply all
Reply to author
Forward
0 new messages