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

Unresolved Externals

wkramer
Beginner
800 Views
Hello,
I am trying to port a small windows application from CVF to IVF.
After some messing about with a personalized version of DFLOGM and IFLOGM I managed to get rid of most unresolved externals.
However, I am still stuck with the unresolved externals summarized in the copy of Buildloq.txt below.
I suppose that some of the values and or types passed to windows API functions are wrong, but I have no idea which functions I am using that invokethese API calls.
Does anyone have an idea?
Regards,
Walter Kramer
IFWIN.LIB(ifwinc.obj) : error LNK2019: unresolved external symbol ___WSAFDIsSet@8 referenced in function _FDISSET@8
IFWIN.LIB(ifwinc.obj) : error LNK2019: unresolved external symbol __imp__AllocateAndInitializeSid@44 referenced in function _fAllocateAndInitializeSid@44
IFWIN.LIB(ifwinc.obj) : error LNK2019: unresolved external symbol __imp__StartServiceCtrlDispatcherA@4 referenced in function _StartServiceCtrlDisp@8
IFWIN.LIB(ifwinc.obj) : error LNK2019: unresolved external symbol __imp__GetAce@12 referenced in function _fGetAce@12
0 Kudos
5 Replies
Steven_L_Intel1
Employee
800 Views
Interesting. Do you have Visual C++.NET installed or are you using the free "Toolkit"?
0 Kudos
wkramer
Beginner
800 Views
I am using visual C++.net 2003.
Perhaps youcan see if there is something wrong with my settings?
I now added the complete Buildlog.txt as well as the buildlog.txt for my personalized version of IFLOGM.
By the way, the only thing I changed to IFLOGM is that I added an action for the WM_CLOSE message to DlgCommonProc:
! WM_CLOSE: ! added by W.A.Kramer
else if (msg .eq. WM_CLOSE) then
id = iand(wparam, Z"ffff")
code = zext(iand(ishft(wparam,-16), Z"ffff"))
if (code.eq.BN_CLICKED) then
call DefaultPushbuttonCallback(dlg,id,code)
endif
! WM_DESTROY:

With CVF it used to be necessary to add "/NODEFAULTLIB libc.lib" this seems not to be required anymore. There is no longer a conflict with another library.
I hope I provided enough information.
Thanks,
Walter Kramer
------ Build started: Project: C99dialog, Configuration: Debug|Win32 ------
Deleting intermediate files and output files for project 'C99dialog', configuration 'Debug|Win32'.
Generate Fortran include file
deftofd "I:IVFC99dialogResource esource.h" "I:IVFC99dialogResource esource.fd"
Compiling resources...
Rc /d "_DEBUG" /l 0x0409 /I "Resource" /fo "Debug/C99dialog.res" I:IVFC99dialogResourceC99dialog.rc
Compiling...
ifort /nologo /Zi /Od /G6 /include:"Debug/" /include:".Resource" /include:"..IncludeNewDlogmRelease" /fpscomp:nolibs /warn:truncated_source /iface:cvf /module:"Debug/" /object:"Debug/" /asmattr:source /asmfile:"Debug/" /traceback /check:bounds /libs:static /threads /winapp /c I:IVFC99dialogSourceC99DIALOGGlobals.f90
ifort /nologo /Zi /Od /G6 /include:"Debug/" /include:".Resource" /include:"..IncludeNewDlogmRelease" /fpscomp:nolibs /warn:truncated_source /iface:cvf /module:"Debug/" /object:"Debug/" /asmattr:source /asmfile:"Debug/" /traceback /check:bounds /libs:static /threads /winapp /c I:IVFC99dialogSourceC99DIALOG.f90
Linking...
Link /OUT:"Debug/C99dialog.exe" /VERSION:1.2 /INCREMENTAL:NO /NOLOGO /DEBUG /PDB:"Debug/C99dialog.pdb" /SUBSYSTEM:WINDOWS version.lib kernel32.lib /MACHINE:I386 Debug/C99DIALOGGlobals.obj Debug/C99DIALOG.obj Debug/C99dialog.res I:IVFIncludeNewdlogmDebugNewdlogm.lib
Link: executing 'link'
IFWIN.LIB(ifwinc.obj) : error LNK2019: unresolved external symbol
___WSAFDIsSet@8 referenced in function _FDISSET@8
IFWIN.LIB(ifwinc.obj) : error LNK2019: unresolved external symbol __imp__AllocateAndInitializeSid@44 referenced in function _fAllocateAndInitializeSid@44
IFWIN.LIB(ifwinc.obj) : error LNK2019: unresolved external symbol __imp__StartServiceCtrlDispatcherA@4 referenced in function _StartServiceCtrlDisp@8
IFWIN.LIB(ifwinc.obj) : error LNK2019: unresolved external symbol __imp__GetAce@12 referenced in function _fGetAce@12
Debug/C99dialog.exe : fatal error LNK1120: 4 unresolved externals

C99dialog build failed.
------ Build started: Project: Newdlogm, Configuration: Release|Win32 ------
Compiling...
ifort /nologo /O3 /G6 /assume:buffered_io /fpp /align:dcommons /align:sequence /iface:cvf /module:"Release/" /object:"Release/" /libs:static /threads /c I:IVFIncludeNewdlogmNewdlogm.f90
Creating library...
Lib /OUT:"Release/Newdlogm.lib" /NOLOGO Release/Newdlogm.obj
xilib: executing 'lib'

Newdlogm build succeeded.
0 Kudos
Jugoslav_Dujic
Valued Contributor II
800 Views
The last three symbols are in Advapi32.lib, and I don't know about the first -- maybe ws2_32.lib. I wonder, however, how they got pulled in at all??? These are rather obscure security APIs. Try switching on /verbose linker option --- maybe you will got a clue.
Instead of tweaking IFLOGM, you can achieve the same effect if you provide a button with IDCANCEL. It may even be hidden. When the dialog is closed via , the return value from DlgModal will be IDCANCEL (=2).
Jugoslav
0 Kudos
Steven_L_Intel1
Employee
800 Views

Here's your problem:

/fpscomp:nolibs

This tells the compiler to not pull in the standard Windows libraries.

0 Kudos
wkramer
Beginner
800 Views

Steve,removing fpscomp:nolibs didn't help.

In CVF I also had fpscomp:nolibs and this functioned OK.
I managed to get rid of the unresolved externals though, by adding advapi32.lib and wsock32 to the link line (/SUBSYSTEM:WINDOWS version.lib kernel32.lib advapi32.lib wsock32.lib)
But the real reason of the problem is that I have been using dfwbase.mod instead of using dfwin.mod.
In CVF dfwbase.mod contains some expilicit interfaces that are not present in IVF, so that is probably the cause.

From now on I will behave and always use ifwin and not the individual modules.

Jugoslav, you are right that I tweaked IFLOGM to make function as required.
I did use the method you mentioned with hidden buttons for Help and About entries in a menu, but I didn't think of using it for the purpose of adding functionality to .
Thanks for the tip.

Regards,

Walter Kramer

0 Kudos
Reply