We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

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

gregfoote
gregfoote asked
on
Medium Priority
603 Views
Last Modified: 2012-05-04

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)

Comment
Watch Question

Commented:
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

Commented:
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"
}

Author

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.
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.