Forum Discussion
Altera_Forum
Honored Contributor
16 years agojeffa and cooi23,
You are using a completely different version of MSVC++ than what I have. You are probably using the newest with .net would be my guess. I do not know what the inclusion of .net really ever brought to the table, but that is not a topic of discussion which is applicable to an Altera knowledge blog. As I have said before, I am not a Windows programmer. In fact, I despise the Windows OS. It is nothing more than hacked-up layer upon layer of fixed mistakes over the years which needs to support as many flavors of hardware as there is electromagnetic spectrum. Each time a 'new' version is released, it inevitably consumes more and more resources. This is not efficient, nor is it a wise business model. With that rant out of the way, I did a search on the __clrcall directive and found this: **Microsoft Specific** "Specifies that a function can only be called from managed code. Use __clrcall for all virtual functions that will only be called from managed code. However this calling convention cannot be used for functions that will be called from native code." This implies that this is to be used with virtual functions. Virtual functions (methods) are only used with C++ in derived classes when you want to over-ride the base class method functionality. It also says that it is to be used "with managed code". This also implies that a some sort of code repository system is in place such as CVS or MS SourceSafe would be my guess. Finally, it says, "cannot be used for functions what will be called from native code". Obviously, this is precisely what we are doing! Furthermore, the code is written in C, and not C++, so that blows the virtual function issue out of the water as well. I think that as jeffa has eluded, it comes down to preference or project setting that is using __clrcall instead of __cdecl when linking. You should be looking for first before attempting other fixes. It has been my experience that problems with the linker are inevitably always a setting problem.