Ive got the .lib file that contains SXMonitor, SXOpenPBX etc but I still get these errors ?


Generating Code...
Linking...
   Creating library vfpocx.lib and object vfpocx.exp
VfpocxCtl.obj : error LNK2001: unresolved external symbol "int __cdecl SXMonitor(unsigned long * *,int,...)" (?SXMonitor@@YAHPAPAKHZZ)
VfpocxCtl.obj : error LNK2001: unresolved external symbol "int __cdecl SXOpenPBX(int,...)" (?SXOpenPBX@@YAHHZZ)
VfpocxCtl.obj : error LNK2001: unresolved external symbol "int __cdecl SXInit(int,...)" (?SXInit@@YAHHZZ)
VfpocxCtl.obj : error LNK2001: unresolved external symbol "struct SXDigits * __cdecl SX_DialedDigits(union _SXEvent *)" (?SX_DialedDigits@@YAPAUSXDigits@@PAT_SXEvent@@@Z)
VfpocxCtl.obj : error LNK2001: unresolved external symbol "struct SXNumber * __cdecl SX_CallingDeviceNumber(union _SXEvent *)" (?SX_CallingDeviceNumber@@YAPAUSXNumber@@PAT_SXEvent@@@Z)
VfpocxCtl.obj : error LNK2001: unresolved external symbol "int __cdecl SX_EventState(union _SXEvent *)" (?SX_EventState@@YAHPAT_SXEvent@@@Z)
VfpocxCtl.obj : error LNK2001: unresolved external symbol "char * __cdecl SXGetText(int,...)" (?SXGetText@@YAPADHZZ)
vfpocx.ocx : fatal error LNK1120: 7 unresolved externals
Error executing link.exe.

vfpocx.ocx - 8 error(s), 0 warning(s)

gregfooteAsked:
Who is Participating?
 
tinchosConnect With a Mentor Commented:
I guess that you're missing another library in the linking process then.
Probably one related to sockets

Hope this helps

Tincho
0
 
tinchosCommented:
Hi gregfoote,

I guess that you should add the library so that it is linked with the whole project.

In order to do so in MSVC 6 you should add the directory where it is placed in

Tools -> Directories -> Library Files

And for the project properties in the Link tab

If you're using another compiler check where those settings are placed.

Hope this helps

Tincho
0
 
chensuCommented:
If you have done what tinchos mentions and still get the errors, your .lib file may be created with the C linkage. You may need to specify the C linkage when including the header file as follows.

extern "C"
{
#include "sx.h"
}
0
 
gregfooteAuthor Commented:

Thanks Guys,

Using the external C linkage and the above errors went away and were replaced by these external reference errors from within the libs themselves ?

   Creating library vfpocx.lib and object vfpocx.exp
