Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LNK1104: cannot open file 'm.lib' - on 'ffi/structs' on Windows #207

Open
Voyz opened this issue Jan 14, 2024 · 0 comments
Open

LNK1104: cannot open file 'm.lib' - on 'ffi/structs' on Windows #207

Voyz opened this issue Jan 14, 2024 · 0 comments

Comments

@Voyz
Copy link

Voyz commented Jan 14, 2024

Windows does not use m.lib as its math library is included in the standard library. The CMakeLists.txt should read:

cmake_minimum_required(VERSION 3.7 FATAL_ERROR)
project(structs_library VERSION 1.0.0 LANGUAGES C)
add_library(structs_library SHARED structs.c structs.def)
if (NOT WIN32)
    target_link_libraries(structs_library PUBLIC m)
endif (NOT WIN32)
add_executable(structs_test structs.c)
if (NOT WIN32)
    target_link_libraries(structs_test PUBLIC m)
endif (NOT WIN32)

set_target_properties(structs_library PROPERTIES
    PUBLIC_HEADER structs.h
    VERSION ${PROJECT_VERSION}
    SOVERSION 1
    OUTPUT_NAME "structs"
    XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "Hex_Identity_ID_Goes_Here"
)

With m operations not running on winddows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant