Compiling Blitzmax-NG on Linux - problem!

BlitzMax Forums/BlitzMax NG/Compiling Blitzmax-NG on Linux - problem!

Sub_Zero(Posted May) [#1]
Hi!

I've tried half the day to compile in Linux, no go...

On recent linux distro's, when trying to compile bmk using BlitzMax 1.50, I get the following error:
loadlib.c: undefined reference to 'dlsyml'
loadlib.c: undefined reference to 'dlerror'
loadlib.c: undefined reference to 'dlopen'
loadlib.c: undefined reference to 'dlclose'

(or similar)

Which originates from the PuB,Lua module....

Does anyone know how to solve this?

Reason: I've created a module I want to test in linux, it works fine now on windows x86 and x64.


Sub_Zero(Posted May) [#2]
Someone suggests several places online that these compiler options has to be in place to compile successfully (g++ i think):
-Wl,--no-as-needed

(as recent versions compiles with --as-needed as default (?))

But how to do it in Linux, env var BMK_LD_OPTS doesn't seem to work in linux.


Brucey(Posted May) [#3]
The default BlitzMax 1.50 needs some lines added to pub.mod/lua.mod/lua.bmx
?Linux
Import "-ldl"
?



Sub_Zero(Posted May) [#4]
Thanks Brucey!

I tried importing it in frisky.bmx...

(banging head against wall).

Now it works ok!

Also, to rebuild modules in Blitzmax 1.50, in fl_draw.cxx (fltkmaxgui.mod/src folder), you have to move this line:

#define min(a,b) ((a)<(b)?(a):(b))


to beneath:

#include <math.h>


in order to compile the fltkmaxgui module successfully on recent linux distros.