News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

What is -DBUILD_DLL

Started by rltang, August 15, 2018, 02:07:37 PM

Previous topic - Next topic

rltang

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.

stahta01

#1
Off topic question. 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.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

rltang

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.

BlueHazzard

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