Broken header files on 'Je me lance!' CD

Discussion in 'C++' started by Francis Glassborow, Oct 14, 2004.

  1. 'You Can Do It!' has just been published in French as 'Je me lance!',
    not this is not an advertising pitch but an appeal for your help.

    Quite sensibly the translators have augmented my library by adding
    functions named in French that delegate to the English equivalent. That
    makes life easier for the target reader and is consistent with the
    pedagogical philosophy of the original book.

    However the person responsible for adding code to the header files has
    made a beginner's error; he has failed to qualify the delegating
    definitions as inline. All is well as long as the reader is only using
    single source code files but as soon as the reader gets to Chapter 3
    s/he is exposed to multiple source code files which include one of the
    badly modified header files. The result is redefinition errors at link
    time and a complete collapse of confidence for the reader who may spend
    many hours trying to discover what they have done wrong. And the typical
    reader has no hope of finding the fix for themselves with the result
    that the essential bond of trust between authors and readers has been

    Fortunately an early reader alerted me to the fact that there was a
    problem by emailing me about his struggle to get code to work.

    Many readers of this newsgroup are the kind of people who are consulted
    when problems arise and a good number of them have French as their first
    language. If you are one of the latter and also subscribe to one or more
    French language programming newsgroups I would be most grateful if you
    could alert people on those groups to both the problem and the
    availability of the corrected files at

    Now a little piece of C++ code that I use myself for detecting potential
    problems with redefinition errors:

    File 1

    #include "x.h"
    #include <iostream>

    int foo();

    int main(){
    std::cout << foo();

    In file 2

    #include "x.h"

    int foo(){ return 1;}

    Replace x.h with the header you want to test and try to create an
    executable. If all works then you do not have redefinition problems
    (though there may be many others:).

    A pity the translators did not use such a simple test :-(

    Francis Glassborow ACCU
    Author of 'You Can Do It!' see
    For project ideas and contributions:
    Francis Glassborow, Oct 14, 2004
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. asicbaba

    free lance

    asicbaba, Jul 20, 2004, in forum: VHDL
    Jul 20, 2004
  2. John Smith

    Header files included in header files

    John Smith, Jul 21, 2004, in forum: C Programming
    Jack Klein
    Jul 24, 2004
  3. Replies:
    Walter Roberson
    May 1, 2006
  4. mlt
    Jean-Marc Bourguet
    Jan 31, 2009
  5. ruxandra
    Apr 14, 2009

Share This Page