Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: missing mbuf_len at load time




On Feb 22, 2008, at 2:46 PM, Chris Neustrup wrote:

I'm building an ethernet controller device driver that needs to implement outputPacket(), overloaded from IONetworkController.  In order to manipulate the packet pointed to by mbuf_t *, I've invoked mbuf_len to check the length of the data.  xcode can find the declaration in kpi_mbuf.h, but the linker can't find it at kext load time.  I'm running 10.4.10, which has worked fine until now.  By the message, the linker is expecting c++ linkage: __Z8mbuf_lenP6__mbuf

Thanks in advance, Chris

snippet...

UInt32
xgg::outputPacket( mbuf_t packet, void * param )
{
size_t mlen = mbuf_len(packet);
IOLog("xgg::outputPacket mbuf data len %d\n", mlen);

return kIOReturnSuccess;
}

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/xcode-users/email@hidden

This email sent to email@hidden

It looks like kpi_mbuf.h doesn't guard itself when included in C++ code.  Change your #include to look like:

extern "C" {
#include <sys/kpi_mbuf.h>
}

and you should be golden.

--
Rick Altherr
Architecture and Performance Group


Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/xcode-users/email@hidden

This email sent to email@hidden

References: 
 >missing mbuf_len at load time (From: Chris Neustrup <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.