Simple Barchart with Dislin error

General FreeBASIC programming questions.
rnbas
Posts: 35
Joined: Jul 22, 2019 18:54

Simple Barchart with Dislin error

Postby rnbas » Jul 26, 2019 0:41

I am trying to use Dislin (http://www2.mps.mpg.de/dislin/ and https://www.mps.mpg.de/dislin) to plot a simple bar chart with following code:

Code: Select all

#include once "dislin.bi"

METAFL ("CONS")
DISINI
NAME ("X-axis", "X")
NAME ("Y-axis", "Y")
TITLIN ("This is a Title", 2)

DIM intarr(...) as integer = {1,2,3,4,5,6}

QPLBAR(intarr(), ubound(intarr)+1)
END

However, it is giving following error:

Code: Select all

rndislin_bar.bas(13) warning 1(1): Passing scalar as pointer, at parameter 1 of QPLBAR()
rndislin_bar.bas(13) error 1: Argument count mismatch, found '(' in 'qplbar(intarr(), ubound(intarr)+1)'

Where is the problem and how can it be solved?
Function listing is at: http://www2.mps.mpg.de/dislin/dishlp.html
Thanks for your help.
srvaldez
Posts: 2518
Joined: Sep 25, 2005 21:54

Re: Simple Barchart with Dislin error

Postby srvaldez » Jul 26, 2019 0:50

not tested, try

Code: Select all

#include once "dislin.bi"

METAFL ("CONS")
DISINI
NAME ("X-axis", "X")
NAME ("Y-axis", "Y")
TITLIN ("This is a Title", 2)

DIM intarr(...) as DISLIN_TYPE = {1,2,3,4,5,6}

QPLBAR(@intarr(0), ubound(intarr)+1)
END

rnbas
Posts: 35
Joined: Jul 22, 2019 18:54

Re: Simple Barchart with Dislin error

Postby rnbas » Jul 26, 2019 3:13

Yes, it work and the error goes away.
Some explanation on how it works will be very helpful.

However, now I am getting following error:

Code: Select all

ld: cannot find -ldislnc

I am working on Debian Stable Linux. I have downloaded dislin and unzipped it. There are following library files in the folder:

Code: Select all

-rw-r--r-- 1 cardio cardio 2094588 May 19 22:14 dismg_d.a
-rw-r--r-- 1 cardio cardio 2086744 May 19 22:14 dismg.a
-rw-r--r-- 1 cardio cardio 1420288 May 19 22:14 dislnc.dll
-rw-r--r-- 1 cardio cardio 995328 Nov 11  2011 disdmc.lib
ls: cannot access '*.so': No such file or directory

How can I get dislnc library in Linux to correct my error?
jdebord
Posts: 529
Joined: May 27, 2005 6:20
Location: Limoges, France
Contact:

Re: Simple Barchart with Dislin error

Postby jdebord » Jul 26, 2019 8:02

Are you sure to have downloaded the Linux distribution ? You should have dislin(...).so and dislin_d(...).so (dislin_d is for double precision)

The .dll files are for Windows.

The Linux distributions are here:

https://www.mps.mpg.de/dislin/linux
srvaldez
Posts: 2518
Joined: Sep 25, 2005 21:54

Re: Simple Barchart with Dislin error

Postby srvaldez » Jul 26, 2019 12:21

I think that you need to install the libraries, probably in /usr/local/lib , after installing the libs, you may also need to issue the command:
sudo ldconfig
or you could install the libs in /usr/local/lib/freebasic, but this is not the norm
rnbas
Posts: 35
Joined: Jul 22, 2019 18:54

Re: Simple Barchart with Dislin error

Postby rnbas » Jul 26, 2019 12:38

Yes, it worked after installing deb file downloaded from https://www.mps.mpg.de/dislin/linux-i568-64-bit

Return to “General”

Who is online

Users browsing this forum: Bing [Bot] and 3 guests