Thread: Linker Errors with Templates

  1. #16
    Registered User
    Join Date
    Jan 2005
    Does it work if you put all the code in the header? You said no, but then you said that it does work if you #include the cpp in the main source file. There shouldn't be another cpp file to include if you are trying it by putting all the template code into the header.

    All the code that used to be in the source file should now be at the bottom of the header. Your header should have one set of include guards encompassing everything. That header should be included in your main source file. If you are doing that, it should work.

  2. #17
    Moderately Rabid Decrypt's Avatar
    Join Date
    Feb 2005
    Milwaukee, WI, USA
    What's not working with the private members? You haven't used any in the code you've posted, so I assume you're talking about something outside of that.

    So sorry to bore you
    There is a difference between tedious and difficult.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Templates + ref to pointer + linker error.
    By Sparrowhawk in forum C++ Programming
    Replies: 8
    Last Post: 05-18-2009, 04:06 PM
  2. Linker errors on Winsock2 functions
    By ShadowMetis in forum C++ Programming
    Replies: 2
    Last Post: 11-20-2004, 11:19 PM
  3. help, linker errors when adding library file to project
    By ngcfan525 in forum C++ Programming
    Replies: 1
    Last Post: 03-09-2003, 02:27 PM
  4. MSVis-Studio C++ libraries and linker errors
    By kellydj in forum Windows Programming
    Replies: 10
    Last Post: 03-12-2002, 02:03 PM
  5. Linker errors with simple static library
    By Dang in forum Windows Programming
    Replies: 5
    Last Post: 09-08-2001, 09:38 AM