I'm hoping somebody can shed some light on a bit of trouble I'm having. I have a solution comprising two projects, one Fortran and one C++. The C++ project builds as a DLL and is called by a Fortran executable. If I place the C++ project and associated files anywhere but in Visual Studio/Projects/MyProject I get the following error during the build: StuRSE.obj : error LNK2019: unresolved external symbol __imp__Initialize referenced in function _RUNRSE
StuRSE.obj : error LNK2019: unresolved external symbol __imp__PreSolve referenced in function _RUNRSE
StuRSE.obj : error LNK2019: unresolved external symbol __imp__RKSolve referenced in function _RUNRSE
StuRSE.obj : error LNK2019: unresolved external symbol __imp__PostSolve referenced in function _RUNRSE
Debug\FTLOADDS.exe : fatal error LNK1120: 4 unresolved externals
Initialize, PreSolve, RKSolve and PostSolve are all C++ subroutines that are called by Fortran using the following interface: Interface to Subroutine Initialize ( input_xml, output_xml, rsname ) !DEC$ Attributes C, DLLIMPORT, alias: "_Initialize" :: Initialize
INTEGER*1, Dimension (50):: input_xml, output_xml, rsname !new input files as arrays of chars instead of strings
!DEC$ Attributes REFERENCE :: input_xml
!DEC$ Attributes REFERENCE :: output_xml
!DEC$ Attributes REFERENCE :: rsname
END
Interface to Subroutine PreSolve ( num_var, vars )
!DEC$ Attributes C, DLLIMPORT, alias: "_PreSolve" :: PreSolve
Integer(kind=4) :: num_var
Real(kind=8), Dimension(num_var) :: vars
End
Interface to Subroutine PostSolve ( num_var, vars )
!DEC$ Attributes C, DLLIMPORT, alias: "_PostSolve" :: PostSolve
Integer(kind=4) :: num_var
Real(kind=8), Dimension(num_var) :: vars
End
Interface to Subroutine RKSolve ( time_step, rk_order, num_var, vars )
!DEC$ Attributes C, DLLIMPORT, alias: "_RKSolve" :: RKSolve
Integer(kind=4) :: num_var
Integer(kind=4) :: rk_order
Real(kind=8) :: time_step
Real(kind=8), Dimension(num_var) :: vars
End
While I can resolve the external symbols by simply moving the files into Visual Studio/Projects/MyProjects I really don't want them in that particular directory. What I can't figure out is what to do resolve the external symbols once I've changed the relative position of the files... Is it likely to be hard-coded somewhere in the C++ code, or is it something I can control with project settings somehow? I'm still pretty green when it comes to this stuff so I just don't know how to tell.
When the C++ code is in the "right" place everything works great, but as soon as I move it I'm stuck with the above errors. None of the additional libraries set in Linker refer to directories containing the code associated with errors. Maybe something in Additional Dependencies? Something to do with where the DLL is?
Thanks very much!




