Code::Blocks Forums
User forums => Using Code::Blocks => Topic started by: demone on November 22, 2011, 12:22:19 pm
-
Is there a way for avoid a little problem?
1) I made a library. Wich has a public interface. The library uses internally in its implementation iostream for logging info to the console. that's ok iostream add 450 KB of size (more if I use debug symbols, but for debugging that's ok).
2) I use that library. If I need to print something I have to include iostream again.. and there are further 450KB ! so almost 1 MB of iostream because it was included twice.
I figured out some simple solutions for avoid the problem: one was wrapping iostream.. but this is not a very good idea. Unless i need a simple logger there is a lot of classes to wrap. And doing this loss partially template flexibility. There are lots of libraries wich can use standard input/output so wrapping iostream is totally a bad idea. I want to link the library once and forever. So that users of the library can still include iostream without increasing the size of the executable by 450 KB.
Does iostream.dll already exist? (or something similiar of course).
-
Not Code::Blocks related, I'm afraid. You need to ask questions like this on sites like stackoverflow. or reddit/learnprogramming.
-
Isn't there anycompiler options I can set through Code::blocks to avoid that problem? Maybe my question is a little bit clearer now.. Are you sure that c::b can't help in this?
-
No, there are no compiler options to do this. And even if there were, they would be specific to a specific compiler and platform, and once again off-topic here. Please ask this in the places I suggested.