- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am going to compile a program codeing of software. All the files are in the subroutine and/or function format. I've written a main program to eliminate the linking error as "error LNK2019: unresolved external symbol _MAIN__ referenced in function _main". The initiatesoftware run commands are included in the function entiteled CE_QUAL_W2 as below
INTEGER(4) FUNCTION CE_QUAL_W2 (DLG)
! CVF specific code
USE DFLOGM; USE MSCLIB; USE DFWIN, RENAMED => DLT;
!DEC$ATTRIBUTES STDCALL :: ce_qual_w2
!DEC$ATTRIBUTES REFERENCE :: Dlg
USE IFPORT ! to get current working directory
USE MAIN
USE GLOBAL; USE NAMESC; USE GEOMC; USE LOGICC; USE PREC; USE SURFHE; USE KINETIC; USE SHADEC; USE EDDY
USE STRUCTURES; USE TRANS; USE TVDC; USE SELWC; USE GDAYC; USE SCREENC; USE TDGAS; USE RSTART
use macrophytec; use porosityc; use zooplanktonc !v3.5
include "omp_lib.h" ! OPENMP directive to adjust the # of processors
EXTERNAL RESTART_OUTPUT
TYPE (DIALOG) :: DLG
INTEGER :: RESULT
.
.
.
END FUNCTION CE_QUAL_W2
I've added the main program as below
program waterqualities
USE DFLOGM; USE MSCLIB; USE DFWIN
USE IFPORT ! to get current working directory
USE MAIN
USE GLOBAL; USE NAMESC; USE GEOMC; USE LOGICC; USE PREC; USE SURFHE; USE KINETIC; USE SHADEC; USE EDDY
TYPE (DIALOG) :: DDLG
RunsRes=CE_QUAL_W2 (DDLG)
end program waterqualities
I have the error message as "error LNK2019: unresolved external symbol _CE_QUAL_W2 referenced in function _MAIN__". Would you please help me. I've attached the files.
Bests
M. Saadatpour
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
INTERFACE
INTEGER(4) FUNCTION CE_QUAL_W2 (DLG)
USE DFLOGM
TYPE (DIALOG) :: DLG
END FUNCTION
END INTERFACE
so that the compiler knows what to look for.
Ensure that your function definition code is included in your project.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Regards

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