Linking geos library

Viewed 105

I'm trying to build a simple geos_test

#include <stdio.h>
#include <geos_c.h>

int main() {
    printf("%d\n", GEOS_CAPI_VERSION);
    exit(0);
}

with /usr/local/opt/llvm/bin/clang -fopenmp -L/usr/local/Cellar/geos/3.8.1_1/lib -lgeos_c -I/usr/local/Cellar/geos/3.8.1_1/include -v geos_test.c

but in linking I get the error

"/usr/bin/ld" -demangle -lto_library /usr/local/Cellar/llvm/10.0.0_3/lib/libLTO.dylib 
-no_deduplicate -dynamic -arch x86_64 -platform_version macos 10.15.0 0.0.0 -syslibroot
 /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -o a.out 
-L/usr/local/Cellar/geos/3.8.1_1/lib -lgeos_c 
/var/folders/7m/6tm00jpj3hg13lzdcf4xg1dh0000gq/T/geos_test-d10d0b.o -lomp -lSystem 
/usr/local/Cellar/llvm/10.0.0_3/lib/clang/10.0.0/lib/darwin/libclang_rt.osx.a
ld: library not found for -lomp
clang-10: error: linker command failed with exit code 1 (use -v to see invocation)

And I don't know how to make sense of this. What library is -lomp? How can I link it?

0 Answers
Related