1. wxEuphoria machine level exception

Hi

I have just tested the wxEuphoria installation on linux.

I too get the machine level exception on line 56

--extract from wxEuphoria.e
--#LINUX
wxEuphoria_Platform = LINUX,
wxWin_name = getenv("EUDIR") & "/bin/libwx_gtk-2.4.so.0.1.1",
wxNEED_BUILD = 2,
--#ENDLINUX

wxWin = open_dll( wxWin_name ),

--#LINUX
WX_DLL_BUILD = peek4u(define_c_var(wxWin, "WX_DLL_BUILD"))   <<<<line 56
global constant
euret  = define_c_var( wxWin, "_ZN8wxEuCall5euretE" ),
eucall = define_c_proc( wxWin, "_ZN8wxEuCall6eucallEv", {} ),
eufunc = define_c_var( wxWin, "_ZN8wxEuCall6eufuncE" ),
euparam_count = define_c_var( wxWin, "_ZN8wxEuCall7euparamE" ),
eulog = define_c_func( wxWin, "_ZN8wxEuCall5eulogEPKc", {C_POINTER}, C_POINTER),
euparam = euparam_count + 4
--#ENDLINUX



experimented with this

wxWin = open_dll( wxWin_name ),
if wxWin = 0 then
     puts(1, "Can't find " & wxWin_name & "\n")
     abort(0)
end if

