Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: demone on December 31, 2011, 04:22:12 pm

Title: dll components
Post by: demone on December 31, 2011, 04:22:12 pm
I have a little question. When I was using cmake i used to create separated libraries from object files. Then I was just linking those libraries into 1 dll.

How can I do that with c::b?

What I need to do is to compile some c++ code into object files (using of course dllexport attribute when compiling since I'm under windows).
But I don't want to make immediatly a dll from them.
The point is that I'm using many packages so I want to compile every package separated with a different c::b project file for each package. After that I want to link all the libraries into 1 big dll. The main reason for doing that is that the final user has to link only with the final library instead of adding links to every single package (there are also other reasons).

Since merging dlls is not possible I wanted as previously done with Cmake to keep object files as object file and then link them as last step.

How can I achieve that with C::B?

C::B is a very good IDE, I don't want to turn back using Cmake.
Title: Re: dll components
Post by: stahta01 on December 31, 2011, 04:28:41 pm
I would link the separate projects as static libraries; and then link the static libraries into the final DLL project.

The other option is to turn off the linking for each source file.

Tim S.
Title: Re: dll components
Post by: demone on January 01, 2012, 05:02:50 pm
I tried this but didn't worked. When I create the project that should link all "static" libraries into 1 big dll the IDE tell me that there's nothing to build so it skips linking.

I'm really in trouble with that.
Title: Re: dll components
Post by: stahta01 on January 01, 2012, 10:51:31 pm
You DO NOT put the main entry point for the DLL in a static library.

You have that code in the DLL project/target.

Tim S.
Title: Re: dll components
Post by: demone on January 11, 2012, 10:56:49 am
 do you know how to achieve what I want with C::B too?
Title: Re: dll components
Post by: demone on January 18, 2012, 08:25:16 pm
You DO NOT put the main entry point for the DLL in a static library.

I know that. but i tried also this. Also dlls are built from .o files. You can link .o files into a static lib or into another object file (what I want to do) and then create dlls from those object files.. I don't now nether if it is possible or not with C::B. I'm not writing plugins. Just a framework accessible through a single dll (wich is integrating other several frameworks of wich I have access to source code). And is preferrable to a static lib in my case. Is it possible for example move my makefiles to c::b for doing that?
Title: Re: dll components
Post by: stahta01 on January 18, 2012, 10:57:38 pm
Turn on full compiler logging and post the rebuild log in this thread.

http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F (http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F)

Tim S.