Strange errors
Strange errors
I’ve written a short program with FB 1.07. No problems for compilers Windows and Linux either 32 or 64 bit.
I tried to transfer it under DOS (MS-DOS 6.22 in Virtualbox) for older pcs but I got the following error notification:
- - - - - -
ld: cannot find filetocompile.o: Too many open files (EMFILE)
ld: cannot find -lfb
ld: cannot find -lgcc
ld: cannot find -lc
ld: cannot find -lm
- - - - - -
I tried to re-name the corresponding libraries (libfb.a, libgcc.a, liblc.a, libm.a), that I found at
c:\fb107\lib\dos. I also tried to move the re-named files into the directory that contains compilers and source (fbc and filetocompile.bas).
Of course I also inserted in Path c:\fb107 and c:\fb107\lib\dos.
Same error came up again.
Any suggestions?
I tried to transfer it under DOS (MS-DOS 6.22 in Virtualbox) for older pcs but I got the following error notification:
- - - - - -
ld: cannot find filetocompile.o: Too many open files (EMFILE)
ld: cannot find -lfb
ld: cannot find -lgcc
ld: cannot find -lc
ld: cannot find -lm
- - - - - -
I tried to re-name the corresponding libraries (libfb.a, libgcc.a, liblc.a, libm.a), that I found at
c:\fb107\lib\dos. I also tried to move the re-named files into the directory that contains compilers and source (fbc and filetocompile.bas).
Of course I also inserted in Path c:\fb107 and c:\fb107\lib\dos.
Same error came up again.
Any suggestions?
Re: Strange errors
Did you compile it with at top:
#lang "qb"
(and with FreeBASIC-1.07.1-dos)
#lang "qb"
(and with FreeBASIC-1.07.1-dos)
Re: Strange errors
Mine is not a "qb" program, in an "fb" program.
Anyway I tried to compile as you suggested, but as expected I have had some syntax error messages.
Sorry.
Anyway I tried to compile as you suggested, but as expected I have had some syntax error messages.
Sorry.
Re: Strange errors
Does work the cross-compilation from Windows compiler to DOS executable?
In case you are trying to do a native compilation in DOS system with DOS FB-compiler to DOS executable it is rather some DOS specific problém than a problém in your code.
It can be related to LFN (long file names) support. Or the DOS limitation about maximal number of opened files (something like that sugests the error message).
In real DOS system can be the limit for opened files increase by editing the configuration file CONFIG.SYS. How is it done in emulated environments I don't know.
Anyway, your problem should be easy to analyse for DOS users because it is replicable. If you provide the sources it should not be so hard.
In case you are trying to do a native compilation in DOS system with DOS FB-compiler to DOS executable it is rather some DOS specific problém than a problém in your code.
It can be related to LFN (long file names) support. Or the DOS limitation about maximal number of opened files (something like that sugests the error message).
In real DOS system can be the limit for opened files increase by editing the configuration file CONFIG.SYS. How is it done in emulated environments I don't know.
Anyway, your problem should be easy to analyse for DOS users because it is replicable. If you provide the sources it should not be so hard.
Re: Strange errors
Cross compilation? You mean to compile with FB for DOS in command line window (CMD)?. I don't know, never tried.
Compiled with FreeDOS in Virtualbox works fine.
But I need a compiler working in *every* DOS environment so i am converting to good(?) old (1988) QB 4.5, saving Freebasic for Linux and Windows.
p.s.: With QB 4.5 works :(
Compiled with FreeDOS in Virtualbox works fine.
But I need a compiler working in *every* DOS environment so i am converting to good(?) old (1988) QB 4.5, saving Freebasic for Linux and Windows.
p.s.: With QB 4.5 works :(
Re: Strange errors
It works in QB 4.5?
And what about the calls from C libraries?
Do you use in your code some explicite linking with C-library files? (I don't know the proper FB syntax but simething like: "#INCLIB GCC.A" ). Or your code is just "pure" basic code without any attempts to call anything external?
Because if you do not use any INCLIB or INCLUDE it means that you have severely damaged installation of FreeBasic
And what about the calls from C libraries?
Do you use in your code some explicite linking with C-library files? (I don't know the proper FB syntax but simething like: "#INCLIB GCC.A" ). Or your code is just "pure" basic code without any attempts to call anything external?
Because if you do not use any INCLIB or INCLUDE it means that you have severely damaged installation of FreeBasic
Re: Strange errors
Mine is "pure basic" but in FB I needed an ' #INCLUDE "file.bi" ' to run "filecopy".
In QB 4.5 I used a ' SHELL "COPY ... " '
FB with Linux and Windows works fine, and looks fine also QB in MS-DOS 6.22
In QB 4.5 I used a ' SHELL "COPY ... " '
FB with Linux and Windows works fine, and looks fine also QB in MS-DOS 6.22
??? Why??? Only I do not use any other library.Laaca wrote: .....
Because if you do not use any INCLIB or INCLUDE it means that you have severely damaged installation of FreeBasic
Re: Strange errors
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ffracca wrote:I’ve written a short program with FB 1.07. No problems for compilers Windows and Linux either 32 or 64 bit.
I tried to transfer it under DOS (MS-DOS 6.22 in Virtualbox) for older pcs but I got the following error notification:
- - - - - -
ld: cannot find filetocompile.o: Too many open files (EMFILE)
This is the error message here which plainly states the cause. You apparently missed it.
Of course it did because none of that is the problem. The problem is "Too many open files."I tried to re-name the corresponding libraries (libfb.a, libgcc.a, liblc.a, libm.a), that I found at
c:\fb107\lib\dos. I also tried to move the re-named files into the directory that contains compilers and source (fbc and filetocompile.bas).
Of course I also inserted in Path c:\fb107 and c:\fb107\lib\dos.
Same error came up again.
This is jogging some very old memories here. If I recall there's a way to increase the number of files DOS allows to be open at one time using the FILES=### line in config.sys. There's also something about FILESHIGH, which may also need to be set. I think I remember setting both of these back in the day.
Something else you need to realize about FB for DOS is that it's a 32-bit program that requires a working 32-bit DOS extender environment. I think the DJGPP-based binaries in FreeBASIC come with their own built-in extender but you need to make sure things are set up correctly. FreeDOS will have everything you need out of the box. I can't remember how to make MS-DOS work. Needs EMM386.sys? I'm not sure. Anyway FB nor any FBC-compiled executables will work on a 286 or older. 386 is required.
Re: Strange errors
Thank you caseih. I'll work on it. Somewhere I still have my old MS DOS manuals (back to 4.01).
About 386, my fist one was in 1989.
:-D
I suppose that 31 years old is enough!
About 386, my fist one was in 1989.
:-D
I suppose that 31 years old is enough!
Re: Strange errors
But this command line: "fbc filetocompile.bas" can't work in normal DOS environment!
Because FILETOCOMPILE.BAS has longer name than usual 8+3 DOS file name format. Don't rely on the 3rd party LFN drivers. In some situations they may not work.
Because FILETOCOMPILE.BAS has longer name than usual 8+3 DOS file name format. Don't rely on the 3rd party LFN drivers. In some situations they may not work.
Re: Strange errors
True I had forgotten about that!
Re: Strange errors
Filetocompile.bas is only an example. The right name of my program is Bitbasso.bas (8+3)
Also with:
DEVICE = EMM386.EXE RAM
FILES = 50
in CONFYG.SYS nothing changes.
My last hope is to compile in FreeDOS an run the executable in MS DOS.
Also with:
DEVICE = EMM386.EXE RAM
FILES = 50
in CONFYG.SYS nothing changes.
My last hope is to compile in FreeDOS an run the executable in MS DOS.