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.
Off topic question. http://forums.next.codeblocks.org/index.php/topic,9996.0.html (http://forums.next.codeblocks.org/index.php/topic,9996.0.html)
-D defines a macro in C/C++ it likely does the same in gfortran.
Tim S.
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.
Quote from: 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.
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
#ifdef BUILD_DLL
do something
#else
do something else
#endif