- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I apologize for asking a Visual Studio question, but I am really stuck.I'm attempting to build a Microsoft Visual Studio 2008 project that interacts with an external DLL (cfitsio.dll,lib obtained from http://heasarc.gsfc.nasa.gov/docs/software/fitsio/fitsio.html). This library is coded in C but has a Fortran interface.
The cfitsio library includes a test program (testf77.f) from which an f90 version (testf90.f90) has been created. The library documentation indicates a test executable may be built with the following command:
ifort /libs:dll cfitsio.lib /MD /fpp /extfpp:cfortran.h,fitsio.h /iface:cvf testf77.f
The f90 version was built as follows:
ifort /libs:dll cfitsio.lib /MD /fpp /extfpp:cfortran.h,fitsio.h /iface:cvf testf90.f90
and the resulting executable works as expected.
However, my attempts to create the executable in Visual Studio have been unsuccessful. For example, when cfitsio.lib is specified in the "Linker|Input|Additional Dependencies" field of the Project "Property Pages", the following Link errors result:
[bash]Compiling with Intel Visual Fortran Compiler XE 12.0.1.127 [IA-32]... ifort /nologo /debug:full /Od /warn:interfaces /module:"Debug\\" /object:"Debug\\" /Fd"Debug\vc90.pdb" /traceback /check:bounds /libs:static /threads /dbglibs /c /Qvc9 /Qlocation,link,"c:\Program Files\Microsoft Visual Studio 9.0\VC\\bin" "C:\Documents and Settings\jim.vickroy\My Documents\Visual Studio 2008\Projects\Ftn_cFITSIO_DLL\Ftn_cFITSIO_DLL_test\testf90.f90" C:\Documents and Settings\jim.vickroy\My Documents\Visual Studio 2008\Projects\Ftn_cFITSIO_DLL\Ftn_cFITSIO_DLL_test\testf90.f90(599): remark #8290: Recommended relationship between field width 'W' and the number of fractional digits 'D' in this edit descriptor is 'W>=D+3'. write(*,'(1x,2A,i10,A,f16.14,A,I4)') 'KEY_PKYT ',':', ijkey,':', idkey, comment(1:16), status -----------------------------^ Linking... Link /OUT:"Debug\Ftn_cFITSIO_DLL_test.exe" /INCREMENTAL:NO /NOLOGO /LIBPATH:"C:\Documents and Settings\jim.vickroy\My Documents\Visual Studio 2008\Projects\Ftn_cFITSIO_DLL\Ftn_cFITSIO_DLL_test" /MANIFEST /MANIFESTFILE:"C:\Documents and Settings\jim.vickroy\My Documents\Visual Studio 2008\Projects\Ftn_cFITSIO_DLL\Ftn_cFITSIO_DLL_test\Debug\Ftn_cFITSIO_DLL_test.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"C:\Documents and Settings\jim.vickroy\My Documents\Visual Studio 2008\Projects\Ftn_cFITSIO_DLL\Ftn_cFITSIO_DLL_test\Debug\Ftn_cFITSIO_DLL_test.pdb" /SUBSYSTEM:CONSOLE /IMPLIB:"C:\Documents and Settings\jim.vickroy\My Documents\Visual Studio 2008\Projects\Ftn_cFITSIO_DLL\Ftn_cFITSIO_DLL_test\Debug\Ftn_cFITSIO_DLL_test.lib" "Debug\testf90.obj" Link: executing 'link' testf90.obj : error LNK2019: unresolved external symbol _FTVERS referenced in function _MAIN__ testf90.obj : error LNK2019: unresolved external symbol _FTOPEN referenced in function _MAIN__ ... [additional "unresolved external symbol" messages deleted --jv][/bash]
I would appreciate suggestions on how to fix this (or what I should be reading).
Thanks,
-- jv
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I (finally) discovered that by pasting the command-line compiler options
[bash]/libs:dll cfitsio.lib /MD /fpp /extfpp:cfortran.h,fitsio.h /iface:cvf[/bash]into the Project "Property Pages" under "Configuration Properties | Fortran | Command Line", the Linker errors were resolved and the resulting executable worked as expected.
Sorry for the wasted bandwidth.
-- jv

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page