Linking a shared library using gcc

后端 未结 2 1036
独厮守ぢ
独厮守ぢ 2021-02-03 19:32

I have a shared library (*.so) created using Real View Compiler Tools (RVCT 3.2) on windows target. Then I try to link this *.so file with my application using gcc on linux syst

相关标签:
2条回答
  • 2021-02-03 20:10

    gcc -lmyfile should be enough (provided that your library is named libmyfile.so). The linker searches for shared objects when possible and AFAIK prefers them.

    0 讨论(0)
  • 2021-02-03 20:18

    What worked for me was:

    gcc -L. -l:myfile.so
    
    0 讨论(0)
提交回复
热议问题