-
Notifications
You must be signed in to change notification settings - Fork 280
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
libiconv linker errors #373
Comments
Do you happen to have iconv installed via MacPorts or another alternative version of iconv? |
Isn't it a standard library? I haven't installed it explicitly. |
It is. One common source of problems is for people who are not using the standard version. What version of OS X are you running? |
Oh, and are you using MacPorts even if you didn't install it explicitly? |
I've never used MacPorts. I'm on OS X 10.9.2. |
The way the Objective Git framework target is set up, it's linked using the linker build phase (rather than a linker flag), using libiconv.dylib as referenced in the project, which according to Xcode is coming from the 10.9 SDK. |
Also, Xcode 5.1.1. |
If you remove it from the Link Binaries With Libraries phase, and instead add |
Nope, same error. I also upgraded to 10.9.3, and tried a fresh clone (not as a submodule of my other repo). |
Also tried changing the base SDK to 10.8. |
I reinstalled Xcode in case the library was corrupted. No dice. https://trac.macports.org/ticket/38851 seemed relevant, but the solution there did not help. |
I tried making a simple project, adding a call to I noticed that the library search paths for ObjectiveGit are |
Sorry for the radio silence—this is just super weird. We've still never seen this problem, on our machines or CI. 😕 You're using Xcode 5.1, right? |
Xcode 5.1.1 as noted above. Yeah, it's pretty weird. I didn't have this problem on the other machines I've worked on. |
I'm getting the same issue building for iOS. The problem appears to be something to do with incompatible iconv versions - libgit2 is built using /opt/local/include/iconv.h (latest from macports), which contains
When linking the app project in Xcode, it uses /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/iconv.h, which contains
Not sure where the proper place to define LIBICONV_PLUG is, but adding it to iconv.h seems to allow a successful build for arm64, which wasn't working previously. However, I then get other linker errors for x86_64 (iOS simulator for newer devices), and i386, which was previously working now fails. |
Adding the following to CMakeLists.txt seems to work
The other linker errors turned out to be the difference between running script/update_libgit2_ios from Xcode and the command line. Now to see if it actually runs... |
That doesn't fix it for me. It looks like the header is being found at /opt/local/include/iconv.h, but the library is being linked from /usr/lib/libiconv.dylib, and the symbols are different. So what's the best way to ensure the correct header path? |
...and apparently /opt/local is a MacPorts thing, so I guess I'm using it after all. I don't remember installing it explicitly. |
I'm not sure if you've solved this, but I've finally been able to build successfully. Haven't tested the result yet. I noticed that the symlinks in the External folder were incorrectly pointing to "/usr/local/opt/". So, my "Other Linker Flags" for the Mac Target are as follows:
Hope this is correct and helps. Cheers, |
I had the same problem. I noticed that after launching ./script/update_libgit2 I had this line: |
Pretty old and we've recently cleaned up the libgit2 building process: #483 |
I'm synced to c2d3af2 (current master), and I've run the bootstrap script and tried cleaning, but I always get these linker errors when building the framework target:
The text was updated successfully, but these errors were encountered: