Author Topic: Linking DLLs  (Read 5090 times)

Offline GordonBlue

  • Single posting newcomer
  • *
  • Posts: 2
Linking DLLs
« on: August 27, 2016, 07:36:50 pm »
Hi All,
I'm a FORTRAN programmer just learning to use code::blocks. 
I'm using Windows-10.  When I produce a release EXE from code::blocks and try to run it I get a message that 3 DLLs are required with the EXE.  They are: libgfortran-3.dll, libquadmath-0.dll & libgcc_s_sjlj-1.dll

I have found these files and put copies with the EXE.  The code then runs, however I would like to be able to link with the equivalent libraries so that the code is portable without providing copies of these DLLs.

Can anyone advise what to link to and how to do it
Thanks

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Linking DLLs
« Reply #1 on: August 28, 2016, 02:32:23 pm »
Note: I am not familiar with fortran

you have to add this options to your linker settings:
Project->Build options->Linker settings->Other linker options

make sure you rebuild your project with
Build->Rebuild

for libgfortran-3.dll:
https://gcc.gnu.org/onlinedocs/gfortran/Link-Options.html

for the other dlls i don't searched future... Just google static linking libname
The exact compiler options are out of scope of this forum, This forum helps, if you have a question like "How do i apply setting X/Y" or "I want to add linking option X/Z how do i do that?" but not for questions like "I want to have the compiler do X, how are the compiler flags for this?"

greetings