Solved

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

Posted on 2004-04-05
8
539 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)

0
Comment
Question by:gregfoote
  • 2
  • 2
8 Comments
 
LVL 9

Expert Comment

by:tinchos
ID: 10762566
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
 
LVL 23

Expert Comment

by:chensu
ID: 10763051
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
 

Author Comment

by:gregfoote
ID: 10765681

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
 
LVL 9

Accepted Solution

by:
tinchos earned 25 total points
ID: 10766649
I guess that you're missing another library in the linking process then.
Probably one related to sockets

Hope this helps

Tincho
0
 
LVL 23

Assisted Solution

by:chensu
chensu earned 25 total points
ID: 10767540
Add Ws2_32.lib to your linker options.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now