a1 = define_c_var(wxWin, "WX_DLL_BUILD")
printf(1, "%d %d\n", {wxWin, a1)
WX_DLL_BUILD = peek4u(a1)


1st - couldn't open libwx_gtk-2.4.so.0.1.1 (aborted)- the lib is in the bin
directory,
and the paths are set correctly (echo $EUDIR)

2nd - moved that copy of libwx_gtk-2.4.so.0.1.1 to /usr/lib and ran ldconfig,
modified wxEuphoria to specify the lib with no path - same result.

3rd - downloaded wxgtk 2.4.2 rpm from www.wxwidgets.org, and installed that,
again keeping the no path specified. Different result. The lib is opened, but
there is no WX_DLL_BUILD in that library (there is in the original one, 
both checked with an nm dump)

So far its a good lib for windows, but can't get it to run on Linux. Any other
ideas.

Couple of extra points. Your libraries (so far only wxEuphoria) are platform
specific - can you make them non-specific - ie the eu includes will run on
Linux or windows unmodified, just detecting to os internally, and loading
the appropriate libs.

Currently, wxEuphoria looks for libwx_gtk-2.4.so.0.1.1 in a very specific
place. If you package an app, and give it to someone else, including the 
library, then the program won't work, as you don't have the same directory
structure. Perhaps it could be made to be less choosy in its location
(~/ or ./) ?

Chris


http://members.aol.com/chriscrylex/euphoria.htm
http://uboard.proboards32.com/

new topic     » topic index » view message » categorize

2. Re: wxEuphoria machine level exception

Chris Burch wrote:
> 
> Hi
> 
> I have just tested the wxEuphoria installation on linux.
> 
> I too get the machine level exception on line 56

<snip>

> 
> 1st - couldn't open libwx_gtk-2.4.so.0.1.1 (aborted)- the lib is in the bin
> directory,
> and the paths are set correctly (echo $EUDIR)
> 
> 2nd - moved that copy of libwx_gtk-2.4.so.0.1.1 to /usr/lib and ran ldconfig,
> modified wxEuphoria to specify the lib with no path - same result.
> 
> 3rd - downloaded wxgtk 2.4.2 rpm from www.wxwidgets.org, and installed that,
> again keeping the no path specified. Different result. The lib is opened, but
> there is no WX_DLL_BUILD in that library (there is in the original one, 
> both checked with an nm dump)
> 
> So far its a good lib for windows, but can't get it to run on Linux. Any other
> ideas.

Ok, sounds like the file got corrupted.  I don't think I'll be able to 
fix it tonight, but hopefully by tomorrow night I'll have a fix uploaded
to sourceforge.  Will advise...
 
> Couple of extra points. Your libraries (so far only wxEuphoria) are platform
> specific - can you make them non-specific - ie the eu includes will run on
> Linux or windows unmodified, just detecting to os internally, and loading
> the appropriate libs.

I'd rather not do this.  The bulk of many of the files are the imports, 
which are different for each platform.  Even the constant names are 
different in some cases.  This also causes problems in the code.  Added
to that, there are places in the declarations that actually call wxWidgets
functions.  This would be hard to fix.  And how to handle duplicate names,
which require different imports?  And then, with 2.5, it's just that much
more that would need to be parsed.

I think the solution I have is a pretty good one.  It works a lot like
ifdef's in C/C++ do.  If you download the developer package, you'll find
a perl program that converts back and forth between the two platforms.
You'll also find the databases that hold all of the import information,
and a program called generate.exw, which will rewrite all of the  constant
declarations automatically.  It's a fairly painless process, and one that
I think few people will really need.  The important thing, IMHO, is that
apps can be easily moved between Windows and Linux.

If you get the wxWidgets 2.4.2 source, and patch it with the linux source
contained in the developers package, you can build the library yourself,
but it takes a while.  I think it takes an hour or two (been a while since
I've done a build from scratch) on my 600Mhz machine (RH8).  I've made
lots of modifications, so you can't use wxWidgets without my patches.
 
> Currently, wxEuphoria looks for libwx_gtk-2.4.so.0.1.1 in a very specific
> place. If you package an app, and give it to someone else, including the 
> library, then the program won't work, as you don't have the same directory
> structure. Perhaps it could be made to be less choosy in its location
> (~/ or ./) ?

I guess I should have documented this a bit more.  It's fairly easy to
change where it looks, by modifying the wxWin_Name constant.  The Euphoria
bin directory seemed like the most logical place for it, and I was also
sorta copying how Irv did it in EuGTK, using something that worked as an
example.  I'm not completely clear how linking to libraries works in 
Linux.

Matt Lewis

new topic     » goto parent     » topic index » view message » categorize

3. Re: wxEuphoria machine level exception

Hi

Matt Lewis wrote:

> 
> I guess I should have documented this a bit more.  It's fairly easy to
> change where it looks, by modifying the wxWin_Name constant.  The Euphoria
> bin directory seemed like the most logical place for it, and I was also
> sorta copying how Irv did it in EuGTK, using something that worked as an
> example.  I'm not completely clear how linking to libraries works in 
> Linux.
> 
> Matt Lewis
> 

At the risk of teaching Granny to suck eggs smile

wxEuphoria.e specifies EUDIR & bin/wxgtk_lib...so
( wxWin_name = getenv("EUDIR") & "/bin/libwx_gtk-2.4.so.0.1.1")
   - the library must be installed here to work

If you install the library somewhere in the searched PATH it _should_ be able
to find it.

So specifying
   wxWin_name = "libwx_gtk-2.4.so.0.1.1"
and putting the library _anywhere_ in $PATH should work - my first choice
for development would be ~/euphoria/include, along with all the other
wxEuphoria includes (personal preference)

The 'correct' way to install a library would be to put it into /usr/lib 
(as root), and then run ldconfig to update the library 'index'. This is
the way Irv's gtk2 library works (no compiled wrappers).

Final caveat - as you are modifying the wxgtk library, should you not be
naming it something different - eg libwx_gtk-ml-2.4.so.0.1.1, to avoid
overwriting either when installing this, or installing wxwidgets form
www.wxwidgets.org? 

Oh, and understood about the complexities of cross platform compatability
(effort inputted vs reward outputted etc), but (and its just a question for
curiosities sake), why are you using perl and not eu to do the conversions?

Chris




http://members.aol.com/chriscrylex/euphoria.htm
http://uboard.proboards32.com/

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu