Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7162145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:41:11+00:00 2026-05-28T13:41:11+00:00

I’m somewhat new at C++ (I normally work in C#, but right now I’m

  • 0

I’m somewhat new at C++ (I normally work in C#, but right now I’m working on a somewhat cross-platform project), so I’m not really used to all of its concepts and exactly how compiling/linking works. So, naturally, I’m not quite sure why I’m getting this error. I’ve researched the error a bit, and it seems a problem people commonly get when they don’t link a library or declare a function in a header file but never define it outside of that. My error, oddly, is not a result of either. The exact error text is this:

“Error 1 error LNK2001: unresolved external symbol "public: __thiscall ld22::QuadNode<class ld22::DrawableObject>::QuadNode<class ld22::DrawableObject>(class sf::Rect<float>)" (??0?$QuadNode@VDrawableObject@ld22@@@ld22@@QAE@V?$Rect@M@sf@@@Z) C:\Users\Nick\Documents\Visual Studio 2010\Projects\GDCSFMLTest\GDCSFMLTest\main.obj“

To me, it seems like it’s trying to tell me that I never made an implementation of the file. However, I have. main.cpp, the file that compiles into main.obj and gives the error, includes Quadtree.h, which declares the function (technically, constructor) with the line QuadNode(sf::FloatRect);, and in the file Quadtree.cpp I include Quadtree.h and define the constructor as follows:

template<class T>
ld22::QuadNode<T>::QuadNode(sf::FloatRect bounds)
{
    Bounds = bounds;
}

Please excuse any bad coding practices and whatnot, as I said, I’m fairly new to C++ and I’m still trying to figure things out. Any help is appreciated (especially if I made a stupid or beginners error somewhere, which I kinda feel I did), and if you need more info I’d be glad to provide it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T13:41:12+00:00Added an answer on May 28, 2026 at 1:41 pm

    In C++, templated classes have to be defined in header files. This is because unlike generics in C# where they keep track of the <T> type at runtime, a new class is actually generated by the compiler for each <T> you use it with. The compiler has no way to actually compile a templated form of the class, and then link-in the type information. The way I see it, templates in C++ are really a form of source-code transformation that happens before the compilation stage.

    See this question for more information as to why:

    • Why can templates only be implemented in the header file?
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

this is what i have right now Drawing an RSS feed into the php,
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I used javascript for loading a picture on my website depending on which small
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
This could be a duplicate question, but I have no idea what search terms

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.