hi,
i wrote a few small external using flext and i'd like to create a library that contains all these externals, but i've got some problems: i wrote a main.cpp as described in the tutorial (but i don't use a base class, all externals if i compile them alone)
#include <flext.h> void tbroute_setup(); void tbstrg_setup();
static void tblib_setup() { void tbroute_setup(); void tbstrg_setup(); } FLEXT_LIB_SETUP(tbext,tblib_setup)
but i am gettig the following message: undefined symbol: _Z13tbroute_setupv all the object files are linked to the .pd_linux file. any idea what's wrong with this?
thanks ... tim
On Thursday 20 March 2003 14:42, TimBlechmann@gmx.net wrote:
hi,
hi tim,
replace
static void tblib_setup()
by
void tblib_setup()
definining it static does not export the symbol
cheers
tom
i wrote a few small external using flext and i'd like to create a library that contains all these externals, but i've got some problems: i wrote a main.cpp as described in the tutorial (but i don't use a base class, all externals if i compile them alone)
#include <flext.h> void tbroute_setup(); void tbstrg_setup();
static void tblib_setup() { void tbroute_setup(); void tbstrg_setup(); } FLEXT_LIB_SETUP(tbext,tblib_setup)
but i am gettig the following message: undefined symbol: _Z13tbroute_setupv all the object files are linked to the .pd_linux file. any idea what's wrong with this?
thanks ... tim
Hi Tim, have a look at the flext tutorial "lib1"!
Your code
#include <flext.h> void tbroute_setup(); void tbstrg_setup();
static void tblib_setup() { void tbroute_setup(); void tbstrg_setup(); } FLEXT_LIB_SETUP(tbext,tblib_setup)
is rather bogus because "void tbroute_setup()" declares the tbroute_setup function (local to tblib_setup) but does not call it!! (that would be just "tbroute_setup()" )
anyway, the correct library setup would be:
#include <flext.h>
static void tblib_setup() { FLEXT_SETUP(tbroute); FLEXT_SETUP(tbstrg); } FLEXT_LIB_SETUP(tbext,tblib_setup)
There no problem with the function being static. Please note that your library has to be called "tbext" !
best greetings, Thomas
I would discourage writing a library. It is much better and much more flexible writing a single external.
Greetings,
Guenter
On Thu, 20 Mar 2003, Thomas Grill wrote:
Hi Tim, have a look at the flext tutorial "lib1"!
Your code
#include <flext.h> void tbroute_setup(); void tbstrg_setup();
static void tblib_setup() { void tbroute_setup(); void tbstrg_setup(); } FLEXT_LIB_SETUP(tbext,tblib_setup)
is rather bogus because "void tbroute_setup()" declares the tbroute_setup function (local to tblib_setup) but does not call it!! (that would be just "tbroute_setup()" )
anyway, the correct library setup would be:
#include <flext.h>
static void tblib_setup() { FLEXT_SETUP(tbroute); FLEXT_SETUP(tbstrg); } FLEXT_LIB_SETUP(tbext,tblib_setup)
There no problem with the function being static. Please note that your library has to be called "tbext" !
best greetings, Thomas
PD-dev mailing list PD-dev@iem.kug.ac.at http://iem.kug.ac.at/cgi-bin/mailman/listinfo/pd-dev
I would discourage writing a library. It is much better and much more flexible writing a single external.
I'm sure it's a good choice in most cases, but i prefer using libraries - when they share a lot of code - because the flext overhead is much lighter then (ok, this shall stop with shared flext libraries) - when there's a common info pool that is shared among the library externals
best greetings, Thomas
On Thu, 20 Mar 2003, Thomas Grill wrote:
I would discourage writing a library. It is much better and much more flexible writing a single external.
I'm sure it's a good choice in most cases, but i prefer using libraries
- when they share a lot of code
- because the flext overhead is much lighter then (ok, this shall stop with
shared flext libraries)
- when there's a common info pool that is shared among the library externals
All of this is not the case with the two external library Tim wants to write. Point two can probably be solved by making flext dynamic.
I prefer single external because: - You do not have to load the whole library if you want to use an external - you do not have 20 -lib switches in your commandline - you can distribute patches by just adding the externals they use in the same folder - most libraries do not share any common info - it will be easier to integrate them with the other externals - you can classify them by putting them into folders
So I think that the tendency should be to write single externals, try to collaborate with others (look at whats there, improve what already exists instead of writing new variations).
Greetings,
Guenter
anyway, the correct library setup would be:
#include <flext.h>
static void tblib_setup() { FLEXT_SETUP(tbroute); FLEXT_SETUP(tbstrg); } FLEXT_LIB_SETUP(tbext,tblib_setup)
this was my first try ... i am getting the same error message. i tried to build the library with gcc and icc.
i had a look at the object files: the main.o calls _Z13tbroute_setupv, but the tbroute.o contains only a tbroute_setup ... well, i haven't learned assembler, yet...
anyway ... maybe i'll have a new try tomorrow....
thanx ... tim
Hi Tim,
i had a look at the object files: the main.o calls _Z13tbroute_setupv, but the tbroute.o contains only a tbroute_setup ... well, i haven't learned assembler, yet...
is the tbroute class instantiated with FLEXT_NEW* (for a stand-alone external) or - correctly - with FLEXT_LIB* (for an external that is part of a library) ?
In flext this is relevant, unfortunately...
best, Thomas