Linker warnings bei eigener static lib



  • Hab mir in VC++2005 eine eigene static lib erstellt die sich problem und ohne warnings compilieren läßt.
    Nun hab ich die lib und die zugehörige headerfile in mein eingebunden...

    #include <windows.h>
    #include <iostream>
    
    #include "VirtualDisk.h"
    #pragma comment(lib, "VirtualDisk_LIB.lib")
    using namespace std;
    
    int main()
    {
    ...
    

    und bekomme beim compilieren folgende warnings:

    ------ Rebuild All started: Project: VirtualDisk, Configuration: Release Win32 ------
    Deleting intermediate and output files for project 'VirtualDisk', configuration 'Release|Win32'
    Compiling...
    main.cpp
    Linking...
    Generating code
    Finished generating code
    VirtualDisk_LIB.lib(VirtualDisk.obj) : warning LNK4204: 'g:\Entwicklung\VC++2005\VirtualDisk\Release\vc80.pdb' is missing debugging information for referencing module; linking object as if no debug info
    Embedding manifest...
    Build log was saved at "file://g:\Entwicklung\VC++2005\VirtualDisk\Release\BuildLog.htm"
    VirtualDisk - 0 error(s), 1 warning(s)
    ------ Rebuild All started: Project: VirtualDisk, Configuration: Debug Win32 ------
    Deleting intermediate and output files for project 'VirtualDisk', configuration 'Debug|Win32'
    Compiling...
    main.cpp
    Compiling manifest to resources...
    Linking...
    VirtualDisk_LIB.lib(VirtualDisk.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
    LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/LTCG' specification
    LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
    Generating code
    Finished generating code
    VirtualDisk_LIB.lib(VirtualDisk.obj) : warning LNK4204: 'g:\Entwicklung\VC++2005\VirtualDisk\Debug\vc80.pdb' is missing debugging information for referencing module; linking object as if no debug info
    Embedding manifest...
    VirtualDisk_LIB.lib(VirtualDisk.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
    LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/LTCG' specification
    LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
    Generating code
    Finished generating code
    VirtualDisk_LIB.lib(VirtualDisk.obj) : warning LNK4204: 'g:\Entwicklung\VC++2005\VirtualDisk\Debug\vc80.pdb' is missing debugging information for referencing module; linking object as if no debug info
    Build log was saved at "file://g:\Entwicklung\VC++2005\VirtualDisk\Debug\BuildLog.htm"
    VirtualDisk - 0 error(s), 6 warning(s)
    ========== Rebuild All: 2 succeeded, 0 failed, 0 skipped ==========
    

    Die kann ich jetzt aber nich ganz deuten, weiß da jmd hilfe?



  • Hallo,

    Scheinbar ist die lib im Release-Modus kompiliert und das Hauptprogramm im Debug-Modus. Somit beschwert sich der Linker ob der fehlenden Debugsymbole. Du kannst also nicht in die Lib hinein debuggen.



  • ah, und wie kann man sagen ob man debug ver oder release ver verwenden soll, geht das mit #pragma comment(...)?



  • Das muß irgendwo in den Projektoptionen deines VC++ stecken. Wo, weiß ich auch nicht, da ich diese IDE nicht habe.



  • Im Debugmodus definiert VC die Variable _DEBUG, über das du den Modus beim Kompilieren abfragen kannst.



  • ok, danke, jetzt fällts mir wie schuppen von den augen ^^



  • Dieser Thread wurde von Moderator/in HumeSikkins aus dem Forum C++ in das Forum MFC (Visual C++) verschoben.

    Im Zweifelsfall bitte auch folgende Hinweise beachten:
    C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?

    Dieses Posting wurde automatisch erzeugt.


Anmelden zum Antworten