Using Dislin with Freebasic

59 views
Skip to first unread message

hengre

unread,
Feb 9, 2025, 11:43:49 AMFeb 9
to dislin-users
Hello,
I have some questions using Freebasic with Dislin.
Is it possible to use Dislin for Freebasic parallel to Dislin for Fortran?
Are there any examples for setting compiler options?
Are other preconditions to be done
honestly, I am not much familar with freebasic

Regards 

Helmut Michels

unread,
Feb 9, 2025, 12:07:05 PMFeb 9
to dislin-users
Dear Hengre,

yes, this is possible. All 32- or 64-bit distributions of Dislin can be installed in the same directory. The libraries
and links utilities have individual names. Only, the 32- and 64-bit distributions of Dislin for a  compiler
should not be installed  in the same directory.

With best regards,

Helmut

hengre

unread,
Feb 9, 2025, 12:16:02 PMFeb 9
to dislin-users
Thank you for the quick answer.
But I don't understand it. First 2 sentences are clear. But what means the last one?
Regards

Helmut Michels

unread,
Feb 9, 2025, 12:32:36 PMFeb 9
to dislin-users
For example, there is a 32-bit distribution of Dislin for Mingw 32-bit and another 64-bit distribution for Mingw 64-bit.
Both distributions should not be installed in the same directory, since the distributions use identical library names.

With best regards,

Helmut

hengre

unread,
Feb 9, 2025, 12:44:41 PMFeb 9
to dislin-users
ohh, I didn't recognise the "or" in the first sentence and the "and" in the last one :-)
But now it is clear- Thanx

hengre

unread,
Feb 9, 2025, 4:10:51 PMFeb 9
to dislin-users
Hello again.
I was able to compile my first program with Freebasic and Dislin.
To run the EXE-file I had to ad the dislnc.dll in the folder where the EXE was. Is that the usual way or can the EXE compiled with static Library

I used the following command line

C:\FEM\Freebasic\FreeBASIC-1.10.1-win64\fbc -s console  -i C:\FEM\Freebasic\dislinfb\  -p   C:\FEM\Freebasic\dislinfb\  -l dislnc "test.bas"

Regards

Helmut Michels

unread,
Feb 10, 2025, 4:08:32 AMFeb 10
to dislin-users
Hi,

the DLL dislnc.dll is located in the 'win' subdirectory of the Dislin directory. It should be enough to add this
directory  to your PATH environment. You don't have to copy it to your current working directory.

With best regards,

Helmut

hengre

unread,
Feb 10, 2025, 2:16:00 PMFeb 10
to dislin-users
Hi,
yes that's clear for my PC, but if I want to share the program I need to provide the DLL, too?
Regards

Helmut Michels

unread,
Feb 10, 2025, 4:22:09 PMFeb 10
to dislin-users
Hi,

the Dislin distributions for FreeBASIC contains the import library dislnc.lib and the corresponding DLL dislnc.dll.
If you link your program with dislnc.lib, you have to distribute the DLL dislnc.dll together with your program, but
that's no problem. You are allowed to do this.

If you want to create a program that uses only static libraries, you can download the Dislin distribution for MingW
and link your program for example with the following command:

  fbc   -i c:\dislin64  -p c:\dislin64  -l dismg  -l user32  -l gdi32 -l opengl32  curve.bas

Tested with FreeBASIC 1.08.1 64-bit. For that case I have disabled the INCLIB statement in dislin.bi.

hengre

unread,
Feb 14, 2025, 3:34:48 PMFeb 14
to dislin-users
Hello, 
Sorry asking again, but I was not able to compile only with static libraries.

I tried
fbc   -i C:\FEM\Freebasic\dislinfb  -p c:\dislin  -l dismg  -l user32  -l gdi32 -l opengl32  test2.bas

and got this error
C:\FEM\Freebasic\FreeBASIC-1.10.1-win64\fbc   -i C:\FEM\Freebasic\dislinfb  -p c:\dislin  -l dismg  -l user32  -l gdi32 -l opengl32 "test2.bas"
C:\FEM\Freebasic\FreeBASIC-1.10.1-win64\bin\win64\ld.exe: cannot find -ldismg

Why ist the dismg library not found?

I have disabled the INCLIB statement in dislin.bi.  located in C:\FEM\Freebasic\dislinfb
' /****************************************************************/
' /**                        DISLIN.BI                           **/
' /** Date     : 15.03.2024                                      **/
' /** Functions: 797                                             **/
' /** Version  : 11.5.2, Windows, 64-bit                         **/
' /****************************************************************/
'  #INCLIB "dislnc"    'the shareable library for MS Visual C++ is used
NAMESPACE Dislin
EXTERN "C"
DECLARE SUB a...     _

I am using DISLIN installed in c:\dislin
**  Date   :   15.02.2020                                         **
**  Version:   11.3 / Windows 64-bit, gcc/g++/gfortran - Mingw64  **              **

and DISLIN for FREEBASIC installed in C:\FEM\Freebasic\dislinfb
******************************************************************
**  Date   :   15.03.2024                                       **
**  Version:   11.5.2  /  Windows 64-bit                      

Helmut Michels

unread,
Feb 17, 2025, 11:50:15 AMFeb 17
to dislin-users
Hi,

okay, I forgot to mention that I have a copy of dismg.a to libdismg.a in my directory, so that the -l
option was working for me, but you can also use the library dismg.a with an explicit path.
For example:

fbc   -i C:\FEM\Freebasic\dislinfb  -p c:\dislin  c:\dislin\dismg.a  -l user32  -l gdi32 -l opengl32  test2.bas
 
With best regards,

Helmut

hengre

unread,
Feb 17, 2025, 3:39:27 PMFeb 17
to dislin-users
Thank You,
it works fine now.
Regards
Reply all
Reply to author
Forward
0 new messages