trouble compiling with Fb extended library

General FreeBASIC programming questions.
Post Reply
dbickin
Posts: 59
Joined: Aug 03, 2005 16:40

trouble compiling with Fb extended library

Post by dbickin »

Okay, I am setting up a new laptop with a variant of Debian on it.

I got the fbc compiler working, but couldn't get the extended library to compile at all.

I found a post with a link to a deb file for the library. It wouldn't directly install because it needed a freebasic package to have previously been installed. But I was able to manually move the files to the right locations.

But still no joy. I tried to compile the advanced.bas example file, and got these errors:

Code: Select all

advanced.o: In function `RECURSEINTO':
(.text+0xd8): undefined reference to `EXT::MISC::FILE_ITER::operator for()'
advanced.o: In function `RECURSEINTO':
(.text+0x227): undefined reference to `EXT::MISC::FILE_ITER::operator step()'
advanced.o: In function `RECURSEINTO':
(.text+0x237): undefined reference to `EXT::MISC::FILE_ITER::operator next(EXT::MISC::FILE_ITER&)'
advanced.o: In function `RECURSEINTO':
(.text+0x321): undefined reference to `EXT::MISC::FILE_ITER::operator for()'
advanced.o: In function `RECURSEINTO':
(.text+0x46a): undefined reference to `EXT::MISC::FILE_ITER::operator step()'
advanced.o: In function `RECURSEINTO':
(.text+0x47a): undefined reference to `EXT::MISC::FILE_ITER::operator next(EXT::MISC::FILE_ITER&)'
advanced.o: In function `main':
(.text+0xada): undefined reference to `EXT::STRINGS::XSTRING::EXPLODE(FBSTRING const&, FBARRAY<FBSTRING>&)'
/usr/local/bin/../lib/freebasic/linux-x86/libext-xml.a(libext-xml.o): In function `EXT::XML::NODE::APPENDCHILD(FBSTRING const&, EXT::XML::NODE_TYPE_E)':
(.text+0x2dd5): undefined reference to `operator new(unsigned int)'
/usr/local/bin/../lib/freebasic/linux-x86/libext-xml.a(libext-xml.o): In function `EXT::XML::NODE::REMOVECHILD(int)':
(.text+0x2f2f): undefined reference to `operator delete(void*)'
/usr/local/bin/../lib/freebasic/linux-x86/libext-xml.a(libext-xml.o): In function `EXT::XML::TREE::TREE()':
(.text+0x2fd3): undefined reference to `operator new(unsigned int)'
/usr/local/bin/../lib/freebasic/linux-x86/libext-xml.a(libext-xml.o): In function `EXT::XML::TREE::~TREE()':
(.text+0x3048): undefined reference to `operator delete(void*)'
/usr/local/bin/../lib/freebasic/linux-x86/libext-xml.a(libext-xml.o): In function `EXT::XML::TREE::CLEAR()':
(.text+0x3322): undefined reference to `operator delete(void*)'
/usr/local/bin/../lib/freebasic/linux-x86/libext-xml.a(libext-xml.o): In function `EXT::XML::TREE::CLEAR()':
(.text+0x332c): undefined reference to `operator new(unsigned int)'
What would cause this, and what can I do to overcome these errors?

Thanks,
David
Tourist Trap
Posts: 2958
Joined: Jun 02, 2015 16:24

Re: trouble compiling with Fb extended library

Post by Tourist Trap »

dbickin wrote:I found a post with a link to a deb file for the library. It wouldn't directly install because it needed a freebasic package to have previously been installed. But I was able to manually move the files to the right locations.

But still no joy. I tried to compile the advanced.bas example file, and got these errors:
This kind of error, as far as I know, means that the compiler finds the declarations of functions (headers) but not their implementation (body). Or they are not properly linked. Are you sure that your declarations files (I guess .bi extensions) know the path to their body files (.bas in general unless there are compiled libraries involved?)?

I can't say more. I never really insisted in my try of the Extended lib. But I think you just missed a step.
dbickin
Posts: 59
Joined: Aug 03, 2005 16:40

