4 ms·
The first problem is actually not a problem but one of the reasons DLLs are better: private by default reduce linking problems. The second problem has got noth
by shin_lao 14y ago
The first problem is actually not a problem but one of the reasons DLLs are better: private by default reduce linking problems.
The second problem has got nothing to do with DLLs and everything to do with the fact that there is no C++ ABI.
As for memory allocation, it's not really a good idea to allocate memory in a library and free it in another, is it?
- npsimons 14y agoAs for memory allocation, it's not really a good idea to allocate memory in a library and free it in another, is it? Ah, I guess I'll have to stop using strdup() then.
- shin_lao 14y agostrdup(), part of the libc, allocates memory with a function from the libc (malloc), therefore you are allocating and freeing memory with functions within the same library. However, yes, for security reasons strdup should be avoided.