Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
XCode static library linking ld error
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="deverloper.mj" data-source="post: 751931" data-attributes="member: 72905"><p><strong>you need to add -dynamiclib flag</strong></p><p></p><p>To fix the error, add the "-dynamiclib" flag. </p><p>Something like: gcc -dynamiclib *.c -o libmylibname.dylib</p><p>You can find more at:</p><p><http://developer.apple.com/documentation/DeveloperTools/Conceptual/DynamicLibraries/Articles/CreatingDynamicLibraries.html#//apple_ref/doc/uid/TP40002073></p><p></p><p>or for me it works like this.</p><p></p><p> g++ -dynamiclib -undefined dynamic_lookup -single_module -o libBlah.dylib *.o</p></blockquote><p></p>
[QUOTE="deverloper.mj, post: 751931, member: 72905"] [b]you need to add -dynamiclib flag[/b] To fix the error, add the "-dynamiclib" flag. Something like: gcc -dynamiclib *.c -o libmylibname.dylib You can find more at: <http://developer.apple.com/documentation/DeveloperTools/Conceptual/DynamicLibraries/Articles/CreatingDynamicLibraries.html#//apple_ref/doc/uid/TP40002073> or for me it works like this. g++ -dynamiclib -undefined dynamic_lookup -single_module -o libBlah.dylib *.o [/QUOTE]
Verification
Post reply
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
XCode static library linking ld error
Top