Re: std::string across DLL boundaries

2006-01-06 Thread Gerrit P. Haase
Ilia wrote: > Hi, > I've run into a problem passing a string ref to a dll: > testdll.C: (I've tried adding __declspec(dllimport/export) too) > void f(std::string& a) { a = "asdf"; } > test.C: > int main(void) { std::string a; f(a); std::cout << a << std::endl; } > If I compile it with static

Re: std::string across DLL boundaries

2006-01-06 Thread Pavel Tsekov
> Could someone either confirm that this is a problem, or, preferably, > provide instructions for getting this to compile "correctly"? (And if > this is a problem, are there known workarounds, is there a PR open > somewhere, etc) Follow this thread to learn more: http://www.cygwin.com/ml/cygwin

std::string across DLL boundaries

2006-01-03 Thread Ilia Mirkin
Hi, I've run into a problem passing a string ref to a dll: testdll.C: (I've tried adding __declspec(dllimport/export) too) void f(std::string& a) { a = "asdf"; } test.C: int main(void) { std::string a; f(a); std::cout << a << std::endl; } If I compile it with static linking, the program works