Topic: Confusing problem with namespaces and MS VC++ 4.0


Author: "Bret T. Clark" <bretthomasclark@wordnet.att.net>
Date: 1998/05/18
Raw View
Hi all--
I am having a rather confusing problem with namespaces and MSVC++ 4.0.
I  have a header file comprising this code (irrelevant details removed
for space):

#include <list.h>
#include <vector.h>

namespace Laplace {
    struct FElement {
    public:
        FElement(double);
        FElement(int);
        ...
    private:
        ...
    };

    typedef  list<FElement> FRep;

    typedef struct {
        FRep repnum;
        FRep repden;
    } FElement2;

    class Laplxfm2 {
    public:
        ...
    private
        ...
    };

}

// End namespace definitions

using namespace Laplace;

list<FElement> list1;
list<FElement2> list2;

// End of header file

When I try to compile the program that uses this header file, the first
errors I see indicate (explicitly) that symbol FElement2 is not defined
(The template specialization fails), whereas symbol FElement is defined.
What gives??
                        --Thoroughly confused
                        bretthomasclark@worldnet.att.net


      [ Send an empty e-mail to c++-help@netlab.cs.rpi.edu for info ]
      [ about comp.lang.c++.moderated. First time posters: do this! ]
---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]





Author: "Chuck McCorvey" <chuckm@solutionware.com>
Date: 1998/05/18
Raw View
Bret T. Clark wrote in message <6jop79$95q@netlab.cs.rpi.edu>...
>Hi all--
>I am having a rather confusing problem with namespaces and MSVC++ 4.0.
>I  have a header file comprising this code (irrelevant details removed
>for space):
>
>#include <list.h>
>#include <vector.h>
>
>namespace Laplace {
>    struct FElement {
[SNIP]
>}
>
>// End namespace definitions
>
>using namespace Laplace;
>
>list<FElement> list1;
>list<FElement2> list2;
>
>// End of header file
>
>When I try to compile the program that uses this header file, the first
>errors I see indicate (explicitly) that symbol FElement2 is not defined
>(The template specialization fails), whereas symbol FElement is defined.
>What gives??

If memory serves, v4.0 - 4.2 of VC++ had some serious bugs in namespace
handling...  You might try avoiding the using clause and use
list<Laplace::FElement> instead.

[ mod note: since we have drifted away from discussion of the
  C++ standard, I have removed comp.std.c++ from followups - sdc ]

--
Chuck McCorvey
Creative SolutionWare, Inc.


      [ Send an empty e-mail to c++-help@netlab.cs.rpi.edu for info ]
      [ about comp.lang.c++.moderated. First time posters: do this! ]


[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]






Author: scott@softbase.com
Date: 1998/05/18
Raw View
Bret T. Clark (bretthomasclark@wordnet.att.net) wrote:
> I am having a rather confusing problem with namespaces and MSVC++ 4.0.
> What gives??

I didn't think VC++ 4 even supported namespaces. Wasn't version 5
the first one to include them?

[ mod note: since we have drifted away from discussion of the
  C++ standard, I have removed comp.std.c++ from followups - sdc ]

Scott
--
Look at Softbase Systems' client/server tools, www.softbase.com
Check out the Essential 97 package for Windows 95 www.skwc.com/essent
All my other cool web pages are available from that site too!
My demo tape, artwork, poetry, The Windows 95 Book FAQ, and more.


      [ Send an empty e-mail to c++-help@netlab.cs.rpi.edu for info ]
      [ about comp.lang.c++.moderated. First time posters: do this! ]


[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]