473,405 Members | 2,310 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

dll entry point not found

I'm trying to call my C++/CLI dll from a C# library. I gives me the error

unable to find an entry point named GetA

Here's my C++/CLI file:

#pragma once

//#ifdef WRAPPERAPI_EXPORTS
//#define WRAPPER_API extern "C" __declspec(dllexport)
//#else
//#define WRAPPER_API extern "C" __declspec(dllimport)
//#endif

#include "windows.h"
#include "Common.h"

namespace Wrapper
{
int GetA();
int GetB();
void Preinitialize();
}

As you can see I have also tried with a module definition file, but it
didn't work (perhaps it is not supposed to work with C++/CLI libraries?).

In dependency walker there seem to be no functions listed. I'm not sure if
it should show with a C++/CLI module...?

I know I had this project working before... :(
May 11 '07 #1
3 9497
Hi Joachim,

Joachim wrote:
I'm trying to call my C++/CLI dll from a C# library. I gives me the
error unable to find an entry point named GetA

Here's my C++/CLI file:

#pragma once

//#ifdef WRAPPERAPI_EXPORTS
//#define WRAPPER_API extern "C" __declspec(dllexport)
//#else
//#define WRAPPER_API extern "C" __declspec(dllimport)
//#endif

#include "windows.h"
#include "Common.h"

namespace Wrapper
{
int GetA();
int GetB();
void Preinitialize();
}
I am not sure if a namespace mangles the names? I woudl expect that it does.
So move the exported functions into the global namespace and use your
WRAPPER_API define:

WRAPPER_API int GetA();
WRAPPER_API int GetB();
As you can see I have also tried with a module definition file, but it
didn't work (perhaps it is not supposed to work with C++/CLI
libraries?).
You still need a def file to avoid name mangling
In dependency walker there seem to be no functions listed. I'm not
sure if it should show with a C++/CLI module...?
Please recheck in Depends after you changed the above.

--
SvenC

May 11 '07 #2
Hi SvenC,

There is a bug in VS2005 (VC8), some dll entry point couldn't be
found....
I dont know if this is exacly the problem of yours...but it worth a try.....

[Solution of workaround]
Open the project of your VC++ dll,

Project | XXX Properties ->
Configuration Properties -General -Use of MFC
Change from "Use Standard Windows Libraries" to "Use MFC in a Static
Library"
and then rebuild the project for the first time, this will add some
missing components into your dll.......

finally swith back to "Use Standard Windows Libraries" and rebuild for
the 2nd time.....you ll have the final workable .dll........
Try it......hope this is helpful


"SvenC" wrote:
Hi Joachim,

Joachim wrote:
I'm trying to call my C++/CLI dll from a C# library. I gives me the
error unable to find an entry point named GetA

Here's my C++/CLI file:

#pragma once

//#ifdef WRAPPERAPI_EXPORTS
//#define WRAPPER_API extern "C" __declspec(dllexport)
//#else
//#define WRAPPER_API extern "C" __declspec(dllimport)
//#endif

#include "windows.h"
#include "Common.h"

namespace Wrapper
{
int GetA();
int GetB();
void Preinitialize();
}

I am not sure if a namespace mangles the names? I woudl expect that it does.
So move the exported functions into the global namespace and use your
WRAPPER_API define:

WRAPPER_API int GetA();
WRAPPER_API int GetB();
As you can see I have also tried with a module definition file, but it
didn't work (perhaps it is not supposed to work with C++/CLI
libraries?).

You still need a def file to avoid name mangling
In dependency walker there seem to be no functions listed. I'm not
sure if it should show with a C++/CLI module...?

Please recheck in Depends after you changed the above.

--
SvenC
May 20 '07 #3

"SvenC" <Sv***@community.nospamwrote in message
news:D3**********************************@microsof t.com...
Hi Joachim,

Joachim wrote:
>I'm trying to call my C++/CLI dll from a C# library. I gives me the
error unable to find an entry point named GetA

Here's my C++/CLI file:

#pragma once

//#ifdef WRAPPERAPI_EXPORTS
//#define WRAPPER_API extern "C" __declspec(dllexport)
//#else
//#define WRAPPER_API extern "C" __declspec(dllimport)
//#endif

#include "windows.h"
#include "Common.h"

namespace Wrapper
{
int GetA();
int GetB();
void Preinitialize();
}

I am not sure if a namespace mangles the names? I woudl expect that it
does.
It does for C++ names, but not for extern "C" identifiers.
So move the exported functions into the global namespace and use your
WRAPPER_API define:

WRAPPER_API int GetA();
WRAPPER_API int GetB();
>As you can see I have also tried with a module definition file, but it
didn't work (perhaps it is not supposed to work with C++/CLI
libraries?).

You still need a def file to avoid name mangling
>In dependency walker there seem to be no functions listed. I'm not
sure if it should show with a C++/CLI module...?

Please recheck in Depends after you changed the above.

--
SvenC

May 22 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Darek | last post by:
Hi there; I was trying to apply SQL SP3a on my windows 2000 server (SP4), but the installation failed and when I rebooted my server the SQL agent failed to start and I get the following error:...
1
by: Eric | last post by:
Hi All! Has anyone has seen this error before? Event Type: Information Event Source: Application Popup Event Category: None Event ID: 26 Date: 5/14/2004 Time: 10:06:45 AM
0
by: Sam Fields | last post by:
I have found very little regarding the error "Unable to find an entry point named EnumerateSecurityPackagesW in DLL security.dll. ". I have an ASP.NET Web Service being accessed via SSL. I found...
1
by: kpd | last post by:
I am using distutils and mingw to create an extension from some C++ code for Python 2.4.1. It builds fine, but on import the following error comes up: python.exe - Entry Point Not Found The...
5
by: Mike in Santa Rosa | last post by:
I'm trying to get a simple c# app built that can launch/manipulate an excel workbook, sheet. I've chased down several examples and can't any of them to work. So I must be doing somethnig obviouslt...
0
by: allan_mclellan | last post by:
Under W2K I am using DB2 V8.2. I have a program that is using the CLI. When I run it on a workstation that doesn't have the DB2 client installed (but does have the DB2 DLL's present) I would expect...
20
by: hippomedon | last post by:
Hello everyone, I'm looking for some advice on whether I should break the normalization rule. Normally, I would not consider it, but this seems to be a special case. I have created an...
0
by: =?Utf-8?B?R2Vvcmdl?= | last post by:
Hello everyone, I have built MSDN OLE DB Sample Provider and successfully built/debug it using Microsoft Excel as client. I have found that in DllGetClassObject (classfac.cpp), the class...
2
by: FFrozTT | last post by:
I am having a problem creating a DLL with an entry point. I've been trying sub Main, DllMain, and I get nothing. When I run dumpbin - exports mydll.dll I see no entry points, also the dll when...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.