radarsat1 / liblo

liblo is an implementation of the Open Sound Control protocol for POSIX systems
GNU Lesser General Public License v2.1
190 stars 60 forks source link

Force static linkage while building with MSVC to fix compilation #157

Closed Rossmaxx closed 7 months ago

Rossmaxx commented 7 months ago

While building liblo v 0.32 on MSVC, I had lots of LNK 2019 errors popping up. After some investigation, I found that building everything statically fixed it, though I doubt if this is the correct way. But since this fixes the issue with building, I want to make it upstream.

Also to note, I just opened a vcpkg port update for liblo here : https://github.com/microsoft/vcpkg/pull/36836

radarsat1 commented 7 months ago

Not sure about the reasons for the linking errors, but wouldn't it be better to just set the WITH_STATIC=TRUE option when using it, instead of modifying the build script?

Rossmaxx commented 7 months ago

wouldn't it be better to just set the WITH_STATIC=TRUE option when using it, instead of modifying the build script?

It would be better but without modifying, windows builds will always fail, if the user forgets to set it.

Also, vcpkg has no option to pass arguments via the command line I think (I don't know if it has a way but haven't seen any such thing yet)

Edit : found a way to pass in the flag via the portfile to vcpkg. So this pr might be unnecessary.

Rossmaxx commented 7 months ago

So this pr is not necessary (we should make it clear in the building docs in that case). Closing.