[PD-dev] wrong ELF header loading tcl file

IOhannes m zmoelnig zmoelnig at iem.at
Mon Oct 7 18:21:03 CEST 2013


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 2013-10-07 17:19, Orm Finnendahl wrote:
> Hi,
> 
> trying to load a tcl file in a custom extern's setup routine with:
> 
> sys_vgui("load /home/orm/img.tcl;\n");
> 
> I get the following error when loading that extern in a pd
> session:
> 
> (Tcl) UNHANDLED ERROR: couldn't load file "/home/orm/img.tcl":
> /home/orm/img.tcl: invalid ELF header while executing "load
> /home/orm/img.tcl" ("uplevel" body line 1) invoked from within 
> "uplevel #0 $docmds"
> 
> The extern has been built with the following flags:
> 
> gcc -fPIC -DPD -g -O2 -funroll-loops -fomit-frame-pointer -Wall -W
> -Wshadow -Wstrict-prototypes -Werror -Wno-unused -Wno-parentheses
> -Wno-switch -I/usr/include -I/home/orm/work/install/pd-0.44-3/src
> -I/usr/local/include -L/usr/local/lib  -o img.o -c img.c
> 
> It's on a 64bit linux with custom pd-0.44-3. There is obviously a 
> 32-bit/64-bit incompatibility but I have no clue who is causing 
> this and how to fix it. Can anybody help?

the problem is not the extern ('img.pd_linux') but rather the tcl-file
'img.tcl', or even more rather the way you try to load it.

assuming that "/home/orm/img.tcl" is an ordinary tcl script file
(text!, not binary), then you shouldn't use the "load" command to load
it; according to the tcl-docs:
> load - Load machine code and initialize new commands.

is this really what you want?
or would you rather have something like the "source" command:
> source - Evaluate a file or resource as a Tcl script


fgamsdr
IOhannes
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.14 (GNU/Linux)
Comment: Using GnuPG with Icedove - http://www.enigmail.net/

iQIcBAEBCAAGBQJSUt9sAAoJELZQGcR/ejb4ttQQAJRDIaP4Cl99TrPTtKLoCTYI
qofZVJBs99bE05kBCq+adiwwtXLaYwAmbyQSuszz/N/gHLTQQUKg/B9MujpRWkre
CU5hXQWXfcUiZ/sVHKNfMYzlYE4R9vbXqL7zSa7rJRSZhPOzjs/LZOy5J03511jf
lteYAlxU98RTxf/deVEn1dbsN8Z6t3bF2V12HlfUMPJDCnqY5OEPWpUfAy/Onw4i
IT+/o4s/zf6injKv5Xo8CGM2foJSuMDmvNHxpNvGYgqzFa2PYePI5ohefAUkzly2
1swnGEcqVn+mPAG57rQQ+VmQCdxSRgjWjG04umwI1jZsltBqbuh3c+FPvV9aitvP
ebMvkoMkFQrxOz0vUrIcGJ3F6JE3XV9XC69SfZKz9eL6hyodvITBXqYmf5J3AEAw
LsC7N31R+x2PbZgbNyucGfotBM+pbbhmPJBCFUB/VBuSbTgiCiv37QA7dbDtWz0z
vf++PSk/5k1RJjy3svscOz1gAULBbEdlnYgTExxeCr9L4dFQWQ8bpw7YMxZaFHz0
jPg4nfp+B4pFnlNXkceLq/gFFxlNRqbFqSA7w2xHvWP7esm6qDBbypmfw99UsGtI
idsn5Oz/cpW6PK9vcIuuebhTUq0PPcEjh5ysDzNSafzxzmRp/uNOLEDaaRJk6TzL
fD1vo6e8cWVYuxxWjeg5
=GB/t
-----END PGP SIGNATURE-----



More information about the Pd-dev mailing list