Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29280 Discussions

CVF's example can't build in IVF8.0+VS.NET2003

Zhanghong_T_
Novice
916 Views
Hello all,
I opened an example project 'MENU' of CVF with VS.NET2003 and Extract Compaq Visual Fortran Project Items, then builtthe solution, there are3 Build Errortasks shown:
menu error LNK2019: unresolved external symbol _PtInRect@8 referenced in function _MenuWndProc@16

menu error LNK2019: unresolved external symbol _HANDLEPOPUPMENU@8 referenced in function _MenuWndProc@16

menu fatal error LNK1120: 2 unresolved externals
Can anyone tell me how should I change the project and its code?
Thanks,
Zhanghong, Tang
0 Kudos
6 Replies
Jugoslav_Dujic
Valued Contributor II
916 Views

Looks like an IVF bug -- the same in both cases. (I have .044 version).

For both system API PtInRect and user-written MenuC.f90::HandlePopupMenu, TYPE(T_POINT) is passed by value. That means it should occupy 8 bytes on the stack rather than 4. Interface blocksin both User32.f90 and MenuD.f90 are correct and state (explicitly or implicitly) that T_POINT is to be passed by value. However, IVF ignores it and adds only 4 bytes in name mangling, resulting in incorrect _PtInRect@8 and _HANDLEPOPUPMENU@8 instead of @12 in both cases.

The workarounds are:

- remove !DEC$ATTRIBUTES VALUE:: ptin both interface and body of HandlePopupMenu

- PtInRect can't be fixed. However, it's simple enough that you can roll your own (pt.x <= rect.right .and. pt.y >= rect.left .and. pt.y >= rect.top .and. pt.y <= rect.bottom).

Steve should I file a bug report or you will take care about it?

Jugoslav

0 Kudos
Steven_L_Intel1
Employee
916 Views
I'll take care of it - thanks.
0 Kudos
Zhanghong_T_
Novice
916 Views

Another question: When I create a new Intel Fortran project of Win32 application of single document interface, it works. But when I open a Win32 Project of the same type created by CVF6.6, it doesn't work. The error is shown below:

cvftest error LNK2019: unresolved external symbol ___WSAFDIsSet@8 referenced in function _FDISSET@8

0 Kudos
Steven_L_Intel1
Employee
916 Views
There are actually two related bugs here:
If you don't say /iface: cvf, then the call of a routine which has a "large argument" gets the decoration right, but a compiled routine has the decoration wrong.
If you do say /iface:cvf, then the opposite happens - the call is wrong but the routine is right!
I have reported both of these.
You may be able to work around this with suitable ALIAS attributes, but I'm not sure if the arguments are actually passed correctly in the /iface:cvf case.
0 Kudos
Zhanghong_T_
Novice
916 Views
Hello Steve,
Thank you very much! I view the comman line by Project->Properties->Configuration Properties->Fortran->Command Line, the 'All Options' displayed:
/nologo /Zi /Od /iface:cvf /iface:mixed_str_len_arg /module:"Debug/" /object:"Debug/" /traceback /check:bounds /libs:static /dbglibs /winapp /c
How can I delete the option of '/iface:cvf /iface:mixed_str_len_arg'?
In addition, sometimes there is no error when build and link a Win32 application, but it doesn't respond when run it. I debugged the project and found it stopped in the code like this:
ghMenu = LoadMenu(hInstance, LOC(lpszMenuName))
if (ghMenu == 0) goto 99999
Here ghMenu has the value of 0 so the application stopped.
Thanks,
Zhanghong, Tang
0 Kudos
Steven_L_Intel1
Employee
916 Views
The /iface settings are on the External Procedures property page.
The other problems you describe may be unrelated.
0 Kudos
Reply