karelia / CurlHandle

Cocoa Class wrapping libcurl
54 stars 21 forks source link

ld: framework not found CFNetwork #9

Closed ryandesign closed 11 years ago

ryandesign commented 11 years ago

curlhandle 3.1.1 fails to compile in MacPorts on OS X 10.7 Lion with Xcode 4.3.3 or on OS X 10.6 Snow Leopard with Xcode 3.2.6 with this error:

Ld build/Release/CURLHandle.framework/Versions/A/CURLHandle normal x86_64
    cd /Volumes/Data/macports/lion/var/macports/build/_Volumes_Data_macports_dports_devel_curlhandle/curlhandle/work/CurlHandle-3.1.1/CURLHandleSource
    setenv MACOSX_DEPLOYMENT_TARGET 10.7
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -dynamiclib -L/Volumes/Data/macports/lion/var/macports/build/_Volumes_Data_macports_dports_devel_curlhandle/curlhandle/work/CurlHandle-3.1.1/CURLHandleSource/build/Release -L/Volumes/Data/macports/lion/var/macports/build/_Volumes_Data_macports_dports_devel_curlhandle/curlhandle/work/CurlHandle-3.1.1/CURLHandleSource -L/Volumes/Data/macports/lion/var/macports/build/_Volumes_Data_macports_dports_devel_curlhandle/curlhandle/work/CurlHandle-3.1.1/CURLHandleSource -F/Volumes/Data/macports/lion/var/macports/build/_Volumes_Data_macports_dports_devel_curlhandle/curlhandle/work/CurlHandle-3.1.1/CURLHandleSource/build/Release -filelist /Volumes/Data/macports/lion/var/macports/build/_Volumes_Data_macports_dports_devel_curlhandle/curlhandle/work/CurlHandle-3.1.1/CURLHandleSource/build/CURLHandle.build/Release/CURLHandle.build/Objects-normal/x86_64/CURLHandle.LinkFileList -install_name "@executable_path/../Frameworks/CURLHandle.framework/Versions/A/CURLHandle" -Xlinker -rpath -Xlinker "@loader_path/Frameworks" -mmacosx-version-min=10.7 -lcurl -framework Foundation -framework CFNetwork -framework SystemConfiguration -single_module -compatibility_version 1 -current_version 1 -o /Volumes/Data/macports/lion/var/macports/build/_Volumes_Data_macports_dports_devel_curlhandle/curlhandle/work/CurlHandle-3.1.1/CURLHandleSource/build/Release/CURLHandle.framework/Versions/A/CURLHandle
ld: framework not found CFNetwork
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ryandesign commented 11 years ago

On OS X 10.8 Mountain Lion we have /System/Library/Frameworks/CFNetwork.framework but on 10.7 Lion and 10.6 Snow Leopard it's /System/Library/Frameworks/CoreServices.framework/Versions/Current/Frameworks/CFNetwork.framework. So it seems CFNetwork used to be a part of CoreServices—and it seems it can still be referenced that way. This is the patch we're now using to fix this in MacPorts:

https://trac.macports.org/browser/trunk/dports/devel/curlhandle/files/patch-CURLHandle.xcodeproj-project.pbxproj.diff?rev=103987

At least, it compiles now on Snow Leopard and Lion, and still compiles on Mountain Lion. I haven't tested whether it works though.

mikeabdullah commented 11 years ago

Ah, very good point. Can you fire up a pull request for this please?

ryandesign commented 11 years ago

I can try to learn how to do that, but it wouldn't be any different from the patch I've already posted a link to above.

mikeabdullah commented 11 years ago

I realised today there's a diff link at the bottom of the file which I've used to apply the patch. Are you happy with your name on the commit as "Ryan Design"?

ryandesign commented 11 years ago

That's fine, my handle is ryandesign most places, or you can put my name, Ryan Schmidt. I'm not concerned about attribution though, just happy the problem is now fixed.

mikeabdullah commented 11 years ago

Well git makes attribution very neat; I like seeing it there :)