How to compile shared lib with clang on osx

后端 未结 1 701
轻奢々
轻奢々 2021-02-06 03:39

source file

rsetti::fastidio { /tmp }-> cat foo.c

    #include 
    void ACFunction() {
      printf(\"ACFunction()\\n\");
      AGoFunction()         


        
1条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-06 04:14

    By using:

    -Wl,-undefined -Wl,dynamic_lookup
    

    or

    clang -shared -undefined dynamic_lookup -o libfoo.so foo.c
    

    seems to maintain the same behaviour of GCC.

    0 讨论(0)
提交回复
热议问题