halide

How to build a windows static library for lesson15 under windows platform?


I have successful built the LLVM and Halide with Visual studio 2019 on windows platform.
I then tried to make some no_runtime objs and a halide_runtime obj and link them together.

./lesson_15_generate \
    -g my_first_generator \
    -f my_first_generator_basic \
    -e object,c_header\
    -o . \
    target=x86-64-windows-no_runtime

    ./lesson_15_generate \
        -g my_first_generator \
        -f my_first_generator_sse41 \
        -e object,c_header\
        -o . \
        target=host-x86-64-windows-sse41-no_runtime

    ./lesson_15_generate \
        -g my_first_generator \
        -f my_first_generator_avx \
        -e object,c_header\
        -o . \
        target=host-x86-64-windows-avx-no_runtime

    ./lesson_15_generate \
        -r halide_runtime_x86 \
        -e object,c_header\
        -o . \
        target=x86-64-windows

The windows static library was linked as follows

prompt>link.exe /out:test.lib halide_runtime_x86.obj my_first_generator_basic.obj my_first_generator_sse41.obj my_first_generator_avx.obj

However, the system returned with the following error

Microsoft (R) Incremental Linker Version 14.26.28806.0
Copyright (C) Microsoft Corporation.  All rights reserved.

LINK : fatal error LNK1561: entry point must be defined

Please, shed some light on how to build a static halide library on windows platform.


Problem solved by adding /lib to link.exe

prompt>link.exe /lib /out:test.lib halide_runtime_x86.obj my_first_generator_basic.obj my_first_generator_sse41.obj my_first_generator_avx.obj


Solution

  • add /lib to link.exe

    prompt>link.exe /lib /out:test.lib halide_runtime_x86.obj my_first_generator_basic.obj my_first_generator_sse41.obj my_first_generator_avx.obj