MailCore / mailcore2

MailCore 2 provide a simple and asynchronous API to work with e-mail protocols IMAP, POP and SMTP. The API has been redesigned from ground up.
Other
2.6k stars 624 forks source link

Apple Mach-O Linker Warning & Error #873

Closed kjakm closed 10 years ago

kjakm commented 10 years ago

I had mailcore2 working on a project but when I upgraded to Xcode 6 it stopped working. I switched back to Xcode 5, reinstalled MailCore in the project but now I'm getting a bunch of errors.

They are all linker errors. There are over 50 but here are the first few:


ld: warning: directory not found for option '-L/Users/kieranmcgrady/iOSDevelopment/projectname/mailcore/Externals/ctemplate/lib'
ld: warning: directory not found for option '-L/Users/kieranmcgrady/iOSDevelopment/projectname/mailcore/Externals/icu4c/lib'
ld: warning: directory not found for option '-L/Users/kieranmcgrady/iOSDevelopment/projectname/mailcore/Externals/libetpan/lib'
ld: warning: directory not found for option '-L/Users/kieranmcgrady/iOSDevelopment/projectname/mailcore/libetpan/build-mac/build/Debug-iphoneos'
Undefined symbols for architecture i386:
  "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::at(unsigned long) const", referenced from:
      ctemplate::ContainsFullWord(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in libctemplate-ios.a(libctemplate_la-template_pathops.o)
  "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::find(char const*, unsigned long, unsigned long) const", referenced from:

It seems like a few folders are missing from externals. I have deleted externals several times and rebuilt but these missing folders don't seem to be downloading.

Any help appreciated.

dinhvh commented 10 years ago

Could you show the output of ./prepare.sh script in a gist?

Hoa V. Dinh

On Wednesday, September 17, 2014 at 9:03 AM, Kieran McGrady wrote:

I had mailcore2 working on a project but when I upgraded to Xcode 6 it stopped working. I switched back to Xcode 5, reinstalled MailCore in the project but now I'm getting a bunch of errors. They are all linker errors. There are over 50 but here are the first few: ld: warning: directory not found for option '-L/Users/kieranmcgrady/iOSDevelopment/projectname/mailcore/Externals/ctemplate/lib' ld: warning: directory not found for option '-L/Users/kieranmcgrady/iOSDevelopment/projectname/mailcore/Externals/icu4c/lib' ld: warning: directory not found for option '-L/Users/kieranmcgrady/iOSDevelopment/projectname/mailcore/Externals/libetpan/lib' ld: warning: directory not found for option '-L/Users/kieranmcgrady/iOSDevelopment/projectname/mailcore/libetpan/build-mac/build/Debug-iphoneos' Undefined symbols for architecture i386: "std::1::basic_string<char, std::__1::char_traits, std::1::allocator >::at(unsigned long) const", referenced from: ctemplate::ContainsFullWord(std::1::basic_string<char, std::__1::char_traits, std::1::allocator > const&, std::1::basic_string<char, std::__1::char_traits, std::1::allocator > const&) in libctemplate-ios.a(libctemplate_la-template_pathops.o) "std::1::basic_string<char, std::__1::char_traits, std::1::allocator >::find(char const*, unsigned long, unsigned long) const", referenced from:
It seems like a few folders are missing from externals. I have deleted externals several times and rebuilt but these missing folders don't seem to be downloading. Any help appreciated.

— Reply to this email directly or view it on GitHub (https://github.com/MailCore/mailcore2/issues/873).

kjakm commented 10 years ago

Thanks for getting back to me. I will post it tomorrow when I'm back in the office (can't access that system from home).

kjakm commented 10 years ago

This is the output from /.prepare.sh:

Getting prebuilt libraries...
Current branch master is up to date.
building file list ... done

sent 355 bytes  received 20 bytes  750.00 bytes/sec
total size is 36800373  speedup is 98134.33
~/iOSDevelopment/projectname/mailcore/scripts
install from cache
Current branch master is up to date.
install from cache
Current branch master is up to date.
install from cache

I also deleted the externals folder and ran it a second time. This time building libetpan failed with the following error:

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

Finally, to fix the above error, I changed the directory xcode-select was pointing to, deleted externals and ran ./prepare.sh again. The results were good until ctemplate:

Cloning into 'ctemplate'...
remote: Counting objects: 1974, done.
remote: Compressing objects: 100% (724/724), done.
remote: Total 1974 (delta 1208), reused 1974 (delta 1208)
Receiving objects: 100% (1974/1974), 2.40 MiB | 486.00 KiB/s, done.
Resolving deltas: 100% (1208/1208), done.
Checking connectivity... done.
install from cache
SDK not found
SDK not found
SDK not found
SDK not found
kjakm commented 10 years ago

I actually got ./prepare.sh fully working now but I'm still getting the linker errors when building the iOS project. Full output of ./perpare.sh is:

~/iOSDevelopment/projectname/mailcore/Externals/prebuilt ~/iOSDevelopment/projectname/mailcore/scripts
Getting prebuilt libraries...
Cloning into 'mailcore2-deps'...
remote: Counting objects: 13, done.
remote: Compressing objects: 100% (11/11), done.
remote: Total 13 (delta 0), reused 12 (delta 0)
Unpacking objects: 100% (13/13), done.
Checking connectivity... done.
building file list ... done
./
.gitignore
README.md
ctemplate-ccca4faf79.zip
ctemplate-ios-ccca4faf79~2.zip
icu4c-51_1~1.zip
icu4c-ios-51_1~3.zip
libetpan-51ca6bfc3c.zip
libetpan-ios-51ca6bfc3c.zip
libsasl-ios-51ca6bfc3c.zip
prebuilt.list
tidy-html5-ios-74e443dfee~1.zip

sent 36805732 bytes  received 268 bytes  73612000.00 bytes/sec
total size is 36800373  speedup is 1.00
~/iOSDevelopment/projectname/mailcore/scripts
install from cache
Cloning into 'libetpan'...
remote: Counting objects: 3043, done.
remote: Total 3043 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (3043/3043), 8.23 MiB | 99.00 KiB/s, done.
Resolving deltas: 100% (1967/1967), done.
Checking connectivity... done.
install from cache
Cloning into 'ctemplate'...
remote: Counting objects: 1974, done.
remote: Compressing objects: 100% (724/724), done.
remote: Total 1974 (delta 1208), reused 1974 (delta 1208)
Receiving objects: 100% (1974/1974), 2.40 MiB | 596.00 KiB/s, done.
Resolving deltas: 100% (1208/1208), done.
Checking connectivity... done.
install from cache
Cloning into 'tidy-html5'...
remote: Counting objects: 1411, done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 1411 (delta 4), reused 17 (delta 4)
Receiving objects: 100% (1411/1411), 1.15 MiB | 214.00 KiB/s, done.
Resolving deltas: 100% (560/560), done.
Checking connectivity... done.
install from cache
install from cache
Current branch master is up to date.
install from cache
Current branch master is up to date.
install from cache

The 4 warnings that appeared before the errors have reduced to 1 now though:

ld: warning: directory not found for option '-L/Users/kieranmcgrady/iOSDevelopment/projectname/mailcore/libetpan/build-mac/build/Debug-iphoneos'
kjakm commented 10 years ago

Ok, so I did two things which finally fixed this. I removed all library search paths that were in the project (could you confirm if these should be here, they were inserted by another developer so I'm not sure) and I removed MailCore and reinstalled it in the project. It's now working. Thanks for your help and work on the project.

dinhvh commented 10 years ago

Here's the values of library search path that are on the project.

//:configuration = Debug
LIBRARY_SEARCH_PATHS = "$(SRCROOT)/../Externals/libetpan/lib" "$(SRCROOT)/../Externals/icu4c/lib" "$(SRCROOT)/../Externals/ctemplate/lib"
LIBRARY_SEARCH_PATHS[sdk=iphonesimulator*] = $(IOS_LIBRARY_SEARCH_PATHS)
LIBRARY_SEARCH_PATHS[sdk=macosx*] = $(OSX_LIBRARY_SEARCH_PATHS)
LIBRARY_SEARCH_PATHS[sdk=iphoneos*] = $(IOS_LIBRARY_SEARCH_PATHS)

//:configuration = Release
LIBRARY_SEARCH_PATHS = "$(SRCROOT)/../Externals/libetpan/lib" "$(SRCROOT)/../Externals/icu4c/lib" "$(SRCROOT)/../Externals/ctemplate/lib"
LIBRARY_SEARCH_PATHS[sdk=iphonesimulator*] = $(IOS_LIBRARY_SEARCH_PATHS)
LIBRARY_SEARCH_PATHS[sdk=macosx*] = $(OSX_LIBRARY_SEARCH_PATHS)
LIBRARY_SEARCH_PATHS[sdk=iphoneos*] = $(IOS_LIBRARY_SEARCH_PATHS)

//:completeSettings = some
LIBRARY_SEARCH_PATHS
kjakm commented 10 years ago

Thanks!