vbcompat.bi and format

DOS specific questions.
Post Reply
nedman47
Posts: 62
Joined: Dec 05, 2006 15:35

vbcompat.bi and format

Post by nedman47 »

Code: Select all

#include "vbcompat.bi"
print format(12.34,"##.##)
when i compile this program with freebasic dos daily build of 3-12-07 i get in undefined reference to fb_StrNullDesc.

can someone help me find the missing info?

thanks in advance.
phishguy
Posts: 1201
Joined: May 05, 2006 16:12
Location: West Richland, Wa

Post by phishguy »

You are missing the second set of quotes on the format string "##.##"
It works on Windows after the change.
nedman47
Posts: 62
Joined: Dec 05, 2006 15:35

Post by nedman47 »

sorry that was just a typo. the corrected program gives an error when compiled with dos daily build of 3-12-07. i'm assuning there is some include file that needs to be updated.
cha0s
Site Admin
Posts: 5319
Joined: May 27, 2005 6:42
Location: USA
Contact:

Post by cha0s »

You probably didn't replace the files in the lib/dos folder. like libfb.a, libfbgfx.a, etc. You need to replace those as well as files in the 'bin' folder, not only just fbc.exe.

Once the compiler (fbc.exe) and the run-time library (libfb.a) are the same version, the problem should disappear.
nedman47
Posts: 62
Joined: Dec 05, 2006 15:35

Post by nedman47 »

where is the best place to get those latest files?
cha0s
Site Admin
Posts: 5319
Joined: May 27, 2005 6:42
Location: USA
Contact:

Post by cha0s »

Image

As you can see, the archive includes the lib folder. simply extract it *ALL* over your current build.
nedman47
Posts: 62
Joined: Dec 05, 2006 15:35

Post by nedman47 »

i updated to the current dos daily build and verified it updated the lib but i'm still getting the same errors.
q:/home/ned/bas/frebasic/daily\lib\dos/libfbx.a(libfb_str_format.o)(.text+0x424)
:libfb_str_format.c: undefined reference to `fb_strNullDesc'
q:/home/ned/bas/frebasic/daily\lib\dos/libfbx.a(libfb_str_format.o)(.text+0x498)
:libfb_str_format.c: undefined reference to `fb_strNullDesc'
q:/home/ned/bas/frebasic/daily\lib\dos/libfbx.a(libfb_str_format.o)(.text+0x4a5)
:libfb_str_format.c: undefined reference to `fb_strNullDesc'
q:/home/ned/bas/frebasic/daily\lib\dos/libfbx.a(libfb_time_weekdayname.o)(.text+
0x2d):libfb_time_weekdayname.c: undefined reference to `fb_strNullDesc'
q:/home/ned/bas/frebasic/daily\lib\dos/libfbx.a(libfb_time_monthname.o)(.text+0x
40):libfb_time_monthname.c: undefined reference to `fb_strNullDesc'
q:/home/ned/bas/frebasic/daily\lib\dos/libfbx.a(libfb_intl_getweekdayname.o)(.te
xt+0xa9):libfb_intl_getweekdayname.c: more undefined references to `fb_strNullDe
sc' follow
DrV
Site Admin
Posts: 2116
Joined: May 27, 2005 18:39
Location: Midwestern USA
Contact:

Post by DrV »

If you are getting references to libfbx.a, you are using a (very) outdated version of the compiler. Please make sure you've updated all the files.
nedman47
Posts: 62
Joined: Dec 05, 2006 15:35

Post by nedman47 »

i'm using 0.16 as a base. libfbx.a is in there.

i'm using the 2-9-07 lib update.

i'm using the 4-3-07 dos daily build.

i didn't see any instructions saying to delete files.
DrV
Site Admin
Posts: 2116
Joined: May 27, 2005 18:39
Location: Midwestern USA
Contact:

Post by DrV »

You don't need libfbx.a anymore, but it won't do any harm to keep it. However, please try compiling with fbc -v to see the linker command line - if it contains any references to libfbx.a, you are using an old version of the compiler, since libfbx.a was merged back into libfb.a quite some time ago.
nedman47
Posts: 62
Joined: Dec 05, 2006 15:35

Post by nedman47 »

here is the result of fbc -v

it shows the compiler is dated 4-3-07

it shows a built-in ref to "-lfbx"
FreeBASIC Compiler - Version 0.17 (04-03-2007) for dos (target:dos)

Copyright (C) 2004-2007 The FreeBASIC development team.



compiling: format.bas -o format.asm

assembling: q:/home/ned/bas/frebasic/daily\bin\dos\as.exe --strip-local-absolute "format.asm" -o "format.o"

linking: q:/home/ned/bas/frebasic/daily\bin\dos\ld.exe -T "q:/home/ned/bas/frebasic/daily\bin\dos\i386go32.x" -s -L "q:/home/ned/bas/frebasic/daily\lib\dos" -L "./" "q:/home/ned/bas/frebasic/daily\lib\dos\crt0.o" "format.o" -o "format.exe" -( -lfbx -lfb -lgcc -lc -lm -lsupcxx "q:/home/ned/bas/frebasic/daily\lib\dos/fbrt0.o" -)

q:/home/ned/bas/frebasic/daily\lib\dos/libfbx.a(libfb_str_format.o)(.text+0x424):libfb_str_format.c: undefined reference to `fb_strNullDesc'
q:/home/ned/bas/frebasic/daily\lib\dos/libfbx.a(libfb_str_format.o)(.text+0x498):libfb_str_format.c: undefined reference to `fb_strNullDesc'
q:/home/ned/bas/frebasic/daily\lib\dos/libfbx.a(libfb_str_format.o)(.text+0x4a5):libfb_str_format.c: undefined reference to `fb_strNullDesc'
q:/home/ned/bas/frebasic/daily\lib\dos/libfbx.a(libfb_time_weekdayname.o)(.text+0x2d):libfb_time_weekdayname.c: undefined reference to `fb_strNullDesc'
q:/home/ned/bas/frebasic/daily\lib\dos/libfbx.a(libfb_time_monthname.o)(.text+0x40):libfb_time_monthname.c: undefined reference to `fb_strNullDesc'
q:/home/ned/bas/frebasic/daily\lib\dos/libfbx.a(libfb_intl_getweekdayname.o)(.text+0xa9):libfb_intl_getweekdayname.c: more undefined references to `fb_strNullDesc' follow
nedman47
Posts: 62
Joined: Dec 05, 2006 15:35

Post by nedman47 »

ok i figured it out. i'm recording the solution here in case someone else has a similar problem some day.

i did a text search for "fbx" in *.bi

there were four hits ... vbcompat.bi, datetime.bi, file.bi, and string.bi

i replaced those files from the cvs repository and the invalid reference went away.
counting_pine
Site Admin
Posts: 6323
Joined: Jul 05, 2005 17:32
Location: Manchester, Lancs

Post by counting_pine »

If you're using a CVS build, it's generally a good idea to have up-to-date copies of all the include files. Some of the changes to the compiler since the last release have broken some of the old headers.
For example, there were a few parameters that were implicitly being passed by reference, but the new dialect causes them to be passed by value instead. This could cause errors, which you wouldn't know about until you encountered them at runtime.
The new headers have been fixed in CVS, so now there are no implicit parameters.
In any case, glad to hear you managed to solve your problem.
Post Reply