New Linux Install

Linux specific questions.
Post Reply
albert
Posts: 6000
Joined: Sep 28, 2006 2:41
Location: California, USA

New Linux Install

Post by albert »

Hello Guys ,

I just installed SUSE Linux 42.2 Leap And installed Geany IDE and FreeBASIC for Linux 64bit.

Where do i find *.bi files to equate to Windows API ?
I want to port my FB Windows progs to Linux.

How do you create windows and controls in Linux?
Can you use the C headers under FB ?

Thank you !!
caseih
Posts: 2157
Joined: Feb 26, 2007 5:32

Re: New Linux Install

Post by caseih »

Welcome to Linux, Albert. The "Linux API" consists of many parts, much of which is considered the Posix API. So if you want to do socket communication, work with the file system, make system calls, that's all done via the C library, which is exposed to FB using the .bi files in the "crt" directory of your FreeBASIC include directory. However, this is probably not going to be that useful to you as FB itself does most of what is in the C runtime.

As for making GUIs, Linux does not have a single, base GUI API that everything is based off of, unlike Windows. Instead graphics in Linux are extremely low-level and developers use higher-level toolkits, of which you have a few choices (and learning curves). Essentially, in my opinion, you have two options for FB in Linux: FLTK and GTK+.

A fair number of folks use FLTK, and if you search this forum you'll find the binding files you need. You will also have to use the SuSE software manager to install the fltk development package (not sure what it's called since I've never used SuSE).

GTK+ bindings ship with FreeBASIC in the "gtk" directory of the include directory. And I think there are some example files included as well that you can build. You will need the gtk3 development libraries installed. Might be already there by default.

As for using C header files, they must be translated, either by hand or with an automated tool like fbfrog to native FB .bi files.
WQ1980
Posts: 48
Joined: Sep 25, 2015 12:04
Location: Russia

Re: New Linux Install

Post by WQ1980 »

albert
How do you create windows and controls in Linux?
IUP (Portable User Interface)
http://webserver2.tecgraf.puc-rio.br/iup/
This is a good wrapper over Gtk(Linux)\WinApi(Win) + additional functions

Examples from D.J.Peters:
second message http://www.freebasic.net/forum/viewtopic.php?t=18500 (IUP 3.5)

(The actual headers are now 3.15, IUP latest version 3.21)
albert
Posts: 6000
Joined: Sep 28, 2006 2:41
Location: California, USA

Re: New Linux Install

Post by albert »

I was going through the Linux FB 64 examples and trying to compile the examples and most of them won't compile..

Especially the OpenGL stuff. if errors and says lglu not found.
badidea
Posts: 2591
Joined: May 24, 2007 22:10
Location: The Netherlands

Re: New Linux Install

Post by badidea »

For Ubuntu, I expect that this library is needed:
libglu1-mesa
Mesa OpenGL utility library (GLU)
On Linux, this library is also known as libGLU or libGLU.so.1.
albert
Posts: 6000
Joined: Sep 28, 2006 2:41
Location: California, USA

Re: New Linux Install

Post by albert »

For some reason the coders at SUSE 42.2 Leap forgot to build and include Mesa GLU and GLUT libs

you have to compile them from source ,
i got GLU working on my system

but the source for GLUT doesn't have any ./configure script so you can't just (./configure , make , make install ) you have to be a c programmer to compile it. The source is for Windows and BeOS only ???
albert
Posts: 6000
Joined: Sep 28, 2006 2:41
Location: California, USA

Re: New Linux Install

Post by albert »

I looked all over the internet and found a sourceforge project called FreeGlut

It was in the package mgr , so i donwloaded it and now all the glut programs all compile okay..

Some of the OpenGL examples for FB Linux 64 are still are missing libs though..
caseih
Posts: 2157
Joined: Feb 26, 2007 5:32

Re: New Linux Install

Post by caseih »

Your package manager (yast on SuSE?) should always be your first port of call when it comes to looking for libraries. I think you can search for libraries by name. For example, when fbc complains that lglu is not found, you can try to search the package manager for "libglu". Or just "glu."

Typically you don't compile and install from source if you absolutely don't have to. 99% of all the libraries you'll likely encounter are going to be in the package repositories that your distro includes. They may not be installed out of the box, but they will be available. Only obscure libraries (which probably includes the IUP library mentioned a few posts ago, and probably also FreeBASIC itself) will have to be compiled from source or installed from binary tarballs.

And when you do compile from source, there are numerous different methods people might use. Autoconf (venerable old ./configure, make make install), cmake, qmake, or plain Makefile. Usually a tarball will have a file called README or INSTALL or something that can give you some basic hints. But again, only install from source if you cannot find what you need in the distro software repositories.

Definitely a different world in Linux, and as a programmer working with libraries and the terminal you'll have a learning curve, but it's worth it.
Post Reply