Solved

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

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
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 pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

757 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

18 Experts available now in Live!

Get 1:1 Help Now