replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - Adding FTN95 lib to VS C project
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 

Adding FTN95 lib to VS C project

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



Joined: 26 Oct 2011
Posts: 10

PostPosted: Tue Apr 10, 2012 7:48 am    Post subject: Adding FTN95 lib to VS C project Reply with quote

I am having problems adding a FTN95 Fortran library to my Visual C Project using visual studio. The C project is for win32, not .NET. I am compiling my C project as C, not cpp, and I am using the MS C compiler that comes with VS2010.

My FTN95 library contains one top level function that takes no arguments that I believe can be found by the C linker, as I have selected Export All in the FTN95 library project.


It looks to me that I may also need to include a fortran run time library or something in my Visual C project, instead of just the code library. But I can not find any reference to having to do this. The code library also uses a module, if that makes a difference.

Any help on what I may need to do will be appreciated. .

I get the following errors:
> Generating Code...
1>gasdata.lib(GasData.obj) : error LNK2019: unresolved external symbol _ADJUSTL# referenced in function _GASDATAMOD!WRITECSV_CHAR
1>gasdata.lib(GasData.obj) : error LNK2019: unresolved external symbol _WSF1## referenced in function _GASDATAMOD!INITGASDATA
1>gasdata.lib(GasData.obj) : error LNK2019: unresolved external symbol _R4#WSF referenced in function _GASDATAMOD!INITCSV_REAL
1>gasdata.lib(GasData.obj) : error LNK2019: unresolved external symbol _I4#WSF referenced in function _GASDATAMOD!INITCSV_INT
1>gasdata.lib(GasData.obj) : error LNK2019: unresolved external symbol _CH#WSF referenced in function _GASDATAMOD!INITCSV_REAL
1>gasdata.lib(GasData.obj) : error LNK2019: unresolved external symbol _WSF2# referenced in function _GASDATAMOD!WRITECSV_END
1>gasdata.lib(GasData.obj) : error LNK2019: unresolved external symbol _RSF1## referenced in function _GASDATAMOD!INITGASDATA
1>gasdata.lib(GasData.obj) : error LNK2019: unresolved external symbol _GETARG referenced in function _GASDATAMOD!COMMANDLINE
1>gasdata.lib(GasData.obj) : error LNK2019: unresolved external symbol ___adjust_stack_f referenced in function _GASDATAMOD!DEFINEORDER
1>gasdata.lib(GasData.obj) : error LNK2019: unresolved external symbol _CCOMP# referenced in function _GASDATAMOD!DEFINEORDER
1>gasdata.lib(GasData.obj) : error LNK2019: unresolved external symbol _I4#RSF referenced in function _GASDATAMOD!INITGASDATA
1>gasdata.lib(GasData.obj) : error LNK2019: unresolved external symbol ___CCOPY referenced in function _GASDATAMOD!INITGASDATA
1>gasdata.lib(GasData.obj) : error LNK2019: unresolved external symbol ___CONCAT referenced in function _GASDATAMOD!INITGASDATA
1>gasdata.lib(GasData.obj) : error LNK2019: unresolved external symbol _OPEN## referenced in function _GASDATAMOD!INITGASDATA
1>gasdata.lib(GasData.obj) : error LNK2019: unresolved external symbol _RWIN## referenced in function _INITANNUALDATA
1>gasdata.lib(GasData.obj) : error LNK2019: unresolved external symbol ___alloc_times referenced in function _ANNUALDATA
1>gasdata.lib(GasData.obj) : error LNK2019: unresolved external symbol ___DEALLOCATE referenced in function _ANNUALDATA
1>gasdata.lib(GasData.obj) : error LNK2019: unresolved external symbol ___ALLOCATE1 referenced in function _ANNUALDATA
1>gasdata.lib(GasData.obj) : error LNK2019: unresolved external symbol _RSU1## referenced in function _ANNUALDATA
1>gasdata.lib(GasData.obj) : error LNK2019: unresolved external symbol _XSUX# referenced in function _ANNUALDATA
1>gasdata.lib(GasData.obj) : error LNK2019: unresolved external symbol _EXIT referenced in function _GASDATAMAIN
1>.\Debug\GasplanAccessOutput.exe : fatal error LNK1120: 21 unresolved externals
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Tue Apr 10, 2012 11:49 am    Post subject: Reply with quote

You will need to reference salflibc.dll.

However, this will probably not solve all of the issues and you should consider using SCC as your C compiler. Then everything will link together by using SLINK.
Back to top
View user's profile Send private message AIM Address
Nathan



Joined: 26 Oct 2011
Posts: 10

PostPosted: Tue Apr 10, 2012 12:30 pm    Post subject: Reply with quote

Hi Paul
Thanks for your quick response. I did try adding the static library salflibc.lib. However I then got the error message saying that printf etc had been redefined. I expect in a clash with libc.lib from MS. Is there anything I can do about this, or is this why you say to use SCC?

Is there a way to still use the VS project, but use SCC instead ? Or is the only option Plato or a Makefile ?

Thanks
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Tue Apr 10, 2012 1:54 pm    Post subject: Reply with quote

salflibc.lib is a combined static and import library that is used by SLINK to resolve external functions that are accessed at runtime from salflibc.dll.

There is probably a way to use the Microsoft compiler but I don't know how to do this and this approach is not supported by Silverfrost. Basically you will need to find out how to set the application's entry point _SALFStartup.

You may be able to use SCC from Visual Studio, however, Plato is very much like Visual Studio and is configured to handle FTN95, SCC and SLINK in a seamless way.
Back to top
View user's profile Send private message AIM Address
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