Re: Linker error in calling an IPC function
Mohammad Hashemian wrote:
I want to write a real time application in windows XP using RTX.
Beware: AFAIK, XP is not realtime capable, so depending on what RT
requirements you have you should carefully evaluate what you got sold
there!
RTX has a header file named rtapi.h that was wrotten in C.
Error LNK2028: unresolved token (0A000024) "extern "C" void * __stdcall
RtCreateSharedMemoryW(unsigned long,unsigned long,unsigned long,wchar_t
const *,void * *)" (?RtCreateSharedMemoryW@@$$J220YGPAXKKKPB_WPAPAX@Z)
referenced in function "int __cdecl main(void)" (?main@@$$HYAHXZ)
Two things here:
1. The 'W' suffix seems to indicate that the function is TCHAR-based (4th
parameter). This concept, albeit old, is not always understood by vendors,
so I wouldn't be surprised to see that it is broken. Try not defining
_UNICODE and UNICODE and see if that helps.
2. The symbol it is looking for indicates that that it is a C++ function
because of the mangled name (parameters encoded into the name) but you say
the header is a C header. This typically happens when the functions were
not declared as 'extern "C"' for C++. Make sure the header has these and
retrofit them if not.
In both cases there are hints that this is not the case, one because there
even is a different W-suffixed function and the other because the linker
says the function was 'extern "C"', so I could be wrong.
Uli