XMPP Framework for iPhone linking Problem

1,134 views
Skip to first unread message

Tharindu Madushanka

unread,
Mar 16, 2009, 6:46:14 AM3/16/09
to XMPPFramework
Hi,
I am getting following linking issues when I am trying to compile the
source code to work with iPhone, how can I solve this, please help me.
Thankyou,
ld warning: in /Users/tharindu/Documents/XMPPiPhone/libidn/iphoneos/
libidn.a, missing required architecture arm in file
Undefined symbols:
"_stringprep_xmpp_resourceprep", referenced from:
_stringprep_xmpp_resourceprep$non_lazy_ptr in LibIDN.o
"_stringprep_nameprep", referenced from:
_stringprep_nameprep$non_lazy_ptr in LibIDN.o
"_stringprep", referenced from:
+[LibIDN prepNode:] in LibIDN.o
+[LibIDN prepDomain:] in LibIDN.o
+[LibIDN prepResource:] in LibIDN.o
"_stringprep_xmpp_nodeprep", referenced from:
_stringprep_xmpp_nodeprep$non_lazy_ptr in LibIDN.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
"_stringprep_xmpp_resourceprep", referenced from:
_stringprep_xmpp_resourceprep$non_lazy_ptr in LibIDN.o
"_stringprep_nameprep", referenced from:
_stringprep_nameprep$non_lazy_ptr in LibIDN.o
"_stringprep", referenced from:
+[LibIDN prepNode:] in LibIDN.o
+[LibIDN prepDomain:] in LibIDN.o
+[LibIDN prepResource:] in LibIDN.o
"_stringprep_xmpp_nodeprep", referenced from:
_stringprep_xmpp_nodeprep$non_lazy_ptr in LibIDN.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
Build failed (4 errors)

Robbie Hanson

unread,
Mar 16, 2009, 1:46:35 PM3/16/09
to xmppfr...@googlegroups.com
Hi Tharindu,

This message

ld warning: in /Users/tharindu/Documents/XMPPiPhone/libidn/iphoneos/
libidn.a, missing required architecture arm in file
  
indicates you're linking against the iPhone version of libidn when compiling for the simulator.

Double-check step 5 from here: http://code.google.com/p/xmppframework/wiki/iPhone

Make sure you're using "$(SRCROOT)/libidn/${PLATFORM_NAME}"

This way, when compiling for the simulator, your compiler will automatically use:
/Users/tharindu/Documents/XMPPiPhone/libidn/iphonesimulator/libidn.a

-Robbie Hanson
-Deusty Designs

Tharindu Madushanka

unread,
Mar 16, 2009, 8:56:00 PM3/16/09
to xmppfr...@googlegroups.com
Hi
Thanks, I tried to follow step 5, but i could not successfully make it, how ever in the end I have hard coded the right version when I compile for device or simulator, then it worked finally
Thanks again.
Tharindu

fonghu...@gmail.com

unread,
Apr 23, 2009, 6:52:05 AM4/23/09
to XMPPFramework
Hi, i am facing the same problem.

May you show me how u hard coded the right version?

Robbie Hanson

unread,
Apr 23, 2009, 3:17:07 PM4/23/09
to xmppfr...@googlegroups.com
Did you follow the instructions from here:
http://code.google.com/p/xmppframework/wiki/iPhone

Make sure you follow step 5 very carefully.

-Robbie Hanson
-Deusty Designs

fonghu...@gmail.com

unread,
Apr 23, 2009, 11:10:13 PM4/23/09
to XMPPFramework
Hi,

I have follow the step 5 very carefully. I am using the libidn from
the svn.

My project folder is "Messenger", then

/Messenger/libidn/iphoneos/libidn.a
/Messenger/libidn/iphonesimulator/libidn.a

and i add "$(SRCROOT)/libidn/${PLATFORM_NAME}" to the Library search
paths
and i add -lxml2 and -lidn to the other linker flag

Robbie Hanson

unread,
Apr 23, 2009, 11:16:06 PM4/23/09
to xmppfr...@googlegroups.com
Check to see what the ld command is doing when you're compiling:

Picture 1.png

