Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

static link issue on Macos in VSCode #3993

Closed
yifan513 opened this issue Apr 1, 2023 · 1 comment
Closed

static link issue on Macos in VSCode #3993

yifan513 opened this issue Apr 1, 2023 · 1 comment

Comments

@yifan513
Copy link

yifan513 commented Apr 1, 2023

I built the libraries on macos, and botht .a and .dylib are created. such as

ll /usr/local/lib/libPocoFoundation*                                                                                                                                                          -rwxr-xr-x  1 david  admin   2.1M Apr  1 14:56 /usr/local/lib/libPocoFoundation.92.dylib
-rwxr-xr-x  1 david  admin   2.1M Apr  1 14:56 /usr/local/lib/libPocoFoundation.92.dylib.bak
-rw-r--r--  1 david  admin   3.6M Oct 21 16:16 /usr/local/lib/libPocoFoundation.a
lrwxr-xr-x  1 david  admin    26B Oct 14 14:29 /usr/local/lib/libPocoFoundation.dylib -> libPocoFoundation.92.dylib
-rwxr-xr-x  1 david  admin   7.6M Oct 17 15:57 /usr/local/lib/libPocoFoundationd.92.dylib
-rw-r--r--  1 david  admin    29M Oct 21 16:13 /usr/local/lib/libPocoFoundationd.a
lrwxr-xr-x  1 david  admin    27B Oct 14 14:26 /usr/local/lib/libPocoFoundationd.dylib -> libPocoFoundationd.92.dylib

I tried to use the static link of the .a files, but seems in the VSCOde, it always just use the dylib, which cause distribute touble.
In my vscode json, i use

                    "-lPocoFoundation",
                    "-lcrypto",
                    "-lssl",

is good to link, but if I test a force link of .a as

                    "-l/usr/local/lib/libPocoFoundation.a",
                    "-lcrypto",
                    "-lssl",

and I will get such error

ld: library not found for -l/usr/local/lib/libPocoFoundation.a

SO, my question is, actually I set to built only static lib,
1, why I also have the .dylib files?
In the build_cmake.sh, I add

-DBUILD_SHARED_LIBS=NO 

to the command for both debug and release.

2,
How to use poco in static lib on macos?

@yifan513
Copy link
Author

yifan513 commented Apr 1, 2023

For #1, I updated the build_cmake.sh again to add the
POCO_STATIC=1
and I can see the only generated file are .a

So it is not an issue.
I will close it now.

Thanks

ld: warning: object file (/usr/local/lib/libPocoFoundation.a(inffast.c.o)) was built for newer macOS version (13.2) than being linked (12.3)
ld: warning: object file (/usr/local/lib/libPocoFoundation.a(inflate.c.o)) was built for newer macOS version (13.2) than being linked (12.3)
ld: warning: object file (/usr/local/lib/libPocoFoundation.a(inftrees.c.o)) was built for newer macOS version (13.2) than being linked (12.3)

@yifan513 yifan513 closed this as completed Apr 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant