Author Topic: dll components  (Read 4836 times)

Offline demone

  • Multiple posting newcomer
  • *
  • Posts: 36
dll components
« 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.
processor: Intel Core 2 Quad.
ram: 4 GB
os: Vista
gfx card: Ati Radeon HD 5570

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: dll components
« Reply #1 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.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline demone

  • Multiple posting newcomer
  • *
  • Posts: 36
Re: dll components
« Reply #2 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.
processor: Intel Core 2 Quad.
ram: 4 GB
os: Vista
gfx card: Ati Radeon HD 5570

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: dll components
« Reply #3 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.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline demone

  • Multiple posting newcomer
  • *
  • Posts: 36
Re: dll components
« Reply #4 on: January 11, 2012, 10:56:49 am »
 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

Offline demone

  • Multiple posting newcomer
  • *
  • Posts: 36
Re: dll components
« Reply #5 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?
processor: Intel Core 2 Quad.
ram: 4 GB
os: Vista
gfx card: Ati Radeon HD 5570

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: dll components
« Reply #6 on: January 18, 2012, 10:57:38 pm »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org