Compling for DOS Error message - not a clue what it means -

DOS specific questions.
Gablea
Posts: 1104
Joined: Apr 06, 2010 0:05
Location: Northampton, United Kingdom
Contact:

Compling for DOS Error message - not a clue what it means -

Post by Gablea »

Hi all,

When I complie my FreeBASIC application for DOS I get the following error message form the Complier
c:\fbc_dos\bin\dos\as.exe: NPoS.o: .text: reloc overflow: 0x109cf > 0xffff
NPoS.o: File truncated
NPoS.asm: Assembler messages:
NPoS.asm:269482: FATAL: can't close NPoS.o
:File truncated
Any one have any idea's what this means?

I did add the following line to some of the code

#If Defined(__FB_WIN32__) as some of the code is desgined to work ONLY on windows (the setfoucs command for example) BUT the Application is desgined to run on Windows and DOS (and at some point when I have the time to run on Linux)

Any advice is most welcome as this is a new one on me
TJF
Posts: 3809
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Post by TJF »

I'm not sure:

The text segment of an object file may be restricted to 64 kB (0xffff) on Dos. -> Try to make smaller object files (compiling units).
fxm
Moderator
Posts: 12106
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Post by fxm »

In order to produce a DOS.exe file, I execute always a cross compilation from Windows to a DOS target (compiler option : -target dos), using FreeBASIC package for DOS (DOS cross compilation tools installed only in the /lib/ and /bin/ directories of the FreeBASIC package for Windows).

Consequently, I can use any IDE for Windows.

Besides, this way should avoid any limitation due to FBC-DOS compiler (not use of fbc.exe for DOS, but always use of fbc.exe for win32).
Gablea
Posts: 1104
Joined: Apr 06, 2010 0:05
Location: Northampton, United Kingdom
Contact:

Post by Gablea »

ok I tried it with the -target DOS option and now I am getting the following error

C:\FBC_WIN\fbc -target dos "NPoS.bas"
C:\FBC_WIN\inc\crt\sys\types.bi(17) error 24: File not found, "crt/sys/dos/types.bi" in '#include once "crt/sys/dos/types.bi"'

Build error(s)

Any idea's?
j_milton
Posts: 458
Joined: Feb 11, 2010 17:35

Post by j_milton »

Gablea wrote:ok I tried it with the -target DOS option and now I am getting the following error

C:\FBC_WIN\fbc -target dos "NPoS.bas"
C:\FBC_WIN\inc\crt\sys\types.bi(17) error 24: File not found, "crt/sys/dos/types.bi" in '#include once "crt/sys/dos/types.bi"'

Build error(s)

Any idea's?
change the forward slashes in file names in your source code to backslashes
Gablea
Posts: 1104
Joined: Apr 06, 2010 0:05
Location: Northampton, United Kingdom
Contact:

Post by Gablea »

C:\FBC_WIN\fbc -target dos "NPoS.bas"
C:\FBC_WIN\inc\crt\sys\types.bi(17) error 24: File not found, "crt\sys\dos\types.bi" in '#include once "crt\sys\dos\types.bi"'

Build error(s)

Saying File not found

I have copied the DOS files to the c:\fbc folder (under the Bin & Inc folders) and it is still saying the above
fxm
Moderator
Posts: 12106
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Post by fxm »

In order to satisfy the line '#include once "crt/sys/dos/types.bi"' :

Copy the directory "FreeBASIC_DOS_Package\inc\crt\sys\dos" into "FreeBASIC_WIN32_Package\inc\crt\sys"
Last edited by fxm on Dec 08, 2010 13:37, edited 1 time in total.
Gablea
Posts: 1104
Joined: Apr 06, 2010 0:05
Location: Northampton, United Kingdom
Contact:

Post by Gablea »

Yep done that and still saying File not found

If I complie it from the cmd I get file not found on one of my include files

BUT the strange thig is this complies and RUNS with no problem when complied for Windows
Gablea
Posts: 1104
Joined: Apr 06, 2010 0:05
Location: Northampton, United Kingdom
Contact:

Post by Gablea »

OK folks it now complies BUT I am getting this message at the end of the build
C:\FBC_WIN\fbc -target dos "NPoS.bas"
c:/fbc_win/bin/dos/as.exe: NPoS.o: .text: reloc overflow: 0x109cf > 0xffff
NPoS.o: File truncated
NPoS.asm: Assembler messages:
NPoS.asm:269318: FATAL: can't close NPoS.o
: File truncated

Make done
It is saying make done but there is no exe in the project's folder
fxm
Moderator
Posts: 12106
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Post by fxm »

I am desolated but as thinks @TJF, it seems to be a real problem of DOS assembler only. Try what he suggests to you.
j_milton
Posts: 458
Joined: Feb 11, 2010 17:35

Post by j_milton »

Gablea wrote:OK folks it now complies BUT I am getting this message at the end of the build
C:\FBC_WIN\fbc -target dos "NPoS.bas"
c:/fbc_win/bin/dos/as.exe: NPoS.o: .text: reloc overflow: 0x109cf > 0xffff
NPoS.o: File truncated
NPoS.asm: Assembler messages:
NPoS.asm:269318: FATAL: can't close NPoS.o
: File truncated

Make done
It is saying make done but there is no exe in the project's folder
Make done just means that "make" finished running, not that is was successful :-(

This is just a guess but I know that there is a lot of user interface stuff in your PoS program. It may be that you have more than 64K of string literals (characters inside " " ) in a single module and that is what is causing the link step to fail.
I am pretty sure there are folks here who know more than I do about the DOS mode compiler that can tell me if this is one of the memory model barriers that remain...
Gablea
Posts: 1104
Joined: Apr 06, 2010 0:05
Location: Northampton, United Kingdom
Contact:

Post by Gablea »

Er ok guys how do I make smaller Object files then?
MichaelW
Posts: 3500
Joined: May 16, 2006 22:34
Location: USA

Post by MichaelW »

I doubt that the size of the object module is the problem. This code:

Code: Select all

asm
    .rept 1000000
        xor eax, eax  '' 2 bytes
    .endr
end asm
print "OK"
sleep
Compiles (slowly) without error (v 0.21.1-win32 to Windows or DOS target, or 0.21.1-DOS) and the EXE runs as expected.

And the same for a 4x version that produces a 8,000,636 byte object module.
Gablea
Posts: 1104
Joined: Apr 06, 2010 0:05
Location: Northampton, United Kingdom
Contact:

Post by Gablea »

Could it be beacuse I have code that is desgined for windows?

but that is controled by the #If Defined(__FB_WIN32__)

Any one else have any idea's?

I can complie it with no problems for Windows (not tried Linux yet as I have never used that OS)
MichaelW
Posts: 3500
Joined: May 16, 2006 22:34
Location: USA

Post by MichaelW »

Does the code use any of the features not supported by the DOS version, as specified here:

http://www.freebasic.net/wiki/wikka.php?wakka=FaqDOS
Post Reply