Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29246 Discussions

Problem with dfor.lib (error LNK2001: unresovled external symbol)

alex_wolf2002
Beginner
840 Views
Im using 2 projects, "Fortran Windows Application" and "QuickWin", in one Workspace.
The Fortran Windows Application Project is for In- and Output purposes, the QuickWin for a calculation program. I have to use this QuickWin-Project to get two Graphics-Librarys(disp.lib and relp.lib)running.
And I get now the following Error:
dfor.lib(DFORMAIN.OBJ) : error LNK2001: unresovled external symbol _MAIN__
One of the Graphic Librarys(relp.lib) has several calls to this dfor.lib, but I dont know how to deactivate the dfor.lib
Is there a chance that I get the whole program running?
Here are some additional information:
Im using CVF Professional Edition 6.5.0
Link Settings for the projects:
1. Fortan Windows Application Project:
kernel32.lib c: empdisp.lib c: emp elp.lib /nologo /subsystem:windows
/incermental:yes /pdb:"Debug/lt.pdb" /debug /machine:l386
/out:"Debug/lt.exe" /pdbtype:sept
2. QuickWin Project:
kernel32.lib c: empdisp.lib c: emp elp.lib /nologo /entry:"WinMainCRTStartup
/subsystem:windows /incermental:yes /pdb:"Debug/cf.pdb" /debug /machine:l386
/nodefaultlib:"dfconsol.lib" /out:"Debug/cf.exe" /pdbtype:sept
Thanks toeveryboby, who can help me.
Alex
0 Kudos
3 Replies
Steven_L_Intel1
Employee
840 Views
A QuickWin project cannot be a library - it must be an executable application. You could, I suppose, extend the user interface by adding Win32 calls, but QuickWin expects to see a Fortran main program (and not WinMain@16).
0 Kudos
alex_wolf2002
Beginner
840 Views
Ok thanks Steve, got that point.
is it then possible to generate a main program in QuickWin which calls the WinMain@16?
Something like:
program main
call WinMain( hInstance, hPrevInstance, lpszCmdLine, nCmdShow )
end program
When I try this, I get the errormessage:
main.obj : error LNK2001: unresolved external symbol _WINMAIN@16
Sorry for this perhaps stupid question but Im only programming for time to time.
0 Kudos
Steven_L_Intel1
Employee
840 Views
You won't be able to call it _WinMain@16, but I suppose you can have a subroutine which creates windows. You'd really want to have any message loops in their own thread, otherwise the QuickWin code wouldn't be able to execute.

Note that if you are trying to call WinMain, you will need a directive in the caller identical to the one in your WinMain routine. But don't bother - you'll just get another error from the linker if you do, since QuickWin supplies its own WinMain.
0 Kudos
Reply