error LNK2019: unresolved external symbol __imp_EncodePointer

조회 수: 5 (최근 30일)
kazinkie
kazinkie 2015년 6월 23일
댓글: Kirubaa Manoharan 2020년 9월 7일
I am trying to mex a c file, which uses winsock. I use the following command in MATLAB:
mex -v -L"D:\Software\MATLAB\R2014b\sys\lcc64\lcc64\lib64" -lws2_32 -lkernel32 MyFile.cpp
I keep getting the errors:
MSVCRT.lib(crtdll.obj) : error LNK2019: unresolved external symbol __imp_EncodePointer referenced in function pre_c_init MSVCRT.lib(atonexit.obj) : error LNK2001: unresolved external symbol __imp_EncodePointer MSVCRT.lib(crtdll.obj) : error LNK2019: unresolved external symbol __imp_DecodePointer referenced in function _CRT_INIT MSVCRT.lib(atonexit.obj) : error LNK2001: unresolved external symbol __imp_DecodePointer
As I understand it EncodePointer and DecodePointer are contained in the kernel32.lib file, but even when I link this file with -lkernel32, I still have no luck!

답변 (1개)

Anthony Poulin
Anthony Poulin 2015년 6월 24일
Hello,
Do you want to compile a mex file in 64 bits with a library in 32bits?
I think, this is not possible (I never succeed to do it).
You have to include the same library but in 64bits.
  댓글 수: 3
Anthony Poulin
Anthony Poulin 2015년 6월 24일
Yes, it sucks!!
Which compiler are you using?
Kirubaa Manoharan
Kirubaa Manoharan 2020년 9월 7일
I'm facing smiliar issue. I am using SDK 7.1 compiler

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Write C Functions Callable from MATLAB (MEX Files)에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by