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: unresolved symbols



#include <sys/cdefs.h>
__BEGIN_DECLS
#include ... // C header files to be used from C++ code
__END_DECLS

Your problem is that you are using external references intended for use in C code in C++ code.

You can file a bug about this, but I believe that the netfulter APIs were never intended for use from C++. You will also need to ensure any callbacks you register are declared as "C functions exported by a C++ object file".

Typically, people attempting to mix BSD and IOKit models write their BSD code in C and their IOKit code in C++, put them in different compilation units, and link them together to get their KEXT.

-- Terry

On Jul 12, 2008, at 5:00 PM, Doug John <email@hidden> wrote:

Hi,

I'm getting a bunch of unresolved symbols when I try to load my kext:

kextload: notice: extension build/Debug/mykext.kext has debug properties set
kextload: extension build/Debug/mykext.kext appears to be loadable
kld(): Undefined symbols:
__Z11iflt_attachP7__ifnetPK10iff_filterPP14__ifnet_filter
__Z11iflt_detachP14__ifnet_filter
__Z13mbuf_tag_findP6__mbufjtPmPPv
__Z16mbuf_tag_id_findPKcPj
__Z17mbuf_tag_allocateP6__mbufjtmjPPv
__Z8mbuf_lenP6__mbuf
__Z9mbuf_dataP6__mbuf
__Z9mbuf_nextP6__mbuf

Translated as:

iflt_attach(__ifnet*, iff_filter const*, __ifnet_filter**)
iflt_detach(__ifnet_filter*)
mbuf_tag_find(__mbuf*, unsigned int, unsigned short, unsigned long*, void**)
mbuf_tag_id_find(char const*, unsigned int*)
mbuf_tag_allocate(__mbuf*, unsigned int, unsigned short, unsigned long, unsigned int, void**)
mbuf_len(__mbuf*)
mbuf_data(__mbuf*)
mbuf_next(__mbuf*)

My OSBundleLibraries are as follows:

<key>OSBundleLibraries</key>
<dict>
<key>com.apple.kpi.bsd</key>
<string>8.0</string>
<key>com.apple.kpi.iokit</key>
<string>8.0</string>
<key>com.apple.kpi.libkern</key>
<string>8.0</string>
<key>com.apple.kpi.mach</key>
<string>8.0</string>
</dict>

Which I thought would be correct given the instructions here:

I'm building against the 10.4 SDK on 10.5.4.
Any idea what is going on?

Thanks,
Doug
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-dev/email@hidden

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

This email sent to email@hidden

References: 
 >unresolved symbols (From: "Doug John" <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.