after compiling CommonC++ and installing the DLL, LIB and headerfiles I tried out the following
code:
#include <c++/socket.h>
int main(int argc, char* argv[])
{
tcpstream client;
cout << "End" << endl;
return 0;
}
This little program showed me End as expected but terminated with a segmentation fault.
Leaving out the cout line fixed this problem...
The next things I added to the code was
client.open("www.foo.com:80");
client << "GET \ HTTP1.1" << endl << endl;
But the << resulted in another fault. I started my debugger and observed the Allocate()
methode which is called within open(). This methode sets the important gbuf and pbuf
buffers quite well. But right after returning to my main program I recognized that pbuf
and gbuf are not valid any more!
This and the compiler warnings (the one that points out that the iostream class is not
exportet out of the DLL) makes me think that the TCPStream will not work within DLL's
at all. Am I right? Is there anybody else out there with the same problems?
Will a library build fix this problem? I want to write a C++ wrapper around the OpenSSL and
need a portable library which provides threads and TCP sockets. I would love to help you
with this problem but I don't know much about this DLL stuff...
Kind regards,
Noel
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
after compiling CommonC++ and installing the DLL, LIB and headerfiles I tried out the following
code:
#include <c++/socket.h>
int main(int argc, char* argv[])
{
tcpstream client;
cout << "End" << endl;
return 0;
}
This little program showed me End as expected but terminated with a segmentation fault.
Leaving out the cout line fixed this problem...
The next things I added to the code was
client.open("www.foo.com:80");
client << "GET \ HTTP1.1" << endl << endl;
But the << resulted in another fault. I started my debugger and observed the Allocate()
methode which is called within open(). This methode sets the important gbuf and pbuf
buffers quite well. But right after returning to my main program I recognized that pbuf
and gbuf are not valid any more!
This and the compiler warnings (the one that points out that the iostream class is not
exportet out of the DLL) makes me think that the TCPStream will not work within DLL's
at all. Am I right? Is there anybody else out there with the same problems?
Will a library build fix this problem? I want to write a C++ wrapper around the OpenSSL and
need a portable library which provides threads and TCP sockets. I would love to help you
with this problem but I don't know much about this DLL stuff...
Kind regards,
Noel
Could you resubmit this as a bug report? (or maybe you already have...I will check that next...).