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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:12:38+00:00 2026-05-23T16:12:38+00:00

I am working on a project in Visual Studio 2010 which is to produce

  • 0

I am working on a project in Visual Studio 2010 which is to produce a win 32 dll file. The examples I have are C files and the compile and work well. I would like to incorporate some functionality from C++ function I’ve written but I have hit a bit of a wall.

If I attempt to link the C++ functions to the C program, it knows nothing about strings, etc and just doesn’t work at all (of course).

So I am left with changing the example into a C++ program, then I can use my other files with impunity. When I attempt to do this I get a link error that I don’t understand and am uncertain about how to resolve.

The examples use vendor provided headers, which include statements such as

 typedef void ( __cdecl *BINDING_PROC_BEVNT)(WORD_T choice, INT_T * pStatus, 
            I_EVNT_T  * pIn, O_EVNT_T  * pOut);

In the body of the main code, following the examples:

extern BINDING_PROC_BEVNT       b_evnt;

Which then allows you to write

b_evnt(choice, &status, &inpEvent, &outpEvent);

In a vendor provided C file, these are again referenced as:

BINDING_PROC_BEVNT      b_evnt; 
b_evnt = (BINDING_PROC_BEVNT)GetProcAddress(hCNCMod, "bevnt");

The linker error I am seeing is:

error LNK2001: unresolved external symbol “void (__cdecl* b_evnt)(unsigned short,short *,union I_EVNT_T *,union O_EVNT_T *)” (?b_evnt@@3P6AXGPAFPATI_EVNT_T@@PATO_EVNT_T@@@ZA)

If I rename my main file and recompile as a C program, and omit my C++ functions, everything compiles perfectly. Even when the main file is processed as a C++ file, Intellisense seems to recognize the definitions (hovering over shows the correct definitions).

Additionally I attempted to add extern “C” to a few different locations but it didn’t seem to make a difference in the C++ files, and generated a compile error in the C files (about not knowing about strings).

Any insight would be appreciated, I may have simply stared at this too long today to be picking up on something obvious, or it may be something I’m completely unaware of.

Thanks for the help!

  • 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-23T16:12:39+00:00Added an answer on May 23, 2026 at 4:12 pm
    error LNK2001: unresolved external symbol "void (__cdecl* b_evnt) 
    (unsigned short,short *,union I_EVNT_T *,union O_EVNT_T *)" 
    (?b_evnt@@3P6AXGPAFPATI_EVNT_T@@PATO_EVNT_T@@@ZA)
    

    That means, the C++ mangled variable b_evnt can’t be found. That’s true, because it should’ve been C mangled (just an _ prefix). To fix that, tell it to the compiler in the header when compiling for C++:

    #ifdef __cplusplus
    extern "C" BINDING_PROC_BEVNT       b_evnt;
    #else
    extern BINDING_PROC_BEVNT       b_evnt;
    #endif
    

    If that’s all, you’re done. If there are more symbols you need, you might want to use Greg’s solution instead – but be aware that that is also not a fixall.

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

Sidebar

Related Questions

I´m working on a project, in Visual Studio 2008, which DLL currently surpasses 20
Recently we started working with Database project in Visual Studio 2010. I have added
I have a dataset in a Visual Studio 2010 Web App project which accesses
I have a fully working Setup project within Visual Studio 2008 that takes inputs
I am working on a project which was developed in Visual Studio 2005 (.NET
I am working on an ASP.NET project in Visual Studio .NET 2010 and attempting
I am working with Visual Studio 2010 and it's integrated testing functionality. I have
So I'm working on a project which is built in the version visual studio
I have an Visual Studio 2010 ASP.Net project. And I want to deploy this
I am working on a project with the following conditions: Visual Studio 2010 ASP.NET

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.