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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T01:50:57+00:00 2026-06-01T01:50:57+00:00

I was following a tutorial on how to create a C++/Cli DLL, for some

  • 0

I was following a tutorial on how to create a C++/Cli DLL, for some reason I get a warning for each function declaration, here’s the whole code:

// KRecognizer.h

#pragma once

namespace KR
{
    class __declspec(dllimport) KinectRecognizer
    {
        public:
            KinectRecognizer();
            ~KinectRecognizer();
            int Display();
    };
}

_

//  KRecognizer.cpp
#include "stdafx.h"
#include "KRecognizer.h"

using namespace System;

KR::KinectRecognizer::KinectRecognizer()
{
}

KR::KinectRecognizer::~KinectRecognizer()
{
}

int 
KR::KinectRecognizer::Display()
{
    Console::WriteLine(L"Writing a line");
    return 100;
}

Here are the error outputs:

http://pastie.org/3678144

I’m compiling with the /clr flag.

  • 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-01T01:50:59+00:00Added an answer on June 1, 2026 at 1:50 am

    The header declares DLL import, which means the definition of the class comes from a DLL. Since you are providing the definition, this gives the linkage error. You’ll want to use __declspec(dllexport) instead when defining the DLL.

    Since you’ll want to use the same header file in the app that will use the DLL, the following idiom is often used:

    #ifdef MYAPI_EXPORTS
    #   define MYAPI __declspec(dllexport)
    #else
    #   define MYAPI __declspec(dllimport)
    #endif
    

    And then use:

    class MYAPI KinectRecognizer
    

    #define MYAPI_EXPORTS before including the header in the DLL, but do not define it in the application using the header to import the DLL.

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

Sidebar

Related Questions

I'm following this tutorial here http://www.kriesi.at/archives/create-a-multilevel-dropdown-menu-with-css-and-improve-it-via-jquery on adding a menu with jquery. I've created
I'm following this tutorial to create custom Wordpress options the function within theme/functions/admin-menu.php which
I'm following the tutorial here: http://docs.jquery.com/Plugins/Authoring I just wanted to create a simple plugin
I'm following CodeIgniter's tutorial Create a blog in 20 minutes and I am having
I'm using the following tutorial http://developer.android.com/resources/tutorials/views/hello-mapview.html in order to create a map view and
Following the intro cakephp tutorial to create a blog, I created a database to
I am following the http://wiki.fluentnhibernate.org/Getting_started tutorial to create my first NHibernate project with Fluent
I'm currently following a tutorial in a book, and it instructs to create a
i have made a simple php contact form following this tutorial: http://www.catswhocode.com/blog/how-to-create-a-built-in-contact-form-for-your-wordpress-theme The big
I'm folowing this tutorial to create php/jquery based chat application. In short, this code

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.