FreeImage
FreeImage copied to clipboard
Issue using FreeImage.lib in building colmap in Windows VS2022
LNK2019 unresolved external symbol getopt referenced in function main colmap_sensor_bitmap_test C:\Users\hwenjun\Documents\GitHub\colmap_cmaked_VS2\src\colmap\sensor\FreeImage_d.lib(mkg3states.obj)
Analysing mkg3states.c shows that it uses #include "libport.h" which has int getopt(int argc, char * const argv[], const char *optstring); but the implementation is not found anywhere in the project.
How to resolve this?
Can you state the full CMake command you build the lib? According to the last successful build via GitHub Actions (GHA) your isssue can not be reproduced. Hence I wonder what is missing on either your or the GHA side? Thanks.
getopt is POSIX https://github.com/danoli3/FreeImage/blob/8268e809b0827870763444e8a8e58e0a83a733f5/Source/LibTIFF4/tif_config.h.cmake.in#L40