trying to add DNS code to C++ program

D. R. Evans N7DR at arrl.net
Tue May 1 21:44:02 UTC 2001


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

OK, I'm obviously doing something completely wrong here, but I've tried 
everything I can think of.

Here's the situation:

I have a large-ish C++ program to which I need to add a small amount of DNS 
functionality. (I need to be able to make fairly basic queries and parse 
the answers.) I have read, and I hink I understand, Chapter 14 of the "DNS 
and BIND" book (the chapter about using the libraries).

The trouble is, I can't get my program to compile properly if I include the 
header files as-is from bind-devel. By being selective about which header 
files I include (i.e., include only the file nameser.h), I can get the 
program to compile, but then it fails to link against the supplied 
libbind.a.

Typical error messages are as follows:

1. If I simply try to use the header files as-is, I get:

usr/include/resolv.h:120: invalid exception specifications.

2. If I use the nameser.h from bind-devel, and the other header files as they came 
with my Mandrake 7.2 system, then the program compiles, but at link time I get:

undefined reference to res_search (+ similar messages)

I suspect that this has something to with C v. C++, and maybe it's all as simple as 
including some "extern C {}" blocks, but I have no idea where I should put them.

Please, please, please, can someone give some sort of clue as to how to make 
progress? I've spent too many hours on this already, and not made any substantive 
progress.

And if this isn't the right place to ask this sort of question, maybe someone could 
be so good as to point me to a more suitable place?

  Doc Evans
 


-----BEGIN PGP SIGNATURE-----
Version: PGP 6.0.2 -- QDPGP 2.60 
Comment: Key obtainable from servers: ID 0x362912B8

iQA/AwUBOu8uIWnXrLw2KRK4EQKItQCg+jSrw1gE9ihq4i4kuRIyv6RUqWMAoMbu
234yXR6NPN2plcI1jWapRzSc
=JBTP
-----END PGP SIGNATURE-----

----------------------------------------------------------
D.R. Evans N7DR / G4AMJ                      N7DR at arrl.net

Two assassins and one very manipulative businessman: 
   "Reflexive Action" is now available. 
See http://www.sff.net/people/N7DR/drevans.htp for details.
----------------------------------------------------------


More information about the bind-users mailing list