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

  • Home
  • SEARCH
  • 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 695351
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:57:01+00:00 2026-05-14T02:57:01+00:00

I’m trying to implement a link list which stores the city name (though you

  • 0

I’m trying to implement a link list which stores the city name (though you will see this commented out as I need to resolve the issue of not being able to use string and needing to use a primitive data type instead during the declaration), longitude, latitude and of course a pointer to the next node in the chain. I am new to the Visual C++ environment and my brain is somewhat scrambled after coding for several straight hours today so I wondered if anyone could help resolve the 2 errors I am getting (ignore the #include syntax as I had to change them to avoid the browser interpreting html!):

1>U08221.obj : error LNK2028: unresolved token (0A000298) "public: __thiscall Locations::Locations(void)" (??0Locations@@$$FQAE@XZ) referenced in function "int __clrcall main(cli::array^)" (?main@@$$HYMHP$01AP$AAVString@System@@@Z)

1>U08221.obj : error LNK2019: unresolved external symbol "public: __thiscall Locations::Locations(void)" (??0Locations@@$$FQAE@XZ) referenced in function "int __clrcall main(cli::array^)" (?main@@$$HYMHP$01AP$AAVString@System@@@Z)

The code for my header file is here:

#include <string>

struct locationNode
{
    //char[10] nodeCityName;
    double nodeLati;
    double nodeLongi;
    locationNode* Next;
};

class Locations
{
private:
    int size;
public:
    Locations(); // constructor for the class
    locationNode* Head;
    int Add(locationNode* Item);
};

and here is the code for the file containing the main method:

// U08221.cpp : main project file.

#include "stdafx.h"

#include "Locations.h"
#include <iostream>   
#include <string>

using namespace std;

int n = 0;    
int x;    
string cityNameInput;    
bool acceptedInput = false;   

int Locations::Add(locationNode *NewItem)
{
    locationNode *Sample = new locationNode;

    Sample = NewItem;
    Sample->Next = Head;
    Head = Sample;
    return size++;
}

void CorrectCase(string name) // Correct upper and lower case letters of input
{
    x = name.size();
    int firstLetVal = name[0], letVal;
    n = 1; // variable for name index from second letter onwards

    if((name[0] >90) && (name[0] < 123)) // First letter is lower case
    { 
        firstLetVal = firstLetVal - 32; // Capitalise first letter
        name[0] = firstLetVal;
    }

    while(n <= x - 1)
    {
        if((name[n] >= 65) && (name[n] <= 90))
        {
            letVal = name[n] + 32;
            name[n] = letVal;
        }
        n++;
    }
    cityNameInput = name;
}


void nameValidation(string name)
{
    n = 0; // start from first letter
    x = name.size();
    while(!acceptedInput)
    {
        if((name[n] >= 65) && (name[n] <= 122)) // is in the range of letters
        {
            while(n <= x - 1)
            {
                while((name[n] >=91) && (name[n] <=97)) // ERROR!!
                {
                    cout << "Please enter a valid city name" << endl;
                    cin >> name;
                }
                n++;
            }
        }
        else {
            cout << "Please enter a valid city name" << endl;
            cin >> name;
        }
        if(n <= x - 1)
        {
            acceptedInput = true;
        }
    }
    cityNameInput = name;
}

int main(array<System::String ^> ^args)
{
    cout << "Enter a city name" << endl;
    cin >> cityNameInput;

    nameValidation(cityNameInput); // check is made up of valid characters
    CorrectCase(cityNameInput); // corrects name to standard format of capitalised first letter, and lower case subsequent letters
    cout << cityNameInput;
    cin >> cityNameInput;

    Locations::Locations();

    Locations *Parts = new Locations();
    locationNode *Part;
    Part = new locationNode;
    //Part->nodeCityName = "London";
    Part->nodeLati = 87;
    Part->nodeLongi = 80;
    Parts->Add(Part);
}

I am familiar with the concepts but somewhat inexperienced with OOP so am making some silly errors that you can never find when you’ve stared at something too long. Any help you can offer will be appreciated!

Thanks

  • 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-14T02:57:01+00:00Added an answer on May 14, 2026 at 2:57 am

    Your code has at least two issues.

    First, the linker is complaining it cannot find your implementation of the Locations constructor (Locations::Locations()). This is because you declared it in your header but didn’t actually define it anywhere.

    Changing the line in the header to:

    Locations() {}
    

    will create a simple do-nothing implementation. You should change this to include what ever default construction you want to perform.

    Second, you shouldn’t explictly call Locations::Locations() – you don’t need to scope the constructor to the class like this, and you are not assigning the result to any object.

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

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
Basically, what I'm trying to create is a page of div tags, each has
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,
I am trying to loop through a bunch of documents I have to put
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have some data like this: 1 2 3 4 5 9 2 6

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.