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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:58:12+00:00 2026-05-28T02:58:12+00:00

I’m trying to do something very simple in C++/CLI, however I’m running into issues

  • 0

I’m trying to do something very simple in C++/CLI, however I’m running into issues with Visual Studio and I can’t figure out why.

I have two projects, one which contains a header file named JNIUtils.h. Its content is very barebones –

#pragma once

class JNIUtils
{
public:
    JNIUtils( void );
    ~JNIUtils( void );
};

and its implementation is very simple as well –

#include "stdafx.h"

#include "JNIUtils.h"

JNIUtils::JNIUtils( void )
{

}

JNIUtils::~JNIUtils( void )
{

}

All I’m trying to do is to create an object of this newly defined type in another project. In the project where I’m including this header file, I’ve gone to

Project Properties > Configuration Properties > VC++ Directories > Include Directories

I added an entry with the path to where the header file I’m including resides (JNIUtils.h)

The CPP file I’m trying to create an instance of this object in looks as follows:

#include "stdafx.h"
#include "JNIUtils.h"

using namespace System;

int main(array<System::String ^> ^args)
{
    JNIUtils *util = new JNIUtils();
    Console::WriteLine(L"Hello World");
    return 0;
}

When I try to compile I get the following errors:

Error   3   error LNK1120: 2 unresolved externals   C:\zcarter\UDK\WebSvcClients\Debug\JNITester.exe    JNITester
Error   2   error LNK2019: unresolved external symbol "public: __thiscall JNIUtils::JNIUtils(void)" (??0JNIUtils@@$$FQAE@XZ) referenced in function "int __clrcall main(cli::array<class System::String ^ >^)" (?main@@$$HYMHP$01AP$AAVString@System@@@Z)   C:\zcarter\UDK\WebSvcClients\JNITester\JNITester.obj    JNITester
Error   1   error LNK2028: unresolved token (0A000009) "public: __thiscall JNIUtils::JNIUtils(void)" (??0JNIUtils@@$$FQAE@XZ) referenced in function "int __clrcall main(cli::array<class System::String ^ >^)" (?main@@$$HYMHP$01AP$AAVString@System@@@Z)  C:\zcarter\UDK\WebSvcClients\JNITester\JNITester.obj    JNITester

Can anyone tell me what I’m doing wrong here?

  • 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-28T02:58:13+00:00Added an answer on May 28, 2026 at 2:58 am

    When you want to use classes from a project into another one, there are two things that you need to do:

    1) Link the library compiled code (.lib) to your main application code.
    If you have vs2010, simply add the project in the Project->Properties->Common->References section, all the hard work will be done for you.

    If you have vs2008 or lower, you must add the project to the dependencies in Project->Dependencies.... Then, go in Project->Properties->Linker->Input and add the .lib file to the existing list of .dll. Use a relative path so that this will work on other computers. Note that there is also a Reference section in vs2008, but I believe it only works for CLR assemblies.

    2) Add the headers to the include directories

    You figured that part already, but I recommend you to add them to the Project->Properties->C++->Additional Include Directories instead, as the method you used will not work on another computer unless they make the same configuration as you.

    • 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'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a French site that I want to parse, but am running into
I am currently running into a problem where an element is coming back from
Basically, what I'm trying to create is a page of div tags, each has
I am trying to understand how to use SyndicationItem to display feed which is
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,

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.