{"id":4819,"date":"2013-10-18T05:05:12","date_gmt":"2013-10-17T18:05:12","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=4819"},"modified":"2016-01-22T10:10:01","modified_gmt":"2016-01-22T00:10:01","slug":"codeblocks-fortran-dll-primer-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/codeblocks-fortran-dll-primer-tutorial\/","title":{"rendered":"Code::Blocks Fortran DLL Primer Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/CodeBlocks\/Fortran\/\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"Code::Blocks Fortran DLL Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/CodeBlocks\/Fortran\/CodeBlocks_Fortran_Primer-102of.jpg\" title=\"Code::Blocks Fortran DLL Primer Tutorial\" \/><\/a><p class=\"wp-caption-text\">Code::Blocks Fortran DLL Primer Tutorial<\/p><\/div>\n<p>The tutorial today is about a programming IDE called Code::Blocks, and we use this to create a project in which a Fortran Windows 32bit application calls a Fortran <a target=_blank title='DLL information from Wikipedia' href='http:\/\/en.wikipedia.org\/wiki\/Dynamic_link_library'>DLL<\/a> doing some simple work with a two-dimensional array (and saying <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/CodeBlocks\/Fortran\/hello.html\" title='hello'>hello<\/a> &#8230; bienvenuto &#8230; selamat pagi &#8230; g&#8217;day).<\/p>\n<p>Programming <a target=_blank title='IDE information from Wikipedia' href='http:\/\/en.wikipedia.org\/wiki\/IDE\u200e'>IDE<\/a>s take a lot of the hard work out of tasks such as compiling and linking in languages such as D, Matlab, Fortran (Code::Blocks) or Java, C, C++, VB.Net and C# (NetBeans) &#8230; and please know that there are many other languages and many other IDEs.   In the case of Code::Blocks IDE, which this blog reintroduces to you today (it&#8217;s customary to shake hands, and no <a target=_blank title='pardon?' href='http:\/\/www.youtube.com\/watch?v=SGZV6fsotYo'>Klingon<\/a> is necessary), it can create a C++ Win32  GUI  project environment.   To cut a long story short, there aint nothin&#8217; wrong with a good ol&#8217; IDE, but beware of IDEs in <a target=_blank title='Ides of March' href='https:\/\/www.youtube.com\/watch?v=Je0gTnheVe4'>March<\/a>.<\/p>\n<p>In saying that about IDEs, and how they make programming easier, often with Open Source programming, it is advantageous to know what goes on &#8220;under the hood&#8221; (or even &#8220;in the &#8216;hood&#8221; &#8230; chortle, chortle).   So if you ever get an opportunity to get helped creating your own makefile (or make it yourself, even with the <a target=_blank title='Sweet Green Icing' href='http:\/\/www.youtube.com\/watch?v=CPMpeNDIGdk'>Sweet Green Icing<\/a> &#8230; knew it could be worked in!) for something, take the opportunity to learn how to do this, as the Open Source world will become a little easier to navigate with such types of knowledge.   You&#8217;ve got to admire those early designers of computer languages, and those days when all you had was this tiny bit of memory (<a target=_blank title='64k' href='http:\/\/www.crashonline.org.uk\/39\/z88.htm'>64k<\/a> or <a target=_blank title='Voyager computer system' href='http:\/\/www.activeastronomy.org\/Home\/daniel'>&#8220;into the heliosphere on 8,000 bytes of memory&#8221;<\/a>) to play with to create your program.   <\/p>\n<p>In today&#8217;s <a target=_blank title='click on picture' href=\"http:\/\/www.rjmprogramming.com.au\/CodeBlocks\/Fortran\/\">tutorial<\/a> we write a simple Fortran Windows 32bit application that calls a DLL.   <\/p>\n<p>Points of some interest (with thanks for tutorials) are:<\/p>\n<ul>\n<li>Code::Blocks can live with two or more compiler definition sets &#8230; this tutorial uses GNU Fortran &#8230; after &#8220;up the garden path&#8221; with &#8220;Simply Fortran&#8221;<\/li>\n<li><a target=_blank title='Useful tutorial' href='http:\/\/gcc.gnu.org\/wiki\/GFortranBinaries#Windows'>Useful tutorial<\/a><\/li>\n<li><a target=_blank title='Useful tutorial' href='http:\/\/stackoverflow.com\/questions\/13916825\/using-fortran-dll-in-vb'>Useful tutorial2<\/a> (with array code)<\/li>\n<li><a target=_blank title='Useful tutorial3' href='http:\/\/software.intel.com\/en-us\/forums\/topic\/289141'>Useful tutorial3<\/a><\/li>\n<li><a target=_blank title='Useful tutorial4' href='http:\/\/www.codeproject.com\/Tips\/456681\/C-Fortran-Interoperability-With-External-Fortran-F'>Useful tutorial4<\/a><\/li>\n<li><a target=_blank title='Useful tutorial5' href='http:\/\/forums.codeblocks.org\/index.php?topic=15810.5;wap2'>Useful tutorial5<\/a><\/li>\n<li><a target=_blank title='Useful tutorial6' href='https:\/\/docs.google.com\/viewer?a=v&#038;pid=forums&#038;srcid=MTcwMjQ1ODUxNTQwODEzMTAyNDABMDk2NzExMzc5NDU0NzQ4MjUwNTkBSFVTbUs5aEoyUnNKATQBAXYy'>Useful tutorial6<\/a> (good overall view of installs required)<\/li>\n<\/ul>\n<p>Code::Blocks can be an IDE for much more than Fortran &#8230; it can supervise C++ and C, D, Matlab, Fortran, ARM, AVR, Direct\/X, FLTK, GLFW, GLUT, GTK+, Irrlicht, Lightfeather, MCS51, Ogre, OpenGL, PowerPC, QT4, SDL, SFML, STL port, SmartWin, TriCore and wxWidgets projects.<\/p>\n<p>Link to Code::Blocks &#8220;spiritual home&#8221; download page at <a target=_blank title='Code::Blocks download page' href='http:\/\/www.codeblocks.org\/downloads'>Code::Blocks<\/a>.<\/p>\n<p>Link to some downloadable Fortran DLL programming source code &#8230; rename to <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/CodeBlocks\/Fortran\/main.f95-GETME' title='main.f90'>main.f90<\/a><br \/>\nLink to some downloadable Fortran application programming source code &#8230; rename to <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/CodeBlocks\/Fortran\/main.f95_GETME' title='main.f95'>main.f95<\/a>\n<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d4819' onclick='var dv=document.getElementById(\"d4819\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?tag=Fortran\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d4819' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>The tutorial today is about a programming IDE called Code::Blocks, and we use this to create a project in which a Fortran Windows 32bit application calls a Fortran DLL doing some simple work with a two-dimensional array (and saying hello &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/codeblocks-fortran-dll-primer-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,12,37],"tags":[220,346,370,456,506,997,1319],"class_list":["post-4819","post","type-post","status-publish","format-standard","hentry","category-codeblocks","category-elearning","category-tutorials","tag-codeblocks","tag-dll","tag-dynamic-link-library","tag-fortran","tag-gnu-fortran","tag-programming","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/4819"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=4819"}],"version-history":[{"count":1,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/4819\/revisions"}],"predecessor-version":[{"id":19664,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/4819\/revisions\/19664"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=4819"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=4819"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=4819"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}