soccer jersey forums.silverfrost.com :: View topic - Trouble linking with DLL
forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Trouble linking with DLL

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
wahorger



Joined: 13 Oct 2014
Posts: 1225
Location: Morrison, CO, USA

PostPosted: Wed Apr 26, 2023 8:55 pm    Post subject: Trouble linking with DLL Reply with quote

I'm getting an error 902 "Unable to read size of import symbols". I have no idea what that means, nor how to fix it.

The DLL is being built by CodeLite. I have other DLL's built with this tool and MinGW compiler, and they do not have this problem.

I have attached a link to the DLL itself in case that might be of help.

Bill

https://www.dropbox.com/s/7aicvv8fw0cqhyi/dxflib_dll_normal%20-%20Copy.dll?dl=0
Back to top
View user's profile Send private message Visit poster's website
wahorger



Joined: 13 Oct 2014
Posts: 1225
Location: Morrison, CO, USA

PostPosted: Tue May 02, 2023 4:23 am    Post subject: Reply with quote

I don't know if there is an issue with Plato or not, but here's what I had to do for the externally generated DLL to use it in Plato.

Plato creates a BuildLog file that contains the commands used to compile/link. Here is the file as created:
Quote:
FTN95.EXE "Z:\DXF_Decode\MAIN.for" /NO_BANNER /VS7 /DELETE_OBJ_ON_ERROR /ERROR_NUMBERS /UNLIMITED_ERRORS /IMPORT_LIB "dxflib_dll_normal.dll" /WIDE_SOURCE /FPP /CFPP /BINARY "Release\Win32\MAIN.obj"
slink.exe "dxflib_dll_normal.dll" -OUT:"Release\Win32\DXF_Decoder.exe" @"Z:\DXF_Decode\link.lst"

Unfortunately, it does not link up OK. The errors are:
Quote:
Linking...
WARNING the following symbols are missing:
dxf_circle_ftn95 Z:\DXF_Decode\Release\Win32\MAIN.obj
(Z:\DXF_DECODE\MAIN.FOR)
start_block_acad_ftn95 Z:\DXF_Decode\Release\Win32\MAIN.obj
(Z:\DXF_DECODE\MAIN.FOR)
dxf_solid_ftn95 Z:\DXF_Decode\Release\Win32\MAIN.obj
(Z:\DXF_DECODE\MAIN.FOR)
dxf_deinit_ftn95 Z:\DXF_Decode\Release\Win32\MAIN.obj
(Z:\DXF_DECODE\MAIN.FOR)
end_block_acad_ftn95 Z:\DXF_Decode\Release\Win32\MAIN.obj
(Z:\DXF_DECODE\MAIN.FOR)
dxf_symbol_ftn95 Z:\DXF_Decode\Release\Win32\MAIN.obj
(Z:\DXF_DECODE\MAIN.FOR)
dxf_line_ftn95 Z:\DXF_Decode\Release\Win32\MAIN.obj
(Z:\DXF_DECODE\MAIN.FOR)
dxf_ellipse_ftn95 Z:\DXF_Decode\Release\Win32\MAIN.obj
(Z:\DXF_DECODE\MAIN.FOR)
dxf_init_ftn95 Z:\DXF_Decode\Release\Win32\MAIN.obj
(Z:\DXF_DECODE\MAIN.FOR)
Creating executable: Release\Win32\DXF_Decoder.exe
Linking completed.



However, the following (manually created) file compiles and links just fine.
Quote:
FTN95.EXE "Z:\DXF_Decode\MAIN.for" /NO_BANNER /VS7 /DELETE_OBJ_ON_ERROR /ERROR_NUMBERS /UNLIMITED_ERRORS /IMPORT_LIB "dxflib_dll_normal.dll" /WIDE_SOURCE /FPP /CFPP /BINARY "Release\Win32\MAIN.obj"
slink.exe -OUT:"DXF_Decoder.exe" @"Z:\DXF_Decode\link.lst" -rlo:"dxflib_dll_normal.dll"

The differences in the generated command lines are subtle. In Plato, in the Project description, I specified the Import Library. This worked with the compile, but not for the Link. I tried a number of different ways to specify the library and get the link step to work, but was not successful.

I only point this out in case that you might need to do some alternate language programming and need to use a DLL. In this instance, I was testing the interface and output products. Using the DLL for "production" is not done in Plato.
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8012
Location: Salford, UK

PostPosted: Tue May 02, 2023 7:50 am    Post subject: Reply with quote

Bill

The error report comes from the linker SLINK.exe. A linker can't process all DLLs. In the case of SLINK, only those that are 32 bit DLLs and conform to the COFF standard.
Back to top
View user's profile Send private message AIM Address
wahorger



Joined: 13 Oct 2014
Posts: 1225
Location: Morrison, CO, USA

PostPosted: Tue May 02, 2023 2:01 pm    Post subject: Reply with quote

Paul, SLINK is used in both cases. And the second case works, I believe, due to the order of the arguments. I'd experienced this before when building my own MAKE files. Perhaps in the second case the -rlo was not required.

What I have found, and it makes sense, is that the arguments that contain files to be loaded/scanned are processed in the same order as the command line. Thus, in the Plato example, having the DLL show up first means it gets processed but because there is nothing that needs resolution, SLINK forges onward, processing the list of object files. And the DLL is never "re-scanned".
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group