SOLVED: dxe_tmp.o: linker output file has more than one section

DOS specific questions.
Post Reply
exagonx
Posts: 314
Joined: Mar 20, 2009 17:03
Location: Italy
Contact:

SOLVED: dxe_tmp.o: linker output file has more than one section

Post by exagonx »

Hello friends.
I realized that when I try to compile a library with -lib it gives me this error, it does it only on DOS, I have a doubt that I'm doing something wrong, maybe I'm skipping steps that don't need to under linux or windows.

FreeBASIC 1.09.0

test.bas

Code: Select all


function RetriveString(ByVal RowString as String)as String export
	Return left(RowString,3)
end function

command Line option:
fbc test.bas -dll

output:
dxe_tmp.o: linker output file has more than one section

It also causes error on a PC with Windows 98 from DOS and from the prompt window

output:
Error: neither DXE_LD_LIBRARY_PATH nor DJDIR are set in evironment

Do I have to make some settings or is it a bug?
Last edited by exagonx on Dec 08, 2022 20:27, edited 1 time in total.
dodicat
Posts: 7976
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: dxe_tmp.o: linker output file has more than one section

Post by dodicat »

But you are using -dll, not -lib?
I have recently been experimenting with win 98 and fbdos.
Running the win 98 dos box and using fb dos is quite different from booting into dos and using fb dos.
DOS proper does not support dynamic linking (dll), but it should support static linking (.a)
Try using -lib (as your original idea)
marcov
Posts: 3455
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Re: dxe_tmp.o: linker output file has more than one section

Post by marcov »

(afaik dxe files are a limited runtime loadable entity, and generated from .o's by dxe3gen or so)
exagonx
Posts: 314
Joined: Mar 20, 2009 17:03
Location: Italy
Contact:

Re: dxe_tmp.o: linker output file has more than one section

Post by exagonx »

dodicat wrote: Dec 06, 2022 13:18 But you are using -dll, not -lib?

DOS proper does not support dynamic linking (dll), but it should support static linking (.a)
Try using -lib (as your original idea)
Thanks, worked with -lib
But there is one thing if I update the library the main file acts like the library is still the old one, it seems that while compiling the library file is included in the created executable file.
Is there a way to update just the libraries without having to recompile the main file as well?

With -o and subsequently -dll the creation of the library is successful but when I go to compile the main file the error appears, which cannot find the library
exagonx
Posts: 314
Joined: Mar 20, 2009 17:03
Location: Italy
Contact:

Re: dxe_tmp.o: linker output file has more than one section

Post by exagonx »

marcov wrote: Dec 06, 2022 14:49 (afaik dxe files are a limited runtime loadable entity, and generated from .o's by dxe3gen or so)
Yes, in fact I had to create the .o file first and then create the .a file with the .dxe but using #inclib gives an error that the file is not found even if it is in the same directory
coderJeff
Site Admin
Posts: 4313
Joined: Nov 04, 2005 14:23
Location: Ontario, Canada
Contact:

Re: dxe_tmp.o: linker output file has more than one section

Post by coderJeff »

exagonx wrote: Dec 06, 2022 3:23 Error: neither DXE_LD_LIBRARY_PATH nor DJDIR are set in evironment
This was something that was only improved in fbc 1.10.0. In fbc 1.09.0 you will need to manually set it.

Have a look at Shared Libraries - DOS in the wiki.

Using #inclib + dll + DOS requires some extra steps and there is an example in the wiki.

The import library is created should be "tmp_il.a" and so in theory should work with #inclib "tmp_il".

EDIT: actually, if you are limited by 8.3 DOS naming, then might need to keep the library name to only 2 characters because of the current logic. Sorry, I didn't test right now, but:
- linker expects a prefix of "lib"
- generating the import library adds a suffix "_il.a"
- So, library "XX" becomes "libXX_il.a" and long file names are probably going to give troubles if limited by 8.3 file naming.
exagonx
Posts: 314
Joined: Mar 20, 2009 17:03
Location: Italy
Contact:

Re: dxe_tmp.o: linker output file has more than one section

Post by exagonx »

coderJeff wrote: Dec 06, 2022 19:02
This was something that was only improved in fbc 1.10.0. In fbc 1.09.0 you will need to manually set it.
Its Available the 1.10.0 of FreeBASIC ?
The Latest version who I can download are the 1.09.0

Anyway I opted for the creation of the libraries believing that I could only update the libraries without having to recompile the main program, at the suggestion I used the -lib option which creates the library .a but during the compilation I saw that the code of the libraries is included in the final executable.
fxm
Moderator
Posts: 12081
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: dxe_tmp.o: linker output file has more than one section

Post by fxm »

Only patches for Windows standalone fbc 1.09.0 to fbc 1.10.0 winlibs/gcc-9.3 (2022.07.16) are available.

Apply: http://www.execulink.com/~coder/freebasic/builds.html
then unzip: 'fbc64_lastest.zip' from https://users.freebasic-portal.de/sarg/
dodicat
Posts: 7976
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: dxe_tmp.o: linker output file has more than one section

Post by dodicat »

exagonx wrote: Dec 07, 2022 7:53
coderJeff wrote: Dec 06, 2022 19:02
This was something that was only improved in fbc 1.10.0. In fbc 1.09.0 you will need to manually set it.
Its Available the 1.10.0 of FreeBASIC ?
The Latest version who I can download are the 1.09.0

Anyway I opted for the creation of the libraries believing that I could only update the libraries without having to recompile the main program, at the suggestion I used the -lib option which creates the library .a but during the compilation I saw that the code of the libraries is included in the final executable.
The static .a builds into the .exe, so update the library, and re compile your code using the lib (.a), you shouldn't have to change any lines in your main.bas file.
dll's are generally much bigger, and have to accompany your exe, but yes, you can update your .dll without re compiling your main code.
So, you are presented with a choice.
I am new to fbdos, but I can get DOS 7 from win 98.
I find that win 98 will not run fb now, but what the heck, we have fb DOS, Linux, Windows, gas, gas64, gcc, lang "qb", lang "fblite", . . .
and only a couple of developers.
coderJeff
Site Admin
Posts: 4313
Joined: Nov 04, 2005 14:23
Location: Ontario, Canada
Contact:

Re: dxe_tmp.o: linker output file has more than one section

Post by coderJeff »

dodicat wrote: Dec 07, 2022 11:47 I find that win 98 will not run fb now, but what the heck, we have fb DOS, Linux, Windows, gas, gas64, gcc, lang "qb", lang "fblite", . . .
and only a couple of developers.
Ah, good point. We build a release for fbc on Win XP that should work for Win 98. But I can't remember last time I actually worked on anything actually inside of win98.
coderJeff wrote: Jan 01, 2022 15:21 FreeBASIC-1.09.0-win32-mingworg.7z | .zip archive - standalone package that may work better for older Win32 systems (fbc.exe)
That build uses mingw.org toolchain (a fork of cygwin). But based on the download counts from https://sourceforge.net/projects/fbc/fi ... -mingworg/ almost nobody uses it.

Your post prompted me to have a quick check for mingw.org, and it's gone. And looks like being overhauled at https://mingw.osdn.io/ with a project page at https://osdn.net/projects/mingw/

My feeling was mingw project was stale, but their latest pages appear to show updates last year. The main fbc windows builds are based on mingw-w64 project.
exagonx
Posts: 314
Joined: Mar 20, 2009 17:03
Location: Italy
Contact:

Re: dxe_tmp.o: linker output file has more than one section

Post by exagonx »

Thank you too all for your support.
Post Reply