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 

LINK : error - Function Main has been loaded more than once

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





PostPosted: Wed Nov 02, 2005 9:21 pm    Post subject: LINK : error - Function Main has been loaded more than once Reply with quote

I'm trying to compile ARPACK from www.netlib.org into a .NET assembly.

Everything compiles without error, but when the linker runs I get the error
LINK : error - Function Main has been loaded more than once

I have no function named "Main" and the project is a dll, so it has no PROGRAM entrypoint.

I'm not familiar with Fortran -- just trying to use ARPACK through .NET -- so I may be missing something
obvious.

Thanks
Back to top
PaulLaidler
Site Admin


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

PostPosted: Thu Nov 03, 2005 12:47 am    Post subject: LINK : error - Function Main has been loaded more than once Reply with quote

Andrew

Are you using
a) a Visual Studio project
b) a Plato project or
c) a command prompt?

With a) and b) you should ensure that you have set the correct file type (DLL) in the Properties.

With a) you can look at the command line used by VS via a link in the output window (and post it here if you cannot sort it out).

With c) you could also post the commands that you have used.
Back to top
View user's profile Send private message AIM Address
Anonymous
Guest





PostPosted: Thu Nov 03, 2005 10:17 am    Post subject: LINK : error - Function Main has been loaded more than once Reply with quote

Paul-

Thanks for responding Smile

I'm using VS2003

I've since seperated ARPACK into three dlls: one for its LAPACK component, one for its BLAS component, and one for the distinct ARPACK source.

Both LAPACK and BLAS dlls build with no errors. The ARPACK dll has the same properties as the other two, will compile, but won't link

Here is the command line for linking

Command line for link:
dbk_link.exe /VS7 /NO_BANNER /REF:"c:WINDOWSMicrosoft.NETFrameworkv1.1.4322System.dll";"c:WINDOWSMicrosoft.NETFrameworkv1.1.4322System.Data.dll";"c:WINDOWSMicrosoft.NETFrameworkv1.1.4322System.XML.dll";"C:Documents and SettingsAndrew OlneyMy DocumentsVisual Studio ProjectsARPACK .NETDebugNETARPACK BLAS.dll";"C:Documents and SettingsAndrew OlneyMy DocumentsVisual Studio ProjectsARPACK .NETDebugNETARPACK LAPACK.dll" "DebugNETARPACK.dll" @"C:Documents and SettingsAndrew OlneyMy DocumentsVisual Studio ProjectsARPACK .NETlink.lst"
Linker output:
LINK : error - Function Main has been loaded more than once

I've posted the source I'm using (750K) at https://umdrive.memphis.edu/aolney/temp/ARPACK%20.NET.zip

It seems like maybe there's something about the src in the ARPACK dll that the linker doesn't like. I can't find a 'function' keyword, and I can't find a 'main' that is not part of a comment.

Thanks

Back to top
Anonymous
Guest





PostPosted: Thu Nov 03, 2005 10:17 am    Post subject: LINK : error - Function Main has been loaded more than once Reply with quote

Paul-

Thanks for responding Smile

I'm using VS2003

I've since seperated ARPACK into three dlls: one for its LAPACK component, one for its BLAS component, and one for the distinct ARPACK source.

Both LAPACK and BLAS dlls build with no errors. The ARPACK dll has the same properties as the other two, will compile, but won't link

Here is the command line for linking

Command line for link:
dbk_link.exe /VS7 /NO_BANNER /REF:"c:WINDOWSMicrosoft.NETFrameworkv1.1.4322System.dll";"c:WINDOWSMicrosoft.NETFrameworkv1.1.4322System.Data.dll";"c:WINDOWSMicrosoft.NETFrameworkv1.1.4322System.XML.dll";"C:Documents and SettingsAndrew OlneyMy DocumentsVisual Studio ProjectsARPACK .NETDebugNETARPACK BLAS.dll";"C:Documents and SettingsAndrew OlneyMy DocumentsVisual Studio ProjectsARPACK .NETDebugNETARPACK LAPACK.dll" "DebugNETARPACK.dll" @"C:Documents and SettingsAndrew OlneyMy DocumentsVisual Studio ProjectsARPACK .NETlink.lst"
Linker output:
LINK : error - Function Main has been loaded more than once

I've posted the source I'm using (750K) at https://umdrive.memphis.edu/aolney/temp/ARPACK%20.NET.zip

It seems like maybe there's something about the src in the ARPACK dll that the linker doesn't like. I can't find a 'function' keyword, and I can't find a 'main' that is not part of a comment.

Thanks

Back to top
Anonymous
Guest





PostPosted: Thu Nov 03, 2005 12:14 pm    Post subject: LINK : error - Function Main has been loaded more than once Reply with quote

Apparently there were 2 files in the src directory for ARPACK that only contained the string 'END'

This was confusing the linker. Also I realized that I'm not working off the latest patch for ARPACK, so I'm
going to try that.

As an interesting note, I found the problem when I changed the build from .NET to Win32. That seems to use a
different linker, and that linker gave me more to go on than the .NET linker.

Thanks
Back to top
Andrew



Joined: 09 Sep 2004
Posts: 232
Location: Frankfurt, Germany

PostPosted: Thu Nov 03, 2005 4:01 pm    Post subject: LINK : error - Function Main has been loaded more than once Reply with quote

There are indeed two different linkers (SLINK for Win32 and DBK_LINK for .NET), depending on what you are trying to achieve the different linkers can provide different diagnostics.
Back to top
View user's profile Send private message
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