NMake - Lib einbinden



  • Guten Tag liebe Community,

    ich habe ein Problem die Windows SDK Library "winhttp.lib" in mein NMake Makefile einzubinden. Ich habe schon einiges probiert, jedoch ohne Erfolg. Z.B.:
    LIBS = winhttp.lib /LIBPATH:C:\Program Files\Microsoft SDKs\Windows\v7.0\Lib\x64

    Verwendet wird der VC++ x64 Kompiler.
    Leider kam ich bis jetzt noch nicht mit Makefiles in Berührung und deswegen wäre ich euch sehr dankbar!

    Hier das aktuelle Makefile:

    !include <win32.mak>
    
    all: $(OUTDIR) $(OUTDIR)\atsp32.tsp
    
    #----- If OUTDIR does not exist, then create directory
    $(OUTDIR) :
        if not exist "$(OUTDIR)/$(NULL)" mkdir $(OUTDIR)
    
    $(OUTDIR)\atsp.obj: atsp.c atsp.h
        $(cc) $(cdebug) $(cflags) $(cvarsdll) /Fo"$(OUTDIR)\\" /Fd"$(OUTDIR)\\" atsp.c
    
    $(OUTDIR)\atsp.res: atsp.rc
        $(rc) $(rcvars) -r -fo $(OUTDIR)\atsp.res atsp.rc
    
    $(OUTDIR)\atsp32.lib: $(OUTDIR)\atsp.obj atsp32.def $(OUTDIR)\atsp.res
         $(implib) -machine:$(CPU) \
         -def:atsp32.def   \
    !IF "$(CPU)" == "i386"
         $(OUTDIR)\atsp.obj \
    !ENDIF
         -out:$(OUTDIR)\atsp32.lib
    
    $(OUTDIR)\atsp32.tsp: $(OUTDIR)\atsp.obj atsp32.def $(OUTDIR)\atsp.res $(OUTDIR)\atsp32.lib
        $(link) $(linkdebug) $(dlllflags) \
        -base:0x1C000000     \
        $(OUTDIR)\atsp.obj $(OUTDIR)\atsp32.exp -out:$(OUTDIR)\atsp32.dll $(OUTDIR)\atsp.res $(guilibsdll)
        if exist $(OUTDIR)\atsp32.dll.manifest mt.exe -manifest $(OUTDIR)\atsp32.dll.manifest -outputresource:$(OUTDIR)\atsp32.dll;2
        copy $(OUTDIR)\atsp32.dll $(OUTDIR)\atsp32.tsp
    
    clean:
            $(CLEANUP)
    

    Und hier nocheinmal der Fehler, der beim Kompilieren auftritt:

    link /DEBUG /DEBUGTYPE:cv  /INCREMENTAL:NO /NOLOGO -entry:_DllMainCRTSta
    rtup -dll  -base:0x1C000000      WIN2000_X64_DEBUG\atsp.obj WIN2000_X64_DEBUG\at
    sp32.exp -out:WIN2000_X64_DEBUG\atsp32.dll WIN2000_X64_DEBUG\atsp.res kernel32.l
    ib  ws2_32.lib mswsock.lib advapi32.lib user32.lib gdi32.lib comdlg32.lib winspo
    ol.lib
    atsp.obj : error LNK2019: unresolved external symbol __imp_WinHttpCloseHandle re
    ferenced in function doPost
    atsp.obj : error LNK2019: unresolved external symbol __imp_WinHttpReadData refer
    enced in function doPost
    atsp.obj : error LNK2019: unresolved external symbol __imp_WinHttpQueryDataAvail
    able referenced in function doPost
    atsp.obj : error LNK2019: unresolved external symbol __imp_WinHttpReceiveRespons
    e referenced in function doPost
    atsp.obj : error LNK2019: unresolved external symbol __imp_WinHttpSendRequest re
    ferenced in function doPost
    atsp.obj : error LNK2019: unresolved external symbol __imp_WinHttpOpenRequest re
    ferenced in function doPost
    atsp.obj : error LNK2019: unresolved external symbol __imp_WinHttpConnect refere
    nced in function doPost
    atsp.obj : error LNK2019: unresolved external symbol __imp_WinHttpOpen reference
    d in function doPost
    WIN2000_X64_DEBUG\atsp32.dll : fatal error LNK1120: 8 unresolved externals
    NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0
    \VC\BIN\amd64\link.EXE"' : return code '0x460'
    Stop.
    

    Danke und LG,
    Dominik



  • Und was hat das direkt mit C++ zu tun? Compiler/IDE/Make-Probleme gehören ins Compilerforum.



  • Dieser Thread wurde von Moderator/in pumuckl aus dem Forum C++ (auch C++0x) in das Forum Compiler- und IDE-Forum verschoben.

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

    Dieses Posting wurde automatisch erzeugt.



  • Entweder setzt Du winhttp.lib hinter $(guilibsdll), oder Du ergänzt $(guilibsdll) um diese DLL.

    Noch einfacher ist es wenn Du diee Lib mit einem #pragma comment einfach angibst.


Log in to reply