[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: apropos linking `dselect'



-----BEGIN PGP SIGNED MESSAGE-----

"BP" == Bruce Perens <bruce@pixar.com> writes:

  "EM" ==  Eric Matecki >taarna!eric@iros1.IRO.UMontreal.CA> wrote:

  EM> I think there is no:
  EM> #ifdef __cplusplus
  EM> extern "C" {
  EM> #endif
  EM> at the start of 'ncurses.h', and the closing '}' at the end.

  BP> Is it the responsibility of C headers to say "I am not C++", or is it
  BP> the responsibility of C++ programs to properly declare that they
  BP> are importing headers from the C universe?

  BP> --

     I would say the latter.

     In the present case, *much* simpler to fix dselect/main.cc than
to modify a standard ncurses header.

     Definitely.
   
     I already know that dpkg-1.0.17 compiles if I skip over
`dselect', so if replacing the

	#include <term.h>

in dselect/main.cc with

	extern "C" {
	#include <term.h>
	}

satisfies the linker, that should do it.

    Right.

    Ok, let me try that. ...

    OK, with that change, `dpkg-1.0.17.tar.gz' compiles against stock
Debian `ncurses-developer-1.9.4-0.deb' ncurses headers.

    Here it is as a unified diff:

*************************** cut here ***********************
- --- dselect-main.cc.bedlam	Thu Mar 21 01:01:24 1996
+++ dselect-main.cc.dist	Thu Mar 21 01:03:19 1996
@@ -34,10 +34,7 @@
 #include <assert.h>
 
 #include <ncurses.h>
- -
- -extern "C" {
 #include <term.h>
- -}
 
 extern "C" {
 #include "config.h"
************************ cut here *************************


- --
<bhogan@rahul.net> |- "5. Improve constantly and forever the system of
production and service, to improve quality and productivity, and thus
constantly decrease costs." (W. Edwards Deming)








-----BEGIN PGP SIGNATURE-----
Version: 2.6.2

iQCVAwUBMVEp8W1cfyU9ImVRAQHJNwQAjtW29qi2XzCOuL9ET/ObyfChpCgL3LPJ
o25sT0FV0kaMKXiUEsZL0rLx38K0XwAUcFgtzM+Gy4MIwk8bgrbYM1FNeaAJYnB5
Q0qNviR4nuHbna+4SixBb65o83Nz/sKsvu2lxF6nR12qYZLOOKsT8qdS0iLBCruE
SE0EEQq5PHE=
=CDyM
-----END PGP SIGNATURE-----



Reply to: