macdown icon indicating copy to clipboard operation
macdown copied to clipboard

Build error: library not found for -lGBCli

Open syssec-laboratory opened this issue 6 years ago • 3 comments

Hi,

Thanks for the wonderful project.

I am a novice in macosx programming. I was following your instructions to build macdown and came across the following error.

ld: warning: directory not found for option '-L/Users/XXXX/Library/Developer/Xcode/DerivedData/MacDown-eqwszngivaluxugduwftzfyizdtk/Build/Products/Debug/GBCli'
ld: library not found for -lGBCli
clang: error: linker command failed with exit code 1 (use -v to see invocation)

There was no error during the setup as follows. So I am curious what should I try to get it built. I appreciate any guidance in advance. Thank you.

$ bundle exec pod install
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/universal-darwin18/rbconfig.rb:215: warning: Insecure world writable dir /Users/XXXX/.local in PATH, mode 040777
Analyzing dependencies
Downloading dependencies
Using GBCli (1.1)
Using JJPluralForm (2.1)
Using LibYAML (0.1.4)
Using M13OrderedDictionary (1.1.0)
Using MASPreferences (1.3)
Using PAPreferences (0.5)
Using Sparkle (1.18.1)
Using handlebars-objc (1.4.5)
Using hoedown (3.0.7)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There are 9 dependencies from the Podfile and 9 total pods installed.

If you need any more info, I will provide it.

syssec-laboratory avatar Dec 06 '19 13:12 syssec-laboratory

I'm seeing the same issue with Xcode 11.3.1 on macOS 10.15.3.  I'm also seeing the similar error “ld: library not found for -lJJPluralForm”.

It's really strange because “GBCli (1.1)” is listed in the Podfile.lock, the Pods/GBCli/ dir exists with all the expected stuff in it, and GBCli is listed in Pods-macdown-cmd.debug.xcconfig— it looks like everything is setup correctly for CocoaPods, but CocoaPods just isn't doing its job.

I'm not that familiar with CocoaPods anymore— I gave up on it years ago because it frequently broke for obtuse reasons, whereas the small additional up-front time it takes to set up Carthage or just standard embedded xcodeprojs has paid for itself over and over and basically never failed on me.  But if I want to build and do some work on MacDown, I guess I'll have to take the plunge into CocoaPods internals to figure out WTF it isn't working.

capnslipp avatar Apr 20 '20 05:04 capnslipp

I fixed the build by:

  1. Opening macdown/Pods/Pods.xcodeproj.
  2. Opening the Manage Schemes… pane and Show-ing all three “Pods-…” schemes.
  3. Switching to each “Pods-…” scheme and running Build.
  4. Right-clicking on the built libPods-MacDown.a in Xcode and choosing Show in Finder to reveal the macdown/Debug/Build/ dir.
  5. Copying all those files into the build products dir for MacDown (…/DerivedData/MacDown-«random-string»/Build/Products/Debug/).
  6. Running Build in the macdown project as normal.

I don't know why CocoaPods isn't doing this for me, and I don't care because (as stated above) I absolutely hate CocoaPods— this isn't an isolated bug, this is just one of dozens of times CocoaPods has done something weird for me and there's no fix other than fixing it by hand and waiting for a new version of CocoaPods to come out.

capnslipp avatar Apr 20 '20 06:04 capnslipp

I know this is a few years old, but want to say that I had this happen to me today. Gatekeeper and corporate policy blocked my ability to download the prebuilt app because it was unsigned, and when I tried building it for myself I ran into this error today. Using XCode 15.3, MacOS 14.5 --- I actually had to copy all the *.a files to the /DerivedData/MacDown-«random-string»/Build/Products/Debug/ folder from all the build/Debug/... folder.

Thank you for this workaround @capnslipp .

RyanMagnusson avatar Aug 09 '24 16:08 RyanMagnusson