atlbase.h

While trying to convert com projects from VC6.0, I  get:

LINK : fatal error LNK1104: cannot open file 'atlthunk.lib'

This is from atlbase.h . There is no way I can just comment out the #include for that, as some lucky programmer here said he did. It causes many projects to err out.

Is there any way to get around this linkage error something like "#pragma error disable: 1104)" (wild stab in the dark here)
Note that atlthunk.lib was not on my vc6 system, and apparently on anyone elses either. Short of modifying atlbase.h, I don't know what to do, unless maybe create a dummy lib and rename it and stick it in the lib search path.

I have 233 projects that depend on atlbase.h  

 

 



Answer this question

atlbase.h

  • Jolting

    Hi,

    You are not wrong with this! VCEE does not support ATL (and MFC).
    ATL is a sofware asset which has been developed and owned by Microsoft.
    VCEE allows us to play with pure C/C++ based programming. ATL is a class hierarchy. It's their asset!

    Hope this helps.



  • xihong

    JonSpa3, I agree, this is the cleanest solution I've seen yet for properly using ATL from the Platform SDK with Visual C++ 2005 Express.

    Ted.


  • mkincaid

    I am trying to build Samples\Multimedia\DirectShow\Capture\PlayCap

    in the Platform SDK tree, using VC Express edition,

    and I get errors regarding atlbase.h, such as:

    Yes, I have installed on my E: drive on paths with shorter names; so if I have to repartition my C: drive to make room for the default installation paths, I guess I can do that, but I hope there's a more intelligent way ...

    e:\program files\mspsdk\samples\multimedia\directshow\capture\playcap\playcap.cpp(12) : fatal error C1083: Cannot open include file: 'atlbase.h': No such file or directory

    Part of my confusion comes from the fact that I find two distinct "atlbase.h" files in my installation tree, one in ...\Include\atl, and the other at ...\src\mfc -- why are there two, and which one is right

    Lastly, something makes me think I wouldn't be asking this question, wouldn't be getting the C1083 errors, if my environment variables were right;

    I trace that back to a path problem: \MSPSDK\VCdetect.exe cannot find my VCVARS.bat file:
    E:\Program Files\MSPSDK>type h:\TEMP\VCInit.bat
    @ECHO OFF
    REM vcvars32.bat not found
    SET MSVCVer=8.0

    But it's right there, where I put it!

    E:\Program Files\MSPSDK\Samples\Multimedia\DirectShow\Capture\PlayCap>"E:\Program Files\VS2005\Common7\Tools\vsvars32.bat"
    Setting environment for using Microsoft Visual Studio 2005 x86 tools.
    But that's still not good enough:
    E:\Program Files\MSPSDK\Samples\Multimedia\DirectShow\Capture\PlayCap>nmake
    Microsoft (R) Program Maintenance Utility Version 8.00.50727.762
    Copyright (C) Microsoft Corporation. All rights reserved.
    cl -c -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -GS -D_X86_=1 -DWIN32 -D_WIN32 -W3 -D_WINNT -D_WIN32_WINNT=0x0501 -D_WIN32_IE=0x0600 -DWINVER=0x0501 -Ox -DNDEBUG -D_MT -
    MT /EHsc /Fo"XP32_RETAIL\\" /Fd"XP32_RETAIL\\" /I..\..\BaseClasses /I"\Include" playcap.cpp
    playcap.cpp
    playcap.cpp(12) : fatal error C1083: Cannot open include file: 'atlbase.h': No such file or directory
    NMAKE : fatal error U1077: '"E:\Program Files\VS2005\VC\BIN\cl.EXE"' : return code '0x2'
    Stop
    If I sound like a farmer learning to sail, it's because that's how I feel just now...
    Best hopes,

  • PareshSoft

    Like the original poster, I too am using VCE to import older VC6 solutions and get this error.  This is not an error with VC6, but something wrong with upgrading ATL projects to VCE.  Can ATL projects not be upgraded to VCE
  • Xtramalt

    YOu are using VC 6.0. This forum handles questions about Visual C++ Express. Express doesn't contain ATL so this question is of topic here.

    Try the usegroups here:
    http://msdn.microsoft.com/newsgroups/default.aspx dg=microsoft.public.vc.atl&lang=en&cr=US

    My guess is that you installation if defect. Check the original CDs for a LIB file with this name!



  • Surender Reddy

    The following worked for me, to build an existing ATL project for 32-bit Windows using 2005 C++ Express Edition and Microsoft Platform SDK:

    1. Set the following linker option in your project:

    /NODEFAULTLIB:"atlthunk"


    2. Add the following to your stdafx.c:

    namespace ATL {
    void * __stdcall __AllocStdCallThunk()
    {
    return HeapAlloc(GetProcessHeap(),
    0, sizeof(_stdcallthunk));
    }


    void __stdcall __FreeStdCallThunk(void *p)

    {
    HeapFree(GetProcessHeap(), 0, p);
    }

    }

    This duplicates the method of allocating and freeing stdcall thunks that is used for the other platforms, as shown in atlbase.h.

    This also avoids modifying atlbase.h which is a dangerous business.

    In my particular application, only one window is created for the life of the object, so efficiency or heap fragmentation is not an issue.

    Hope this helps,

    -jws


  • atlbase.h