Bonjour a tous,

Voila j'ai ce code :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#define _CRT_SECURE_NO_DEPRECATE
#include "ModuleInterface.h"
#include <vector>
#include <string>
 
typedef std::pair<std::string, std::string> DeviceInfo; 
std::vector<DeviceInfo> g_availableDevices;
 
MODULE_API long GetModuleVersion();
 
long GetModuleVersion()
{
   return MODULE_INTERFACE_VERSION;   
}
 
MODULE_API long GetDeviceInterfaceVersion()
{
   return DEVICE_INTERFACE_VERSION;   
}
 
void AddAvailableDeviceName(const char* name, const char* descr)
{
   std::vector<DeviceInfo>::const_iterator it;
   for (it=g_availableDevices.begin(); it!=g_availableDevices.end(); ++it)
      if (it->first.compare(name) == 0)
         return; // already there
 
   // add to the list
   g_availableDevices.push_back(std::make_pair(name, descr));   
}
 
MODULE_API unsigned GetNumberOfDevices()
{
   return (unsigned) g_availableDevices.size();
}
 
MODULE_API bool GetDeviceName(unsigned deviceIndex, char* name, unsigned bufLen)
{
   if (deviceIndex >= g_availableDevices.size())
      return false;
 
   if (g_availableDevices[deviceIndex].first.length() >= bufLen)
      return false; // buffer too small, can't truncate the name
 
   strcpy(name, g_availableDevices[deviceIndex].first.c_str());
   return true;
}
 
MODULE_API bool GetDeviceDescription(unsigned deviceIndex, char* description, unsigned bufLen)
{
   if (deviceIndex >= g_availableDevices.size())
      return false;
 
   strncpy(description, g_availableDevices[deviceIndex].second.c_str(), bufLen-1);
   return true;
}


Quand je fais "Générer la solution" il me met ces erreurs :
1>ModuleInterface.cpp
1>c:\program files\stage\micro-manager1.2\mmdevicekit-win-26_00\mmdevice\moduleinterface.cpp(36) : warning C4273: 'GetModuleVersion' : liaison DLL incohérente
1> c:\program files\stage\micro-manager1.2\mmdevicekit-win-26_00\mmdevice\moduleinterface.h(65) : voir la définition précédente de 'GetModuleVersion'
1>c:\program files\stage\micro-manager1.2\mmdevicekit-win-26_00\mmdevice\moduleinterface.cpp(41) : error C2491: 'GetDeviceInterfaceVersion' : définition de fonction dllimport non autorisée
1>c:\program files\stage\micro-manager1.2\mmdevicekit-win-26_00\mmdevice\moduleinterface.cpp(57) : error C2491: 'GetNumberOfDevices' : définition de fonction dllimport non autorisée
1>c:\program files\stage\micro-manager1.2\mmdevicekit-win-26_00\mmdevice\moduleinterface.cpp(62) : error C2491: 'GetDeviceName' : définition de fonction dllimport non autorisée
1>c:\program files\stage\micro-manager1.2\mmdevicekit-win-26_00\mmdevice\moduleinterface.cpp(74) : error C2491: 'GetDeviceDescription' : définition de fonction dllimport non autorisée
Pouvez m'aider et me dire ce qui ne va pas ???
Merci d'avance!!