Advertisement Jump to content
Sign in to follow this  

test app complains about missing symbols in a custom lib file.

This topic is 1885 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

OK, as the title says, for some god awful reason, the test app I'm using to test my custom lib doesn't find= the symbols....

I want to test the vector class:

#include "..//DemEngine/DemVector2.h"

using namespace std;

int main()
	DemVector2 v;
	return 0;

I'm including the lib by adding it to the linker property so that's not the problem and the library compiles fine, for some reason, the application doesn't want to find the symbol.

1>------ Build started: Project: DemApp, Configuration: Debug Win32 ------
1>  main.cpp
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall DemVector2::DemVector2(void)" (??0DemVector2@@QAE@XZ) referenced in function _main
1>C:\Users\Rosario\documents\visual studio 2010\Projects\DemEngine\Debug\DemApp.exe : fatal error LNK1120: 1 unresolved externals
========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========

since the project is stupidly small, I'm going to upload it in this post This is something that MAKES no sense to me so hopefully someone can answer me and give me a pointer to make sure this never happens again.

Share this post

Link to post
Share on other sites

You haven't implemented the default constructor for DemVector2. EDIT: You declared it, but didn't define it.


This would do it:

class DemVector2
    double m_X;
    double m_Y;
    DemVector2() {}    // default constructor. Note the curly brackets here to actually define the function rather than just declare it.
    // etc.

Or move the implementation to the cpp file.

Edited by Paradigm Shifter

Share this post

Link to post
Share on other sites

But you do see in the project I attached that I do that right? or didn't you open the project? cause I do do that 

Share this post

Link to post
Share on other sites

I opened the project. You didn't define the default constructor you just declared it, you did this


DemVector2(); // this is just a declaration


You either need this:


DemVector2() {} // this is a declaration and an implementation


or add






to your cpp file.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!