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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T12:19:49+00:00 2026-05-29T12:19:49+00:00

I have a simple native ++ console application in visual C++. In order to

  • 0

I have a simple native ++ console application in visual C++.

In order to use NLog there is a mixed mode ” “NLogC.dll”

  • How can i add “NLogC.dll” to my application
  • And use for logging?

Simply how can i use Nlog in a native C++ Application?

  • 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-29T12:19:51+00:00Added an answer on May 29, 2026 at 12:19 pm

    NLog includes a header file (NLogC.h) and import library (NLogC.lib). Those should be used to use the library.

    Add the path to the include file (e.g. C:\Program Files (x86)\NLog\.NET Framework 4.0\NLogC\include) to the include path, either globally or for the project only. You can specify it in the project’s properties under “Additional Include Directories” under Configuration Properties, C/C++, General. Add the path to the library file (e.g. C:\Program Files (x86)\NLog\.NET Framework 4.0\NLogC\x86; make sure to pick x86 or x64 based on the architecture you’re targeting) to the library path (“Additional Library Directories” under Configuration Properties, Linker, General).

    Add the NLogC.lib file to the project’s libraries (add it to “Additional Dependencies” under Configuration Properties, Linker, Input).

    Then, you can use the API like this:

    #include <cstdarg> // Needed for va_list type, which NLogC.h requires
    #include <NLogC.h>
    
    int main()
    {
        NLog_Info(L"Test", L"TestMessage");
    
        return 0;
    }
    

    Make sure you put NLogC.dll, NLog.dll, and a suitable configuration file in the same directory as your executable.

    Note that this is really only intended to be used when you have native components as part of a larger, managed application, or are transitioning from native to managed. If your application is pure C++, there are likely more suitable native logging libraries that don’t require loading the CLR just to do logging.

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

Sidebar

Related Questions

I have a relatively simple application which I need to make native Mac OSX
I have created a simple native application using Blackberry API's. Application contains only a
I have a simple Android native java application that reads data from a Bluetooth
CouchDB, version 0.10.0, using native erlang views. I have a simple document of the
I have a Listbox with some items on a page. Is there any simple
The setup I have is I'm using a Java application to call native C-code
I have many C/C++ old native .exe and .dll programs running on Windows servers
I have a simple C# 2008 application which displays a png-picture and handles some
We have a large console application in Haskell that I have been charged with
I have a simple question: is there a way in Windows Mobile to schedule

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.