Re: [firebreath-dev] atlbase.h(2845): error C2338: 'CAtlDllModuleT<T>' must be used with either _WINDLL or _USRDLL defined

1,470 views
Skip to first unread message

Richard Bateman

unread,
Nov 28, 2012, 12:50:46 AM11/28/12
to firebre...@googlegroups.com

I would be very surprised if VS2012 no longer includes ATL; I'm not sure why it isn't being detected. I'll have to do some research sometime, but I'm afraid this is not a priority for me.  Others have reported getting it working. :-?

I really don't recommend you install the WDK to try to fix this problem, though; it's likely to complicate things.  If you want you can search your vs2012 install for atlbase.h and see where it is (and indeed if it is actually there).

If you can find that, you might then be able to fix the cmake code to detect it.

Richard

On Nov 27, 2012, at 1:45 PM, Jason Hunter <jhu...@servlets.com> wrote:

I'm trying to upgrade from VS2010 to VS2012.  To get the prep2012.cmd I pulled the latest codebase from GitHub.

I got the project setup OK, but at first it wouldn't compile because it was missing the ATL stuff.  I followed the instructions at http://www.firebreath.org/display/documentation/Building+with+Visual+Studio+Express which got ATL installed.

However, now compiling generates the error:

5>C:\Program Files\Microsoft Visual Studio 11.0\VC\atlmfc\include\atlbase.h(2845): error C2338: 'CAtlDllModuleT<T>' must be used with either _WINDLL or _USRDLL defined
5>          C:\Program Files\Microsoft Visual Studio 11.0\VC\atlmfc\include\atlbase.h(3298) : see reference to class template instantiation 'ATL::CAtlValidateModuleConfiguration<isDllModule,T>' being compiled
5>          with
5>          [
5>              isDllModule=true,
5>              T=CFireBreathWinModule
5>          ]
5>          c:\git\github\firebreath\firebreath\src\pluginauto\win\axmain.h(24) : see reference to class template instantiation 'ATL::CAtlDllModuleT<T>' being compiled
5>          with
5>          [
5>              T=CFireBreathWinModule
5>          ]


Any tips?


Schmoo

unread,
Nov 28, 2012, 8:35:10 AM11/28/12
to firebre...@googlegroups.com
VS2012 Update 1 was released in the last day or so.  It includes support for XP, which _may_ solve this issue.

Gordon.

Jason Hunter

unread,
Nov 29, 2012, 3:43:52 AM11/29/12
to firebre...@googlegroups.com
Thanks for the pointers...

I'll try the new VS2012 update and if that doesn't work I'll try the avenue of not installing the WDK and seeing if I can make that work.

I also thought about going back to the FB 1.6 release (not HEAD) and just copying over prep2012.cmd.  Think that'd work?

Richard Bateman

unread,
Nov 29, 2012, 9:18:15 AM11/29/12
to firebre...@googlegroups.com

Heh.  any problems you're having with 2012 on master are likely to be worse on 1.6

Richard

Richard Bateman

unread,
Nov 29, 2012, 5:18:23 PM11/29/12
to firebre...@googlegroups.com

If all you need is a new define, you can add it to the cmake config in cmake/buildsettings.cmake (there are other preproc defines there, just do the same thing)

If you can give me a patch that you confirm works I'll pull it in.

Richard

On Nov 29, 2012, at 14:33 , Chris Edwards <chris.s...@gmail.com> wrote:

I'm using the 1.7 branch of FireBreath and I see the same error in VS2012.  The VS update didn't help.  The problem does not seem to be that ATL is missing.  Rather, it's that ATL has been changed:

template <class T>
class ATL_NO_VTABLE CAtlDllModuleT : 
public CAtlModuleT<T>,
private CAtlValidateModuleConfiguration<true, T>
{
}

template<bool isDllModule, typename T>
struct CAtlValidateModuleConfiguration
{
#if !defined(_WINDLL) && !defined(_USRDLL)
static_assert(!isDllModule, "'CAtlDllModuleT<T>' must be used with either _WINDLL or _USRDLL defined");
#else
static_assert(isDllModule, "'CAtlExeModuleT<T>' must be used with neither _WINDLL nor _USRDLL defined");
#endif
};

It appears to work if you change the properties on the generated project for LVP_PluginAuto as the error is saying.  Go to Properties -> C/C++ -> Preprocessor and add _WINDLL to the Preprocessor Definitions.  Of course that's not the proper fix since it's a generated project file, but maybe that will help someone more familiar with FireBreath than me.  It at least got my project working.

I did not install the WDK, though I do get an error about that when I initially try to generate the solution file complaining that MFC is missing and I should install the WDK.  However, if I just run prep2012.cmd a second time, it succeeds.
Reply all
Reply to author
Forward
0 new messages