News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

dll components

Started by demone, December 31, 2011, 04:22:12 PM

Previous topic - Next topic

demone

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.
processor: Intel Core 2 Quad.
ram: 4 GB
os: Vista
gfx card: Ati Radeon HD 5570

stahta01

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.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

demone

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.
processor: Intel Core 2 Quad.
ram: 4 GB
os: Vista
gfx card: Ati Radeon HD 5570

stahta01

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.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

demone

 do you know how to achieve what I want with C::B too?
processor: Intel Core 2 Quad.
ram: 4 GB
os: Vista
gfx card: Ati Radeon HD 5570

demone

Quote from: stahta01 on January 01, 2012, 10:51:31 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?
processor: Intel Core 2 Quad.
ram: 4 GB
os: Vista
gfx card: Ati Radeon HD 5570

stahta01

C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]