Bonjour,

J'ai un bout de code stupidissime qui passe un 'string' à une fonction et vice versa:
#include "stdafx.h"
#include <string>
using std::string;

string DLLstr;

string Get_StringName(){ return DLLstr; }

void Set_StringName(string str){ DLLstr = str; }

int _tmain()
{
string str = "str1";
Set_StringName(str);
string samestr = Get_StringName();
return 0;
}

J'ai par ailleurs besoin de faire de même de/vers une DLL style:
extern "C" class __declspec(dllexport) ClassName

Le Linker refuse obstinément avec le message d'erreur suivant:
c:\mydocs\visual studio 2005\projects\nxl_cpp\nxl_dll\nxl_dll.h(84) : warning C4251: 'CNXL_DLL::m_strNNName' : class 'std::basic_string<_Elem,_Traits,_Ax>' needs to have dll-interface to be used by clients of class 'CNXL_DLL'
1> with
1> [
1> _Elem=char,
1> _Traits=std::char_traits<char>,
1> _Ax=std::allocator<char>
1> ]

Il s'agit d'un simple string et accessors pour nommer chaque objet.
Que conseillez vous?

D'avance merci,
bv