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
    broken.

    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

    http://www.spellen.org/youcandoit/french.htm

    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 http://www.spellen.org/youcandoit
    For project ideas and contributions: http://www.spellen.org/youcandoit/projects
     
    Francis Glassborow, Oct 14, 2004
    #1
    1. Advertising

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
    Replies:
    0
    Views:
    567
    asicbaba
    Jul 20, 2004
  2. John Smith

    Header files included in header files

    John Smith, Jul 21, 2004, in forum: C Programming
    Replies:
    18
    Views:
    639
    Jack Klein
    Jul 24, 2004
  3. Replies:
    3
    Views:
    1,361
    Walter Roberson
    May 1, 2006
  4. mlt
    Replies:
    2
    Views:
    917
    Jean-Marc Bourguet
    Jan 31, 2009
  5. ruxandra
    Replies:
    0
    Views:
    484
    ruxandra
    Apr 14, 2009
Loading...

Share This Page