fonghu...@gmail.com

unread,
Apr 23, 2009, 11:32:55 PM4/23/09
to XMPPFramework
Ld /Users/hanyighost/Workspace/Projects/XMPP-Messenger/Messenger/build/
Release-iphoneos/Messenger.app/Messenger normal armv6
cd /Users/hanyighost/Workspace/Projects/XMPP-Messenger/Messenger
setenv IPHONEOS_DEPLOYMENT_TARGET 2.2.1
setenv MACOSX_DEPLOYMENT_TARGET 10.5
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/
bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.0 -
arch armv6 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/
SDKs/iPhoneOS2.2.1.sdk -L/Users/hanyighost/Workspace/Projects/XMPP-
Messenger/Messenger/build/Release-iphoneos -L/Users/hanyighost/
Workspace/Projects/XMPP-Messenger/Messenger/libidn/iphoneos -L/Users/
hanyighost/Workspace/Projects/XMPP-Messenger/Messenger/libidn/iphoneos
-L/Users/hanyighost/Workspace/Projects/XMPP-Messenger/Messenger -F/
Users/hanyighost/Workspace/Projects/XMPP-Messenger/Messenger/build/
Release-iphoneos -filelist /Users/hanyighost/Workspace/Projects/XMPP-
Messenger/Messenger/build/Messenger.build/Release-iphoneos/
Messenger.build/Objects-normal/armv6/Messenger.LinkFileList -mmacosx-
version-min=10.5 -Wl,-dead_strip -lxml2 -lidn -miphoneos-version-
min=2.2.1 -framework Foundation -framework UIKit -framework
CoreGraphics -framework CFNetwork -framework SystemConfiguration -o /
Users/hanyighost/Workspace/Projects/XMPP-Messenger/Messenger/build/
Release-iphoneos/Messenger.app/Messenger

This is the path "-L/Users/hanyighost/Workspace/Projects/XMPP-
Messenger/Messenger/libidn/iphoneos"

Thanks

Robbie Hanson

unread,
Apr 23, 2009, 11:47:25 PM4/23/09
to xmppfr...@googlegroups.com
That's very odd. Would it be possible for you to send me the
project? Or does the project already include a bunch of your own
private code?

-Robbie Hanson
-Deusty Designs




On Apr 23, 2009, at 10:32 PM, fonghu...@gmail.com wrote:

>
> Ld /Users/hanyighost/Workspace/Projects/XMPP-Messenger/Messenger/

fong huang yee

unread,
Apr 24, 2009, 12:16:32 AM4/24/09
to xmppfr...@googlegroups.com
The project after i zip is still more than 4mb, so i provide a
download link for my project.

http://joc.dyndns.org/Messenger.zip

Thanks.

Tharindu Madushanka

unread,
Apr 24, 2009, 12:18:45 AM4/24/09
to xmppfr...@googlegroups.com
Hi,
"$(SRCROOT)/libidn/${PLATFORM_NAME}"
this did not work for me, then I have hard coded the path and put the correct libidn.a file there manually, when ever bulding to device or simulator.
Have a try. some times this might solve it. If its a linking issue. I am not sure.
Regards,
-Tharindu

Tharindu Madushanka

unread,
Apr 24, 2009, 12:35:33 AM4/24/09
to xmppfr...@googlegroups.com
Hi,
Just hard code the linking path, it just worked in my machine. :) I tested with your code.
Regards,
-Tharindu

Robbie Hanson

unread,
Apr 24, 2009, 12:38:02 AM4/24/09
to xmppfr...@googlegroups.com
You have them backwards. You have the iphone libidn file in the
simulator folder, and vice-versa.

-Robbie Hanson
-Deusty Designs

fonghu...@gmail.com

unread,
Apr 24, 2009, 12:38:31 AM4/24/09
to XMPPFramework
Sorry, i think i am stupid....how to hard code the linking path?

fonghu...@gmail.com

unread,
Apr 24, 2009, 2:12:33 AM4/24/09
to XMPPFramework
Hi,

I have the libidn backwards. Now i able to run my app.

Thanks for help. Thanks again.


Reply all
Reply to author
Forward
0 new messages