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 external symbol with the functions included in DNSCommon.c



On 2/20/04 8:13 PM, "Frederic Drolet" <email@hidden> wrote:

> I'm trying to update the new version of Rendezvous into my project. I
> didn't make it for a while and I have some problems with the new
> implementation. I already corrected the problems with the calls to
> mDNS_StartBrowse and the others. I should now be able to compile my
> project. But, when I try to compile the project (I use Visual Studio .NET
> 2003), I get some unresolved external symbols for 25 functions included in
> the DNSCommon.c file. However, this file is already included in my project
> and compile with the other files. The functions should be defined, but it
> doesn't seem to work for my project. What could be the difference with the
> (working) exemple project you give with the mDNSResponder module? The
> exemple application I tried is the RendezvousBrowser. It uses almost the
> same files as me and works perfectly with the DNSCommon.c file. Also, I
> have some type conversion errors with the uDNS.c file. I had to modify it
> by doing some static conversions. The file, however, works perfectly with
> the exemple without any modification...

I suspect the reason you are seeing unresolved symbols is that you are
building DNSCommon.c as C code, but are building other code as C++. When the
C++-compiled code includes DNSCommon.h, it is referencing C++ name-mangled
symbols, but if DNSCommon.c is compiled as C code, the names will not be
mangled, resulting in unresolved symbol errors during linking.

DNSCommon.h and uDNS.h now wrap the prototypes with extern "C" so these
files can be used with C++ code. TOT CVS contains the changes.

> In my last message, I said that I also have some problems with the file
> uDNS.c in my project. When I try to compile, I get these errors:
> 
> uDNS.c
> \dossier_ecole\Stage\Rendezvous\Core\uDNS.c(454) : warning C4065: switch
> statement contains 'default' but no 'case' labels
> \dossier_ecole\Stage\Rendezvous\Core\uDNS.c(551) : error C2440:
> 'initializing' : cannot convert from 'void *' to 'ntaContext *'
>        Conversion from 'void*' to pointer to non-'void' requires an
> explicit cast
>
> [others similar errors removed]
>
> Note that with the application RendezvousBrowser in the mDNSResponder
> module, the file works correctly.

This is due to some of the sample apps compiling .c files as C code and C is
more forgiving about void * assignments whereas C++ explicitly prohibits it.

The Windows stuff hasn't been built for a few weeks and some of the changes
made during that time were not flagged as errors by the non-Windows build
tools so you ended up running into them. uDNS.c now has the casts and other
changes so you should be able to checkout TOT now and have things build
cleanly.
_______________________________________________
rendezvous mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/rendezvous
Do not post admin requests to the list. They will be ignored.

References: 
 >Unresolved external symbol with the functions included in DNSCommon.c (From: Frederic Drolet <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.