namespace warnings

This is a discussion on namespace warnings within the C++ Programming forums, part of the General Programming Boards category; When I compile and link two files that use the std namespace, I get a ton of warnings from the ...

  1. #1
    Registered User
    Join Date
    Nov 2001
    Posts
    13

    namespace warnings

    When I compile and link two files that use the std namespace, I get a ton of warnings from the compiler about duplicate symbols.

    The reason for the warnings is obvious so how can I link two files that use the same namespace without generating a warning ?

  2. #2
    Unregistered
    Guest
    I dont think namespace is your problem. If you are using multiple header files, e.g., #include "myHeader1.h" and #include "myHeader2.h", and have not conditionaly included the commands, e.g., #ifndef MYHEADER1_H and #define MYHEADER1_H, . . . commands . . ., and #endif, you will get errors.

    Otherwise, to see some code would help me see your problem.

    Ted

  3. #3
    Registered User
    Join Date
    Nov 2001
    Posts
    13

    namespace warnings

    okay.
    i'm using the new style headers under the std namespace.
    so how do i conditionally include them like the old style headers:

    #ifndef _H
    #define MYHEADER_H
    #endif

  4. #4
    Unregistered
    Guest
    You must post some code. Start by showing the names of the header files you wish to include.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. extern namespace?
    By Brafil in forum C++ Programming
    Replies: 2
    Last Post: 01-10-2009, 07:06 AM
  2. inline templated class method as standalone function in namespace
    By monikersupreme in forum C++ Programming
    Replies: 4
    Last Post: 10-28-2008, 11:38 AM
  3. namespace problem
    By DL1 in forum C++ Programming
    Replies: 8
    Last Post: 10-17-2008, 12:10 PM
  4. Post...
    By maxorator in forum C++ Programming
    Replies: 12
    Last Post: 10-11-2005, 08:39 AM
  5. namespace std - After searching the the boards
    By jrahhali in forum C++ Programming
    Replies: 11
    Last Post: 08-26-2004, 04:51 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21