Re: trouble compiling with Fb extended library

Post by dbickin »

Playing with it some more, it looks like the linker is finding the function that I call, but if the source of that object is calling a function in another, it looks like that is not being found. (Well, some of them are not being found, it appears some ARE being found, but in truth, I am not following some of this. I have no idea where the 'operator new' and 'operator delete' are supposed to be, so can't really figure out what it should be looking for.)

At this point, it will probably be faster for me to write my own XML library then try to get this thing working.

David
St_W
Posts: 1619
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: trouble compiling with Fb extended library

Post by St_W »

dbickin wrote:At this point, it will probably be faster for me to write my own XML library then try to get this thing working.
There are also other XML libraries out there that are more lightweight and easier to use. Unfortunately FB Ext Lib is not widely used and not under active development either, so maybe something is broken with the latest FB version. However, I'd compile from source instead of using the (probably old) precompiled binaries.
dbickin
Posts: 59
Joined: Aug 03, 2005 16:40

Re: trouble compiling with Fb extended library

Post by dbickin »

St_W wrote:There are also other XML libraries out there that are more lightweight and easier to use.
Can you give me pointers to those? The only other library I found was libxml2, which I did not find easier to use.

Thanks,
David
St_W
Posts: 1619
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: trouble compiling with Fb extended library

Post by St_W »

dbickin wrote:Can you give me pointers to those? The only other library I found was libxml2, which I did not find easier to use.
hm, I was quite sure that I've read about such implementations here or somewhere else, but I can't find any good implementation either currently.

So the only two that I still know of are the one by nemored and mine. The former can be found e.g. as part of this application: http://users.freebasic-portal.de/nemore ... _3_src.zip However, as far as I can see it is not targeted at an international audience (as it uses german names)
The latter is a very simple XML parser I've implemented myself a long time ago and revised several times (the last time in 2015). You can find a copy here:
https://bitbucket.org/st_w/fb-jenkins/s ... ew-default
dbickin
Posts: 59
Joined: Aug 03, 2005 16:40

Re: trouble compiling with Fb extended library

Post by dbickin »

Sorry, ST_W, I thought for sure I had posted a reply thanking you, but it looks like it didn't take.

I ended up using your XML.BI. The only thing it doesn't appear to do is to decode stuff like < to < and &rt to >; when retrieving the text. But I grabbed the function in the extended library that did that, and merged it in.

One question I have is... is there a way for me to find stuff like this? I came up with nothing using Google or this forum's search.

Now I want to find a library that will handle iCAL data. My current program is written in PERL using its DATA::ICAL::DATETIME module. But my searching hasn't yielded a Freebasic library or even a C library.

(In many ways, ICAL is even easier to parse than XML, but expanding the RRULE tag is no easy feat.)

David
St_W
Posts: 1619
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: trouble compiling with Fb extended library

Post by St_W »

dbickin wrote:I ended up using your XML.BI. The only thing it doesn't appear to do is to decode stuff like < to < and &rt to >; when retrieving the text. But I grabbed the function in the extended library that did that, and merged it in.
One question I have is... is there a way for me to find stuff like this? I came up with nothing using Google or this forum's search.
I fear there isn't a way to find such stuff currently other than by following the activities on the forums. A code repository or package manager like you probably know from other programming languages has been discussed several times but nobody has implemented such a tool yet (it's a lot of work if you also consider the maintainance afterwards). Additionally these implementations weren't really intended for broad use, otherwise I should have presented them in the forums. You're probably the first user other than me ;-)
btw maybe you could share your enhanced version of xml.bi ?
dbickin wrote:Now I want to find a library that will handle iCAL data. My current program is written in PERL using its DATA::ICAL::DATETIME module. But my searching hasn't yielded a Freebasic library or even a C library.
I don't know of a FreeBasic library either (which doesn't mean that none exists - I just don't know any), but there are C implementations for sure, for example this one: https://github.com/libical/libical
Post Reply