Bonjour a tous,...

Voici la situation,...

j'ai un fichier .h que j'aimerais utiliser dans une projet c#

pour ce faire il faut passer par un Wrapper de ce fichier .h en c++ sous forme de .dll intégrable par la suite dans le projet c#

le fichier source lightstone.h

Code : Sélectionner tout - Visualiser dans une fenêtre à part
LIGHTSTONE_DECLSPEC lightstone* lightstone_create();
dans un projet c++ CLR bibliotheque de class

LightStoneA.h

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
 
// LightStoneA.h
 
#include "lightstone/lightstone.h"
#pragma once
 
 
	public ref class LightStoneWrapper
	{
		public:
 
			lightstone* lightstone_createW();
        }
le fichier LightStoneA.cpp

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
#include "LightStoneA.h"
 
lightstone* LightStoneWrapper::lightstone_createW()
{
	return lightstone_create();
}

j'obtiens 3 erreurs;...

Code : Sélectionner tout - Visualiser dans une fenêtre à part
Erreur	1	error LNK2028: jeton non rÚsolu (0A00004F) "extern "C" struct lightstone * __cdecl lightstone_create(void)" (?lightstone_create@@$$J0YAPAUlightstone@@XZ) rÚfÚrencÚ dans la fonction "public: struct lightstone * __clrcall LightStoneWrapper::lightstone_createW(void)" (?lightstone_createW@LightStoneWrapper@@$$FQ$AAMPAUlightstone@@XZ)	visual studio 2013\Projects\LightStoneA\LightStoneA\LightStoneA.obj	LightStoneA
Code : Sélectionner tout - Visualiser dans une fenêtre à part
Erreur	2	error LNK2019: symbole externe non rÚsolu "extern "C" struct lightstone * __cdecl lightstone_create(void)" (?lightstone_create@@$$J0YAPAUlightstone@@XZ) rÚfÚrencÚ dans la fonction "public: struct lightstone * __clrcall LightStoneWrapper::lightstone_createW(void)" (?lightstone_createW@LightStoneWrapper@@$$FQ$AAMPAUlightstone@@XZ)	visual studio 2013\Projects\LightStoneA\LightStoneA\LightStoneA.obj	LightStoneA
Code : Sélectionner tout - Visualiser dans une fenêtre à part
Erreur	3	error LNK1120: 2 externes non rÚsolus	c:\users\alamata\documents\visual studio 2013\Projects\LightStoneA\Debug\LightStoneA.dll	LightStoneA
...

une âme charitable pour éclairer ma lanterne ,...