Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

ld: symbol(s) not found for architecture x86_64 collect2: ld returned 1 exit status

Hi All, when I am trying to compile an application I am getting the following error... could anyone please help me out..

make

gcc -o event_handler main.c -Wall -O2 -g

main.c: In function ‘main’:

main.c:35: warning: unused variable ‘AP_mac’

main.c:34: warning: unused variable ‘a_flag’

Undefined symbols for architecture x86_64:

"_Apple80211Open", referenced from:

_main in ccM53WLV.o

"_Apple80211Close", referenced from:

_main in ccM53WLV.o

ld: symbol(s) not found for architecture x86_64

collect2: ld returned 1 exit status

make: *** [event_handler] Error 1



how can I clear this error... thanks in advance

Mac Pro, Mac OS X (10.6.8), development

Posted on Apr 30, 2012 2:20 AM

Reply
1 reply
Sort By: 

Apr 30, 2012 4:00 AM in response to pranitha p belavadi

hi i got the answer.. It was not comming as the framework was not included In the Makefile.. By giving the following.. the main.c was compiled


CFLAGS = -Wall -O2 -g

LDFLAGS = -F/System/Library/PrivateFrameworks

LDFLAGS += -framework Apple80211


OBJS = main.o


event_handler: $(OBJS)

gcc $(LDFLAGS) -o event_handler $(OBJS)


clean:

rm -f event_handler

rm -f *.o

Reply

ld: symbol(s) not found for architecture x86_64 collect2: ld returned 1 exit status

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.