Hi,
I fail to cross-compile pdlua on Debian for W32. This is my error:
$ i586-mingw32msvc-gcc -I/lua-5.1.2/src/ -I./ -I/usr/include/ -shared lua5.1.dll pd.dll -o lua.dll lua.c /tmp/ccobudhL.o:lua.c:(.text+0x1bc4): undefined reference to `_class_set_extern_dir' /tmp/ccobudhL.o:lua.c:(.text+0x1c65): undefined reference to `_class_set_extern_dir' /tmp/ccobudhL.o:lua.c:(.text+0x1c92): undefined reference to `_class_set_extern_dir' /tmp/ccobudhL.o:lua.c:(.text+0x1e09): undefined reference to `_sys_register_loader' Info: resolving _s_ by linking to __imp__s_ (auto-import) collect2: ld returned 1 exit status
This is with the precompiled lua5.1.dll from http://luabinaries.luaforge.net/download.html and the precompiled pd.dll from Miller's site, both 0.41 and 0.40 give the same error.
I could remove the "_class_set_extern_dir" stuff from lua.c, but I'm quite sure that "_sys_register_loader" is important.
Any ideas how to fix this?
Ciao
Hallo,
some more info: Could this be related to Claude's findings mentioned in the lua.c file:
/** Pd loader registration, defined in pd/src/s_loader.c but not exported. */ void sys_register_loader(loader_t loader);
/** Pd extern dir declaration (for help finding), defined in pd/src/m_class.c but not exported. */ void class_set_extern_dir(t_symbol *s);
If sys_register_loader is "not exported", how are loaders meant to be built? And why does gcc not complain on native Linux using practically the same command line?
Ciao
Frank Barknecht wrote:
some more info: Could this be related to Claude's findings mentioned in the lua.c file:
/** Pd loader registration, defined in pd/src/s_loader.c but not exported. */ void sys_register_loader(loader_t loader);
/** Pd extern dir declaration (for help finding), defined in pd/src/m_class.c but not exported. */ void class_set_extern_dir(t_symbol *s);
If sys_register_loader is "not exported", how are loaders meant to be built? And why does gcc not complain on native Linux using practically the same command line?
With dlls you have to export symbols using a def file or /export: statement on the command line (or __declspec(dllexport) in the code with MSVC). On linux all symbols in a shared library are visible by default, it's about the structure of a windows dll versus that of a unix shared library, not gcc. Martin
Frank Barknecht hat gesagt: // Frank Barknecht wrote:
I fail to cross-compile pdlua on Debian for W32. This is my error:
$ i586-mingw32msvc-gcc -I/lua-5.1.2/src/ -I./ -I/usr/include/ -shared
lua5.1.dll pd.dll -o lua.dll lua.c
/tmp/ccobudhL.o:lua.c:(.text+0x1bc4): undefined reference to
`_class_set_extern_dir'
/tmp/ccobudhL.o:lua.c:(.text+0x1c65): undefined reference to
`_class_set_extern_dir'
/tmp/ccobudhL.o:lua.c:(.text+0x1c92): undefined reference to
`_class_set_extern_dir'
/tmp/ccobudhL.o:lua.c:(.text+0x1e09): undefined reference to
`_sys_register_loader'
Info: resolving _s_ by linking to __imp__s_ (auto-import) collect2: ld returned 1 exit status
This is with the precompiled lua5.1.dll from http://luabinaries.luaforge.net/download.html and the precompiled pd.dll from Miller's site, both 0.41 and 0.40 give the same error.
I could remove the "_class_set_extern_dir" stuff from lua.c, but I'm quite sure that "_sys_register_loader" is important.
Any ideas how to fix this?
Hallo, Martin Peach hat gesagt: // Martin Peach wrote:
With dlls you have to export symbols using a def file or /export: statement on the command line (or __declspec(dllexport) in the code with MSVC). On linux all symbols in a shared library are visible by default, it's about the structure of a windows dll versus that of a unix shared library, not gcc.
So unless pd.dll is built with sys_loader exposed, I won't be able to build a loader-external, right? If so, then I'll let the MS-Windows-people take over building pdlua.
Ciao
Frank Barknecht wrote:
Hallo, Martin Peach hat gesagt: // Martin Peach wrote:
With dlls you have to export symbols using a def file or /export: statement on the command line (or __declspec(dllexport) in the code with MSVC). On linux all symbols in a shared library are visible by default, it's about the structure of a windows dll versus that of a unix shared library, not gcc.
So unless pd.dll is built with sys_loader exposed, I won't be able to build a loader-external, right? If so, then I'll let the MS-Windows-people take over building pdlua.
Usually on Windows you link against pd.lib, not pd.dll, so it ought to work. You will need to include the header file containing sys_loader (except I can't find sys_loader anywhere in the pd source).
Martin
Hallo, Martin Peach hat gesagt: // Martin Peach wrote:
Frank Barknecht wrote:
Martin Peach hat gesagt: // Martin Peach wrote:
With dlls you have to export symbols using a def file or /export: statement on the command line (or __declspec(dllexport) in the code with MSVC). On linux all symbols in a shared library are visible by default, it's about the structure of a windows dll versus that of a unix shared library, not gcc.
So unless pd.dll is built with sys_loader exposed, I won't be able to build a loader-external, right? If so, then I'll let the MS-Windows-people take over building pdlua.
Usually on Windows you link against pd.lib, not pd.dll, so it ought to work. You will need to include the header file containing sys_loader (except I can't find sys_loader anywhere in the pd source).
Sorry, it's "sys_register_loader" in s_loader.c, but not in any header. HCS did a bug report regarding this already.
Ciao
I asked the same question, and then submitted a patch to expose it :)
http://sourceforge.net/tracker/index.php? func=detail&aid=1840431&group_id=55736&atid=478072
.hc
On Dec 10, 2007, at 11:59 AM, Frank Barknecht wrote:
Hallo,
some more info: Could this be related to Claude's findings mentioned in the lua.c file:
/** Pd loader registration, defined in pd/src/s_loader.c but not exported. */ void sys_register_loader(loader_t loader);
/** Pd extern dir declaration (for help finding), defined in pd/ src/m_class.c but not exported. */ void class_set_extern_dir(t_symbol *s);
If sys_register_loader is "not exported", how are loaders meant to be built? And why does gcc not complain on native Linux using practically the same command line?
Ciao
Frank
Frank Barknecht hat gesagt: // Frank Barknecht wrote:
I fail to cross-compile pdlua on Debian for W32. This is my error:
$ i586-mingw32msvc-gcc -I/lua-5.1.2/src/ -I./ -I/usr/include/ - shared lua5.1.dll pd.dll -o lua.dll lua.c /tmp/ccobudhL.o:lua.c:(.text+0x1bc4): undefined reference to `_class_set_extern_dir' /tmp/ccobudhL.o:lua.c:(.text+0x1c65): undefined reference to `_class_set_extern_dir' /tmp/ccobudhL.o:lua.c:(.text+0x1c92): undefined reference to `_class_set_extern_dir' /tmp/ccobudhL.o:lua.c:(.text+0x1e09): undefined reference to `_sys_register_loader' Info: resolving _s_ by linking to __imp__s_ (auto-import) collect2: ld returned 1 exit status
This is with the precompiled lua5.1.dll from http://luabinaries.luaforge.net/download.html and the precompiled pd.dll from Miller's site, both 0.41 and 0.40 give the same error.
I could remove the "_class_set_extern_dir" stuff from lua.c, but I'm quite sure that "_sys_register_loader" is important.
Any ideas how to fix this?
Ciao
Frank Barknecht _ ______footils.org__
PD-dev mailing list PD-dev@iem.at http://lists.puredata.info/listinfo/pd-dev
-- Frank Barknecht _ ______footils.org__
PD-dev mailing list PD-dev@iem.at http://lists.puredata.info/listinfo/pd-dev
------------------------------------------------------------------------ ----
¡El pueblo unido jamás será vencido!
On Mon, 2007-12-10 at 17:59 +0100, Frank Barknecht wrote:
And why does gcc not complain on native Linux using practically the same command line?
iirc, the windos binary of pd uses a dll, exposing the public api, while on linux, all symbols are exposed by the pd binary (-Wl,--export-dynamic)
t
-- tim@klingt.org http://tim.klingt.org
The first question I ask myself when something doesn't seem to be beautiful is why do I think it's not beautiful. And very shortly you discover that there is no reason. John Cage.