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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T05:09:18+00:00 2026-06-18T05:09:18+00:00

first my simple setup: I’ve got 2 VS2012 projects. Now I want to use

  • 0

first my simple setup:
I’ve got 2 VS2012 projects. Now I want to use classes from Project B in Project A.
I added Project B to A’s project dependencie list and imported the headers where necessary. (e.g. #include”..\src-pool\Coords.h”;).

So far, so good – no compiler errors.
But when I try to build the project, I get some linker errors:

Fehler  1   error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""public: __thiscall Coords::Coords(double,double)" (??0Coords@@QAE@NN@Z)" in Funktion ""public: void __thiscall TileDownloader::calculateBounds(double *,int)const " (?calculateBounds@TileDownloader@@QBEXPANH@Z)".  C:\Users\username\documents\visual studio 2012\Projects\CPPHA\project\TileDownloader.obj    

I’m sorry, this is the german version of VS. “Verweis auf nicht aufgelöstes externes Symbol” means: Link to not resolved extern symbol.

Any ideas? =)


Done this (this is a class I want to export and use in the other project)

Coords.h

#pragma once
#include <iostream>
#ifdef EXPORT_MYCLASS
#define MYCLASSEXPORT __declspec(dllexport)
#else
#define MYCLASSEXPORT __declspec(dllimport)
#endif


class  MYCLASSEXPORT  Coords
{
public:
    Coords(double lat, double lon);
    ~Coords(void);
    double getLon() const;
    void setLon(double val);
    double getLat() const;
    void setLat(double val);

    void printInfos() const;

private:
    double lat, lon;

};

But I get a warning “inconsistent dll export” and the same errors. Sorry, I’m new to C++


and I want to use it like this

#include "..\src-pool\Coords.h"

class TileDownloader
{
public:
    TileDownloader(void);
    ~TileDownloader(void);


    void  calculateBounds(double* array, int zoomLevel) const;
    void  downloadTiles() const;

private:
    double maxLat, maxLon, minLat, minLon;

};
  • 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-18T05:09:20+00:00Added an answer on June 18, 2026 at 5:09 am

    There are 3 things that need to happen for the linker to find the a class method:

    1. You reference the right dll/project
    2. You have an implementation of that method in that dll/project.
    3. It’s exposed externally with a dll export (__declspec(dllexport))

    Common practice for declaring an export in a header:

    #ifdef EXPORT_MYCLASS
    #define MYCLASSEXPORT __declspec(dllexport)
    #else
    #define MYCLASSEXPORT __declspec(dllimport)
    #endif
    
    class MyClass
    {
         MYCLASSEXPORT MyClass();
    }
    

    Then you can just define that preprocessor argument in the exporting dll’s preprocessor definitions.

    In Visual studio:
    Project properties -> Configuration properties -> C/C++ -> Preprocessor -> Prerpocessor deffinitios

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

Sidebar

Related Questions

First whats the class I use if I want to setup a test like:
I have a simple VS setup project. On the first screen user inputs database
I have setup a simple test project for the EF 4.1 RC, using Code-First
Now on my localhost I'm starting developing first simple web service using ruby 1.9.2
I am working on my first NHibernate project, and have the following setup/requirement. I
Its probarbly a simple 3-tier problem. I just want to make sure we use
I have a simple accordion setup, with just two sections. The top, first section
I must be missing something simple, but I can't see it. First, the setup:
I was trying to use the MVVM pattern on my first (very simple) WP7
I have a fairly simple desktop application that uses a .NET setup project (.msi

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.