Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: rltang on August 15, 2018, 02:07:37 pm

Title: What is -DBUILD_DLL
Post by: rltang 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.
Title: Re: What is -DBUILD_DLL
Post by: stahta01 on August 15, 2018, 04:50:19 pm
Off topic question. http://forums.codeblocks.org/index.php/topic,9996.0.html (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.
Title: Re: What is -DBUILD_DLL
Post by: rltang 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.
Title: Re: What is -DBUILD_DLL
Post by: BlueHazzard 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
#ifdef BUILD_DLL
 do something
#else
 do something else
#endif