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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T10:04:05+00:00 2026-05-21T10:04:05+00:00

EDIT: Forgive my noobish-ness, I haven’t ever implemented a wrapper .dll before! :S I’ve

  • 0

EDIT: Forgive my noobish-ness, I haven’t ever implemented a wrapper .dll before! :S

I’ve been tinkering a bit with some of the recently released Kinect Sensor hacks (namely OpenKinect and OpenNI) and I’m now trying to wrap the functionality in a *.dll for use in various “test” programs that I hope to write.

So far I’ve set up a *.dll project and have got a lot of the library functionality in, however I’m getting C4251 compiler warnings all over the place.

In the project settings I’ve got the OpenNI.lib file statically linked, so far my library header looks like this:

#ifdef LIBKINECT_EXPORTS
#define LIBKINECT_API __declspec(dllexport)
#else
#define LIBKINECT_API __declspec(dllimport)
#endif

// This class is exported from the LibKinect.dll
class LIBKINECT_API CLibKinect
{
public:

    CLibKinect(void);
    ~CLibKinect(void);

    bool Init(void);

protected:

private:

    xn::Context                     m_xContext;
    xn::DepthGenerator              m_xDepthGen;
};

And my stdafx.h file contains:

#pragma once

#define WIN32_LEAN_AND_MEAN             // Exclude rarely-used stuff from Windows headers
// Windows Header Files:
#include <windows.h>

#include <XnOpenNI.h>
#include <XnCodecIDs.h>
#include <XnCppWrapper.h>

Now I’ve attempted to create a windows console app to test the library and I get lots of error C2653: 'xn' : is not a class or namespace name errors. I was hoping that in the application I would only have to include and link to the wrapper *.dll not all of the OpenNI stuff as well, so as to hide the underlying implementation, is this incorrect?

  • 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-21T10:04:05+00:00Added an answer on May 21, 2026 at 10:04 am

    Since you want to hide the fact you are using xn namespace in your implementation, you should not put that in the library header file. The simplest way to solve this problem is to use the pimpl idiom.

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

Sidebar

Related Questions

Forgive me if this has been asked before; I did a search but couldn't
EDIT: Duplicate of Should Entity Framework Context be Put into Using Statement? I've been
Edit: You can get the full source here: http://pastebin.com/m26693 Edit again: I added some
This is my first post, so please forgive me if this question has been
Hey everyone, I made sure there wasn't a similar discussion before posting but forgive
Forgive me if my understanding of this topic has some shortcomings, I only know
EDIT : see bottom First off I searched for an answer before asking this
Forgive me if this is a bit garbled, I'm a bit new on Windows
Edit: Added token struct/enum to code block I'm new to c++, so forgive me
Forgive the title, wasn't sure what to put. I have some code like: var

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.