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 9123277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:18:01+00:00 2026-06-17T06:18:01+00:00

I’ve been getting these two errors and I cant seem to find a solution

  • 0

I’ve been getting these two errors and I cant seem to find a solution that works.

LNK1120: 1 unresolved externals

Error 1 error LNK2019: unresolved external symbol "public: __thiscall Vector3D::Vector3D(class Vector3D const &)" (??0Vector3D@@QAE@ABV0@@Z) referenced in function "public: class Vector3D __thiscall Vertex::GetPosition(void)" (?GetPosition@Vertex@@QAE?AVVector3D@@XZ)

I think its to do with my Matrix operator and the constructor in my Vector 3d class
Any help will be much appreciated as I am quite new to C++

#ifndef MATRIX4_H
#define MATRIX4_H

#include "Vector3D.h"

class Matrix4
{
    public:
    Matrix4();
    Matrix4(const Matrix4& rhs);
    ~Matrix4();

    Vector3D Matrix4::operator *(Vector3D vector)
    {
        Vector3D newVector;

        newVector.SetVector_X((m[0][0] * vector.GetVector_X()) + (m[0][1] * vector.GetVector_Y()) + (m[0][2] * vector.GetVector_Z()) + m[0][3]);
        newVector.SetVector_Y((m[0][0] * vector.GetVector_X()) + (m[1][1] * vector.GetVector_Y()) + (m[1][2] * vector.GetVector_Z()) + m[1][3]);
        newVector.SetVector_Z((m[0][0] * vector.GetVector_X()) + (m[2][1] * vector.GetVector_Y()) + (m[2][2] * vector.GetVector_Z()) + m[2][3]);
        return Vector3D(newVector.GetVector_X(),newVector.GetVector_Y(),newVector.GetVector_Z());
        
    }
    
    void SetMatrix(float matrix[4][4])
    {
        memcpy(m,matrix,sizeof(matrix));
    }
    
    private:
      float m[4][4];
   }; 
   #endif

Vector3D.h file

#ifndef VECTOR3D_H
#define VECTOR3D_H

class Vector3D
{
  public:
    Vector3D();
    Vector3D(const Vector3D& rhs);
    ~Vector3D();
    
    Vector3D(float VectorX, float VectorY, float VectorZ)
    {
        x=VectorX;
        y=VectorY;
        z=VectorZ;
    }

    void SetVector3D(float vector_X, float vector_Y, float vector_Z)
    {
        x = vector_X;
        y = vector_Y;
        z = vector_Z;
    }

    void SetVector_X(float vector_X)
    {
        x=vector_X;
    }

    void SetVector_Y(float vector_Y)
    {
        y=vector_Y;
    }
    
    void SetVector_Z(float vector_Z)
    {
        z=vector_Z;
    }

    float GetVector_X()
    {
        return x;
    }

    float GetVector_Y()
    {
        return y;
    }

    float GetVector_Z()
    {
        return z;
    }

    Vector3D GetVector()
    {
        return Vector3D(x,y,z);
    }

private:
    float x;
    float y;
    float z;

   };
  #endif
  • 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-06-17T06:18:02+00:00Added an answer on June 17, 2026 at 6:18 am

    It says that the linker cannot find an implementation of Vector3D(const Vector3D& rhs);. This constructor is declared in your vector class, but not defined.

    Do you have an implementation of the constructor somewhere in a .cpp file, and is this file known to your compiler?

    C/C++ compilation works like that: At first, you have a number of so called “compilation units” – normally, every .cpp-file is one such compilation unit. Your program consists of all these separate units linked together (the “linking” process, happens after compilation). Every function that is called somewhere has to be defined exactly once in some compilation unit, unless it is defined inline (like the other methods of your class). If a method is declared, but not defined, the compiler will not complain – only the linker will. Imagine the compilation units having “sockets” and “connectors” which fit to the corresponding “sockets” of other units. The compilation process just creates these units assuming a particular “socket” shape (as given by declarations), whereas the linker actually tries to connect each “socket” with it’s “connector”. So you see how the compilation process may suceed, but the linking not.

    Linker errors can be tricky to solve, especially if you’re not that experienced yet. There can be many causes for them:

    • Missing implementation/definition
    • Definition exists, but somehow is not compiled (because the file is not passed to the compiler etc.)
    • Different versions of libraries etc.

    And many more..

    Edit: Apart from that, you should pass the vector by const reference, and create newVector by invoking it’s constructor, instead of creating a default constructed object and then assigning. And the final construction in the return statement is not needed as well. Improved code:

    Vector3D Matrix4::operator *(const Vector3D& vector)
    {
        return Vector3D(
            (m[0][0] * vector.GetVector_X()) + (m[0][1] * vector.GetVector_Y()) + (m[0][2] * vector.GetVector_Z()) + m[0][3],
            (m[0][0] * vector.GetVector_X()) + (m[1][1] * vector.GetVector_Y()) + (m[1][2] * vector.GetVector_Z()) + m[1][3],
            (m[0][0] * vector.GetVector_X()) + (m[2][1] * vector.GetVector_Y()) + (m[2][2] * vector.GetVector_Z()) + m[2][3]
        );
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I've got a string that has curly quotes in it. I'd like to replace
I have a small JavaScript validation script that validates inputs based on Regex. I
I am trying to find ID3V2 tags from MP3 file using jid3lib in Java.
I am doing a simple coin flipping experiment for class that involves flipping a
I have a French site that I want to parse, but am running into
I've tracked down a weird MySQL problem to the two different ways I was

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.