none
C++ compiler .exe program generates .lib and .exp files RRS feed

  • Question

  • Using the C++ compiler for Visual Studio 2008.
    I am compiling an executable program with an .exe extension. At the end of the compile I get an output message:

    Linking...
       Creating library ..\bin\AStyleWin.lib and object ..\bin\AStyleWin.exp

    The .lib and .exp file have been created in the directory with the executable. These files should be created for DLLs, not for executables. This occurs with both the Debug and Release Builds.

    Why am I getting the .lib and .exp files?

    The compiler options used:
    /Ob2 /Ot /GL /I "..\..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /EHsc /MT /Fo"Release\\" /Fd"Release\vc90.pdb" /W4 /c /TP /errorReport:prompt

    The linker options used:
    /OUT:"..\bin\AStyleWin.exe" /INCREMENTAL:NO /NOLOGO /LIBPATH:"..\lib" /MANIFEST /MANIFESTFILE:"Release\AStyleWin.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /NODEFAULTLIB:"LIBCMT" /SUBSYSTEM:WINDOWS /OPT:REF /OPT:ICF /LTCG /DYNAMICBASE:NO /ERRORREPORT:PROMPT SciLexerAS.lib AStyle.lib comctl32.lib imm32.lib  kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib

    Thanks
    jimp
    Wednesday, October 14, 2009 9:23 PM

Answers

  • You get them because you've got some function or class in your code base that has the __declspec(dllexport) declarator.  They cannot be suppressed when you do.  It is not a real problem, unless you like things tidy.

    Hans Passant.
    • Marked as answer by Wesley Yao Wednesday, October 21, 2009 2:29 AM
    Thursday, October 15, 2009 1:02 AM
    Moderator