I have four files which are developed for the user code of Star-ccm+: main.cpp, uclib.cpp, uclib.h, UserFunctions.lib The header file is included in the .cpp files. Now, I must link these files together to create a .so file. I tried the following code but it's useful just for the creation of a .so file out of a .cpp file, not linking different files together: g++ -fPIC -shared *.cpp -o libuser.so Please let me know how can I do that?
Asked
Active
Viewed 294 times
2
-
1`.lib` files are typically used by vc++ toolchain and can only be used on Windows. – user7860670 Jul 08 '22 at 11:20
-
Thanks for your comment. So, you mean I have to change it to .a? Do you have any idea how? – Mehdi Shokrnia Jul 08 '22 at 13:10
-
You need to obtain source code for that library and build a static library using gcc toolchain – user7860670 Jul 08 '22 at 13:31