Author Topic: What is -DBUILD_DLL  (Read 520 times)

Offline rltang

  • Single posting newcomer
  • *
  • Posts: 2
What is -DBUILD_DLL
« on: August 15, 2018, 02:07:37 pm »
When I use codeblocks to make a Fortran DLL, I see something like the following command (I deleted the directories to make it look simpler):

gfortran -Wall -DBUILD_DLL -g -c myMultiply.f90

My question is about the option -DBUILD_DLL. Is it an option of gfortran? I checked the web about the options of gfortran. It seems that -DBUILD_DLL is not listed. Is it something special from codeblocks?

Can someone tell me what it is? Thanks a lot.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6359
    • My Best Post
Re: What is -DBUILD_DLL
« Reply #1 on: August 15, 2018, 04:50:19 pm »
Off topic question. http://forums.codeblocks.org/index.php/topic,9996.0.html

-D defines a macro in C/C++ it likely does the same in gfortran.

Tim S.
« Last Edit: August 15, 2018, 04:52:43 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline rltang

  • Single posting newcomer
  • *
  • Posts: 2
Re: What is -DBUILD_DLL
« Reply #2 on: August 15, 2018, 05:25:15 pm »
Thanks. Now I see the meaning of -DBUILD_DLL.

Would you please tell me how to find the content of the macro BUILD_DLL in Codeblocks? I am new to Codeblocks. So my question perhaps is naive. Sorry about that.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2060
Re: What is -DBUILD_DLL
« Reply #3 on: August 15, 2018, 06:03:17 pm »
Thanks. Now I see the meaning of -DBUILD_DLL.

Would you please tell me how to find the content of the macro BUILD_DLL in Codeblocks? I am new to Codeblocks. So my question perhaps is naive. Sorry about that.
This has nothing to do with codeblocks... Codeblocks is a text editor. It does only what you tell it to do. So somewhere in the project you (or some template) told the compiler to define BUILD_DLL... What the library you use does with it has nothing to do with codeblocks... It is probably used by your standard library, or some unused legacy thing...

EDIT:
there is no content of BUILD_DLL ... this simply is used in code like this
Code: [Select]
#ifdef BUILD_DLL
 do something
#else
 do something else
#endif