简体   繁体   中英

Weird Xcode linker error

I'm getting this Xcode error:

ld: warning: directory not found for option '-L/Volumes/Macintosh HD2/Users/dgd/Dropbox/Websites/iCalTools.com/CalendarFilter/iCal'
ld: warning: directory not found for option '-LFilter/TestFlightSDK3.0.0'
ld: library not found for -lTestFlight
clang: error: linker command failed with exit code 1 (use -v to see invocation)

My code is at this path:

/Volumes/Macintosh HD2/Users/dgd/Dropbox/Websites/iCalTools.com/CalendarFilter/iCal Filter

and it appears Xcode is choking on the 2nd blank for some reason and incorrectly splitting the path to TestFlight.

The really strange part is if I delete the TestFlight API and it's Library Search Paths, then add it back in, it compiles and runs fine, even though the library search paths appear to be broken at the space still:

在此处输入图片说明

Everything continues to work until I close the project and reopen it. Then I have to remove and readd TestFlight again.

(One more note, I tried to remove the blank from the directory but ran into so many more Xcode and git problems trying to rename it that I gave up and reverted back. At some point during that process I ended up with exactly the same problem with Xcode choking on the blank in "Macintosh HD2" instead)

EDIT

I emailed TestFlight support about this issue and received the response below which fixed the problem. I had tried most of these steps before except for deleting the files from disk (I did have several old copies of TestFlight on disk, but not in the project) and possibly checking the Copy Items box. I still don't know what the problem really was and consider this a workaround, so I'm not adding this as an answer. Maybe someone will be able to explain what's going on here.

Sorry for the trouble.

These errors usually come up if there are issues with the Library Search Paths. Please remove the "Filter/TestFlightSDK3.0.0" line and then do the following:

  1. Open Xcode and select all the TestFlight SDK files in your project (libTestFlight.a, TestFlight.h, TestFlight+AsyncLogging.h, TestFlight+ManualSessions.h)
  2. Delete all the selected files by choosing the move to trash option
  3. Open your project in Finder (Right click the main project folder and select show in finder)
  4. Double check for TestFlight SDK files and delete any found.
  5. Download the TestFlight SDK v3 again and extract the zip
  6. Drag and drop the contents of the SDK folder into your project. At the adding files prompt, check off the defaults (Copy items, Create groups, add target)
  7. Clean the build and attempt to create a new IPA

Try using quotation marks to separate items in the path.

$(inherited) "$(SRCROOT)" "$(SRCROOT)/../Dependencies/Frameworks"/** "$(SRCROOT)/MobileAppTracking-ios" "$(SYSTEM_APPS_DIR)/Reveal.app/Contents/SharedSupport/iOS-Libraries"

I have a project where our Framework search path looks like the above. That may help with paths that have spaces. If all else fails, can you try escaping spaces or moving your libraries to a path that does not include a space?

对于Xcode中包含空格的路径,只需在路径两边加上引号(与所有采用路径的设置相同:包括,搜索路径等)。

"/Volumes/Mac HD/Users/The Count of Tuscany/Source/My Stuff/"

I got the same type of issues with it.

Just go to Build Settings. Type "search path" in the search box provided. Then see the references for your third party library. Delete the values.

Now go to your project file menu which displays your program files. Then delete the third party libraries for which you have linker errors. Make sure to backup these, as you'll need them in next step.

Now drag the same libraries you have in other folder or backup folder into your xcode project.

Now build.

I solved the same by the above steps. It usually happens when you move your xcode project from from one user/ mac to another. Or else if the libraries are missing as per the references.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM