Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

Mac Static Library #13

Open
GregSlazinski opened this issue May 2, 2017 · 0 comments
Open

Mac Static Library #13

GregSlazinski opened this issue May 2, 2017 · 0 comments

Comments

@GregSlazinski
Copy link

GregSlazinski commented May 2, 2017

The provided xcode project is configured to generate a dylib file, however I'm interested in a static library.

I've tried changing the Mach-O type to "Static Library" but that didn't help, because there's still a dylib file generated.
I've tried renaming it to *.a static lib as the file was different size than before, so I thought maybe just the extension is incorrect, however after linking to it, I get undefined references.

How to compile for "Static Library"?

Edit:

I see that the "Other Linker Flags" setting is set to "build/.o", however in my case the files are generated in "Build/Intermediates/.o", but after changing the Other Linker Flags to the correct directory, there were still undefined references, because those files weren't being linked (that didn't help).
In the end I was able to fix the problem by manually drag and drop the "Build/Intermediates/*.o" files to the xcode project, as if they were C++ files (to make them listed in the project).
After that the generated static library got generated in full with all *.o files and functions linked correctly, and it works fine.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant