and the def file was added with
EXPORTS
connection
The exported function "connection" has been found through tool dumpbin /exports, However, when the c++ project was compiled, it showed "error LNK1127 library is corrupt"(the lib file generated by visual prolog). I checked the similar code on both 32bit platforms, it worked well. Is there is a solution as my main program is large and is c++ 64bit?
Thanks
Jonasydy
This is a know issue, which we are examining, but don't yet have a solution for.
You can however load the DLL dynamically using LoadLibrary in C++, but the details about this must be found in a C++ documentation.
Notice that your C++ declaration must have __stdcall modifier (it will not solve this problem, but is necessary nevertheless).
Also notice that returning a string is tricky, because Visual Prolog strings are garbage collected when they are no longer visible from Visual Prolog.
Finally notice that the preferred way to export DLL predicates from Visual Prolog is by means of the #exports directive (i.e. rather than having a DEF file). A standard VIP DLL project illustrates this.