Author Topic: Question about linking static libraries into a DLL  (Read 3897 times)

Offline GG_Rei

  • Single posting newcomer
  • *
  • Posts: 2
Question about linking static libraries into a DLL
« on: April 16, 2014, 03:03:43 am »
Hello guys. :)

Actually, in my codeblocks workspace, i have 2 projects :

1 - project for creating a DLL
2 - project for executable linked against the DLL

In my DLL project, i need to link and compile some static libraries in the DLL.

In the "Linkers Settings" in build options of my DLL project, i add in "Other Linker Options" :

Code
-Wl,--whole-archive
my/path/libproj1.a
-Wl,--no-whole-archive

Until now, no problem, my DLL compiles correctly. ( .dll + .a ).



In my main project ( executable linked against the DLL ), i configure the linker ( with the .a of my DLL project ) and i export the DLL project file header.

But when i compile my main project, i have an error :

"fatal error: path/file.h: No such file or directory"
because in the DLL project file header, i have the include of static libraries.

How can i fix that ? What I forgot ?

Thx in advance for your help.

Regards,

Rei


Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: Question about linking static libraries into a DLL
« Reply #1 on: April 16, 2014, 03:15:30 am »
Read this link http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F

After you figure out how to post a full re-build log; I suggest posting on another site like http://cboard.cprogramming.com/

I suggest under your OS group or C or C++ group.

Reason for this is this site rules. http://forums.codeblocks.org/index.php/topic,9996.0.html
Quote
1. This is NOT a general programming board. "How do I write a program that....", "Can anybody teach me how to", "I have this homework", "My program doesn't run and I don't have the slightest idea of why because I'm a C++ newcomer", "What is a compiler", "What does gcc do" is the kind of questions that is FORBIDDEN to ask.


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 GG_Rei

  • Single posting newcomer
  • *
  • Posts: 2
Re: Question about linking static libraries into a DLL
« Reply #2 on: April 16, 2014, 03:52:00 am »
My question is not really a problem with the programming but ok, i have understood. Needless to post here.

Thanks anyway

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: Question about linking static libraries into a DLL
« Reply #3 on: April 16, 2014, 04:03:11 am »
My question is not really a problem with the programming but ok, i have understood. Needless to post here.

Thanks anyway

If you think it is a CB Problem post the full re-build log in this thread.
Also, post the code line that caused the error.

Edit1: I would guess its likely may be both a CB [project] configuration error/issue and a source code issue.

Tim S.
« Last Edit: April 16, 2014, 04:15:21 am by stahta01 »
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