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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:05:31+00:00 2026-05-26T05:05:31+00:00

my project contains a few classes (1 of them is Point3D) & a cpp

  • 0

my project contains a few classes (1 of them is Point3D) & a cpp (CreatePoint.cpp) & a header file (CreatePoint.h).

my stdafx.h file is

// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//

#pragma once

#include "targetver.h"

#include <stdio.h>
#include <tchar.h>


// TODO: reference additional headers your program requires here

#include "CreatePoint.h"
#include "Point3D.h"
#include "Vector3D.h"
#include "Sys.h"

my CreatePoint.h file is

#include "stdafx.h"
#pragma once
#include "Point3D.h"


//*******************************************************************
void initialise();

//*******************************************************************
Point3D *get_point(int);

//*******************************************************************
int get_index(Point3D *);

//*******************************************************************
Point3D *create_point();

//*******************************************************************
void del_point(Point3D *);

//*******************************************************************
void destruct_point();

my CreatePoint.cpp file is

#include "stdafx.h"
#include "CreatePoint.h"

int counter;
int size = 50;
Point3D *point[];
//*******************************************************************
void initialise()//run this func each time point[] is created
{
    counter = 0;
    for(int i = 0; i<size; i++)
    {
    point[i] = '\0';
}
}

//*******************************************************************
Point3D *get_point(int index)
{
    return point[index];
}

//*******************************************************************
int get_index(Point3D *p)
{
    for(int i = 0; i<size; i++)
{
    if(point[i] == p)
        return i;
}
}

//*******************************************************************
Point3D *create_point()
{
point[counter] = new Point3D;
counter++;
return point[counter];
}

//*******************************************************************
void del_point(Point3D *p)
{
int d = get_index(p);
delete point[d];
}

//*******************************************************************
void destruct_point()
{
delete [] point;
}

i am getting a run time error :

CreatePoint.obj : error LNK2001: unresolved external symbol "class Point3D * * point" (?point@@3PAPAVPoint3D@@A)
1>C:\Documents and Settings\my documents\visual studio 2010\Projects\Maths\Debug\Maths.exe : fatal error LNK1120: 1 unresolved externals

i have searched the web & mostly the reason for such a failure is not including stdafx.h in 1st line of each file… but i have already included it.
i am also gettting some warning for the last function destruct_point() ->

\maths\maths\createpoint.cpp(51): warning C4154: deletion of an array expression; conversion to pointer supplied
  • 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-26T05:05:32+00:00Added an answer on May 26, 2026 at 5:05 am

    LNK2001 is a linker error, not a runtime error.

    Point3D *point[]; seems to be a declaration, but not an instantiation. That is, this line tells the compiler that this variable will exist somewhere later. Because arrays must have a size to be instantiated. (I hadn’t even known [] without a size was allowed in that scope)

    Change this to Point3D *point[size]; and it will actually create the array. Also, size will have to be a const int.

    [Edit]
    destruct_point() attempts to delete the entire array of points. Since the array is statically allocated, that’s not allowed. Since you already have a function to delete individual points, I can’t imagine why this function exists. Since the array was not declared with new[], you should NOT use delete[] on it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an asp.net web service project. This project contains a few classes declared
I've started to refactor/clean up big project. Some of files contains few small classes
I have a Testing project that contains a csv file which a webtest uses
I've just started on a new project which currently contains a fair few ViewModel
I created a .properties file that contains a few simple key = value pairs.
I have a vc++ solution which contains few vc++ project. And each project also
I have a grails project that contains a few domain objects. I am using
I have an android project with strings.xml file, what contains string values. Today when
I have a solution with many projects. One project contain few custom components. One
Within my Subversion project I have a few directories that contain other open source

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.