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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:55:05+00:00 2026-05-26T13:55:05+00:00

I have a problem. I get an error and I’m not sure why it’s

  • 0

I have a problem. I get an error and I’m not sure why it’s happening.

2>Home.obj : error LNK2019: unresolved external symbol "**void __cdecl LogAString(char *,...)**" (?LogAString@@YAXPADZZ) referenced in function "**public: static void __cdecl X::Home::HomeStart(void)**" (?HomeStart@Home@X@@SAXXZ)
2>Widget.obj : error LNK2001: unresolved external symbol "void __cdecl LogAString(char *,...)" (?LogAString@@YAXPADZZ)
2>J:\src\out.dll : fatal error LNK1120: 1 unresolved externals

Here’s my code:

Log.h

#pragma once

#include <iostream>
#include <cstdarg>

void LogAString(char* fmt, ...);
void LogAnError(char* fmt, ...);

Log.cpp

#include "Log.h"

#include <Util/String/String Formatting.h> // defines format(). Does not have any errors or issues.

void LogAString(char* fmt, ...)
{
    va_list ap;
    va_start(ap, fmt);
    vprintf(fmt, ap);
    va_end(ap);
};

void LogAnError(char* fmt, ...)
{
    va_list ap;
    va_start(ap, fmt);

    auto formatted_string = format("ERROR: %s", fmt).c_str();
    LogAString(const_cast<char*>(formatted_string), ap);

    va_end(ap);
};

Home.cpp (extract)

#include "Home.h"
#include "Log.h"

namespace X {

void Home::HomeStart()
{
    while (true)
    {
        auto number_of_widgets = Widgets::Count();
        LogAString("Loading with %d widgets", number_of_widgets);
    }
}

} // namespace X

I thought I’ve declared and defined the functions in the header and cpp files respectively. Why am I getting these errors? I’ve been at it for a few hours now, and still not sure why this is happening. Using VC++ on VS 2010.

I’m not using any other external libraries at this point. The compile target is a DLL, “out.dll”.

  • 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-26T13:55:06+00:00Added an answer on May 26, 2026 at 1:55 pm

    Did you remember to add Log.cpp to your project?

    If so, then open the file log.obj in a hex editor. Search for the string LogAnError. It will be part of a larger decorated string. Use the undname command to undecorate it. Compare it with what the linker cannot resolve. Identify the difference and fix your LogAnError function so they match again.

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

Sidebar

Related Questions

I have a problem with: NHibernate.Cfg.Configuration.SetProperties() Not accepting the IDictionary: NHibernateConfigHandler I get the
i have againg a problem with completition. now i can't get any suggestion. Sure
i have a problem whenever i Refresh the prograss bar i get the error
I have a problem with posting a multiselect, I get error: There is no
I have a problem parsing an xml, actually transforming it. The error I get
I have a problem. I get an error if the objectAtIndex:x is empty. In
Hello guys i have a little problem i get an error: File C:\Users\kokki\Desktop\gb1\main.py, line
I have a problem with simple form for, I get this error url(http://localhost:3000/konkurrencer/new): Showing
I have a problem to get the values and text of the MultiSelectList to
I have a problem wherein I get an AmbiguousMatchException in some of the samples

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.