- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Folks, compiling with IFORT 2021.9 under Windows with VS 17.5.
I have about 50 "DialogBoxParam" call-back functions, all with the same interface, etc. They compile correctly, but the Linker complains about two:
"": error: incompatible calling convention declarations for routine mrwe_arrows
the Linker puts this message in the Error List 3 times, though the routine is called about 50 times.
"": error: incompatible calling convention declarations for routine mrwe_pifile
the Linker puts this message in the Error List 6 times, though the routine is called 2 times.
Any suggestions about what is going on?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes the callbacks need to be stdcall convention. The interface I use look like:
INTERFACE
FUNCTION DialogBoxParam( hInstance, lpTemplateName, hWndParent, lpDialogFunc, dwInitParam) BIND(C,NAME="DialogBoxParamA")
import
integer(INT_PTR) :: DialogBoxParam ! INT_PTR
!DIR$ ATTRIBUTES STDCALL :: DialogBoxParam
!GCC$ ATTRIBUTES STDCALL :: DialogBoxParam
integer(HANDLE), value :: hInstance ! HINSTANCE hInstance
integer(LPVOID), value :: lpTemplateName ! LPCSTR lpTemplateName
integer(HANDLE), value :: hWndParent ! HWND hWndParent
integer(LPVOID), value :: lpDialogFunc ! DLGPROC lpDialogFunc
integer(LONG_PTR), value :: dwInitParam ! LPARAM dwInitParam
END FUNCTION
END INTERFACE
The !GCC$ line is for gfortran..... If you are using module IFWIN the implementation may look a little different I did not check.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, Andrew. The solution was simple: rewrite the code so that each of those two functions was only called from one place. It seems that the Linker detected differences between the multiple calls to each function that were invisible to me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
bizarre, maybe I should open a new thread. Today I get exactly the same error (3 times), the error is not given with a debug build but is with a release build. The call back is in a module, it has an explicit interface. It has worked OK yesterday (and for a long time before that also). And it seems to create a functional exe despite the error message. Any ideas? I am suspecting a problem in the compiler making duff input for the linker.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
>>It has worked OK yesterday
You may have a build dependency order issue. Try a Rebuild Build All
A related issue is when the configuration is missing a Build check box check in the Configuration Manager for the specific Configuration and Platform.
Also, what happens when you change the last argument type to LPVOID?
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I get the error in Ifort in release but all other ifort/ifc/release/debug combination do not get the error.
Linking...
"": error: incompatible calling convention declarations for routine ViewsDlgProc
"": error: incompatible calling convention declarations for routine ViewsDlgProc
"": error: incompatible calling convention declarations for routine ViewsDlgProc
Embedding manifest...
Further I have other stdcall callbacks with exactly the same usage case that work just fine.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Did anyone at Intel look at this , note that the error message is malformed with "" as the start suggesting something is missing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for the smile in my mind in the morning, there are three great statements in life:
1. Let there be light ------------ and Fortran was born
2. What is the meaning of life, the number after the 13th prime, although 1 is a prime, I will talk to God about this mistake in the end. Of course, @mecej4 , can explain why I am wrong. I read part of Wiles proof of the Fermat's Last Theorem, Wiles is not a normal human bean.
3. Do you have a reproducer --- I will not comment as it is just two beautiful for words. (Two is not a mistake)
4. Dad you are a loser --- from my last daughter on being angry with something I said.
You may all decide the incorrect answer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I can't submit the whole project as a reproducer, I will attempt to create one however I have a concern that is may be difficult as there are other call back routines in the code with the same interface/attributes that cause no issues.

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