libmtai.lib(aplintrf.obj) : error LNK2001: unresolved external symbol _WSACleanup@0
libmtai.lib(socket.obj) : error LNK2001: unresolved external symbol _WSACleanup@0
libmtai.lib(aplintrf.obj) : error LNK2001: unresolved external symbol _closesocket@4
libmtai.lib(ssusetup.obj) : error LNK2001: unresolved external symbol _closesocket@4
WinOpenSSL.lib(bss_sock.obj) : error LNK2001: unresolved external symbol _closesocket@4
WinOpenSSL.lib(bss_sock.obj) : error LNK2001: unresolved external symbol _WSAGetLastError@0
libmtai.lib(aplintrf.obj) : error LNK2001: unresolved external symbol _WSAGetLastError@0
libmtai.lib(socket.obj) : error LNK2001: unresolved external symbol _WSAGetLastError@0
libmtai.lib(sockhndl.obj) : error LNK2001: unresolved external symbol _WSAGetLastError@0
libmtai.lib(ssuname.obj) : error LNK2001: unresolved external symbol _WSAGetLastError@0
libmtai.lib(aplintrf.obj) : error LNK2001: unresolved external symbol _recv@16
WinOpenSSL.lib(bss_sock.obj) : error LNK2001: unresolved external symbol _recv@16
libmtai.lib(socket.obj) : error LNK2001: unresolved external symbol _WSAStartup@8
libmtai.lib(sockhndl.obj) : error LNK2001: unresolved external symbol _send@16
WinOpenSSL.lib(bss_sock.obj) : error LNK2001: unresolved external symbol _send@16
libmtai.lib(sockhndl.obj) : error LNK2001: unresolved external symbol _gethostname@8
libmtai.lib(ssuname.obj) : error LNK2001: unresolved external symbol _gethostname@8
libmtai.lib(sockhndl.obj) : error LNK2001: unresolved external symbol _select@20
libmtai.lib(ssusetup.obj) : error LNK2001: unresolved external symbol _shutdown@8
WinOpenSSL.lib(bss_sock.obj) : error LNK2001: unresolved external symbol _shutdown@8
libmtai.lib(ssuname.obj) : error LNK2001: unresolved external symbol _listen@8
libmtai.lib(ssuname.obj) : error LNK2001: unresolved external symbol _bind@12
libmtai.lib(ssuname.obj) : error LNK2001: unresolved external symbol _setsockopt@20
libmtai.lib(ssuname.obj) : error LNK2001: unresolved external symbol _getsockopt@20
libmtai.lib(ssuname.obj) : error LNK2001: unresolved external symbol _socket@12
libmtai.lib(ssuname.obj) : error LNK2001: unresolved external symbol _htons@4
libmtai.lib(ssuname.obj) : error LNK2001: unresolved external symbol _inet_addr@4
libmtai.lib(ssuname.obj) : error LNK2001: unresolved external symbol _gethostbyname@4
libmtai.lib(ssuname.obj) : error LNK2001: unresolved external symbol _connect@12
libmtai.lib(ssuname.obj) : error LNK2001: unresolved external symbol _inet_ntoa@4
WinOpenSSL.lib(MiSSL.obj) : error LNK2001: unresolved external symbol __imp__recv@16
WinOpenSSL.lib(MiSSL.obj) : error LNK2001: unresolved external symbol __imp__send@16
WinOpenSSL.lib(MiSSL.obj) : error LNK2001: unresolved external symbol __imp__ntohl@4
WinOpenSSL.lib(MiSSL.obj) : error LNK2001: unresolved external symbol __imp__ntohs@4
WinOpenSSL.lib(MiSSL.obj) : error LNK2001: unresolved external symbol __imp__htons@4
WinOpenSSL.lib(MiSSL.obj) : error LNK2001: unresolved external symbol __imp__htonl@4
WinOpenSSL.lib(MiSSL.obj) : error LNK2001: unresolved external symbol ___WSAFDIsSet@8
WinOpenSSL.lib(MiSSL.obj) : error LNK2001: unresolved external symbol __imp__select@20
WinOpenSSL.lib(MiSSL.obj) : error LNK2001: unresolved external symbol __imp__setsockopt@20
WinOpenSSL.lib(MiSSL.obj) : error LNK2001: unresolved external symbol __imp__closesocket@4
WinOpenSSL.lib(MiSSL.obj) : error LNK2001: unresolved external symbol __imp__accept@12
WinOpenSSL.lib(MiSSL.obj) : error LNK2001: unresolved external symbol __imp__listen@8
WinOpenSSL.lib(MiSSL.obj) : error LNK2001: unresolved external symbol __imp__WSAGetLastError@0
WinOpenSSL.lib(MiSSL.obj) : error LNK2001: unresolved external symbol __imp__bind@12
WinOpenSSL.lib(MiSSL.obj) : error LNK2001: unresolved external symbol __imp__socket@12
WinOpenSSL.lib(bss_sock.obj) : error LNK2001: unresolved external symbol _WSASetLastError@4
vfpocx.ocx : fatal error LNK1120: 35 unresolved externals
Error executing link.exe.
0
 
chensuConnect With a Mentor Commented:
Add Ws2_32.lib to your linker options.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.