0

When running the make_install build for the protk_install_example for the PTC Creo TOOLKIT, I get an issue with LINK. The error is LINK : fatal error LNK1181: cannot open input file 'kernel32.lib'

Here is the full output:

Build started...
1>------ Build started: Project: make_install, Configuration: Debug x64 ------
1>
1>Microsoft (R) Program Maintenance Utility Version 14.34.31933.0
1>Copyright (C) Microsoft Corporation.  All rights reserved.
1>
1>Start at `date`
1>PROTOOL_SRC = C:/PROGRA~1/PTC/CREO80~1.0/COMMON~1/PROTOO~1
1>PROTOOL_SYS = C:/PROGRA~1/PTC/CREO80~1.0/COMMON~1/PROTOO~1/x86e_win64
1>  link /subsystem:console -out:pt_inst_test.dll /debug:none /machine:amd64 /dll @longline.list
1>Microsoft (R) Incremental Linker Version 14.34.31933.0
1>Copyright (C) Microsoft Corporation.  All rights reserved.
1>
1>TestInstall.obj TestError.obj TestRunmode.obj UtilString.obj PTApplsUnicodeUtils.obj C:/PROGRA~1/PTC/CREO80~1.0/COMMON~1/PROTOO~1/x86e_win64/obj/protk_dll_NU.lib C:/PROGRA~1/PTC/CREO80~1.0/COMMON~1/PROTOO~1/x86e_win64/obj/ucore.lib C:/PROGRA~1/PTC/CREO80~1.0/COMMON~1/PROTOO~1/x86e_win64/obj/udata.lib libcmt.lib kernel32.lib user32.lib wsock32.lib advapi32.lib mpr.lib winspool.lib netapi32.lib psapi.lib gdi32.lib shell32.lib comdlg32.lib ole32.lib ws2_32.lib
1>NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\HostX86\x64\link.EXE"' : return code '0x49d'
1>Stop.
1>LINK : fatal error LNK1181: cannot open input file 'kernel32.lib'
1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.MakeFile.Targets(45,5): error MSB3073: The command "nmake /f make_install dll" exited with code 2.
1>Done building project "make_install.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Elapsed 00:01.400 ==========

and make_install:

# -----------------------------------------------------------------------------
# File Name
MAKEFILENAME = make_install

# Machine Type
PRO_MACHINE_TYPE = x86e_win64

# Executable names
EXE = pt_inst_test.exe
EXE_DLL = pt_inst_test.dll

# Pro/Toolkit Source & Machine Loadpoint  (EXTERNAL USE - DEFAULT)
PROTOOL_SRC = C:/PROGRA~1/PTC/CREO80~1.0/COMMON~1/PROTOO~1
PROTOOL_SYS = $(PROTOOL_SRC)/$(PRO_MACHINE_TYPE)

# Pro/Toolkit Source & Machine Loadpoint  (PTC INTERNAL USE)
#PROTOOL_SRC = $(PTCSRC)/protoolkit
#PROTOOL_SYS = $(PTCSYS)

ICU_PATH = $(PROTOOL_SYS)/obj

# Include File Paths
INCS = -I. -I$(PROTOOL_SRC)/protk_appls/includes -I$(PROTOOL_SRC)/includes 

# Compiler Flags
CC = cl
MACH = -DPRO_MACHINE=36 -DPRO_OS=4
CCFLAGS = -c -GS -fp:precise -D_WSTDIO_DEFINED -D_USING_V110_SDK71_
CFLAGS = $(CCFLAGS) $(INCS) $(MACH)

# Libraries
PTCLIBS = $(PROTOOL_SYS)/obj/protoolkit_NU.lib    \
          $(ICU_PATH)/ucore.lib                   \
          $(ICU_PATH)/udata.lib 
PTCLIBS_DLL = $(PROTOOL_SYS)/obj/protk_dll_NU.lib \
          $(ICU_PATH)/ucore.lib                   \
          $(ICU_PATH)/udata.lib 
LIBS = libcmt.lib kernel32.lib user32.lib wsock32.lib advapi32.lib mpr.lib winspool.lib netapi32.lib psapi.lib gdi32.lib shell32.lib comdlg32.lib ole32.lib ws2_32.lib

# Object files
OBJS = TestInstall.obj TestError.obj TestRunmode.obj UtilString.obj PTApplsUnicodeUtils.obj


# Linker
LINK = link

$(EXE) :  $(OBJS) $(PTCLIBS)
    @echo Start at `date`
    @echo PROTOOL_SRC = $(PROTOOL_SRC)
        @echo PROTOOL_SYS = $(PROTOOL_SYS)
#Executable applications compiled using WinMain() instead of main() should set the subsystem to windows instead of console.
    $(LINK) /subsystem:console -out:$(EXE) /debug:none /machine:amd64 @<<longline.list
$(OBJS) $(PTCLIBS) $(LIBS)
<<
    
    @echo Finished at `date`
    del $(OBJS)

# Dll target
dll: $(EXE_DLL)

$(EXE_DLL) :  $(OBJS) $(PTCLIBS_DLL)
    @echo Start at `date`
    @echo PROTOOL_SRC = $(PROTOOL_SRC)
        @echo PROTOOL_SYS = $(PROTOOL_SYS)
    $(LINK) /subsystem:console -out:$(EXE_DLL) /debug:none /machine:amd64 /dll @<<longline.list
$(OBJS) $(PTCLIBS_DLL) $(LIBS)
<<

    @echo Finished at `date`
    del $(OBJS)

# object dependencies

PROTK_INST = $(PROTOOL_SRC)/protk_appls/pt_install_test/pt_install_src
PROTK_UTILS = $(PROTOOL_SRC)/protk_appls/pt_examples/pt_utils

TestInstall.obj:  $(PROTK_INST)/TestInstall.c
    $(CC) $(CFLAGS) $(PROTK_INST)/TestInstall.c

TestError.obj: $(PROTK_UTILS)/TestError.c
    $(CC) $(CFLAGS) $(PROTK_UTILS)/TestError.c

TestRunmode.obj: $(PROTK_UTILS)/TestRunmode.c
    $(CC) $(CFLAGS) $(PROTK_UTILS)/TestRunmode.c

UtilString.obj: $(PROTK_UTILS)/UtilString.c
    $(CC) $(CFLAGS) $(PROTK_UTILS)/UtilString.c

PTApplsUnicodeUtils.obj:  $(PROTK_UTILS)/PTApplsUnicodeUtils.c
    $(CC) $(CFLAGS) $(PROTK_UTILS)/PTApplsUnicodeUtils.c

clean :
    del $(OBJS)
    del $(EXE)
    nmake -f $(MAKEFILENAME)

clean_dll :
    del $(OBJS)
    del $(EXE_DLL)
    nmake -f $(MAKEFILENAME) dll

tmorgan497
  • 45
  • 4

0 Answers0