Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

unresolved external symbol ????

Status
Not open for further replies.

daniloa

Programmer
Nov 23, 2001
27
BR
Hi, friends I'm a very begginer on C/C++ development, and I work with telecom development. I has work with another tool, but now I'm going to C++, and I got this error that I don't know how to resolve.
I'm using Microsoft Visual C++ 6/ SP 5 on XP Professional.
When I complile its ok I got no errors, but when I build the program happen this errors messages:

agplay.obj : error LNK2001: unresolved external symbol __imp__dx_stopch
agplay.obj : error LNK2001: unresolved external symbol _ATDV_LASTERR
agplay.obj : error LNK2001: unresolved external symbol _ATDV_ERRMSGP
agplay.obj : error LNK2001: unresolved external symbol __imp__dx_wtring
agplay.obj : error LNK2001: unresolved external symbol __imp__dx_sethook
agplay.obj : error LNK2001: unresolved external symbol __imp__ATDX_FWVER
agplay.obj : error LNK2001: unresolved external symbol __imp__dx_open
agplay.obj : error LNK2001: unresolved external symbol __imp__dx_playf



and the source code is this:



#define _WIN32_WINNT 0x0400

#include <windows.h>

#include <conio.h>
#include <stdio.h>
#include <fcntl.h>

#include <srllib.h>
#include <dxxxlib.h>
#include <sctools.h>

long currentHandle;
long handle;
int event = 0;
int data = 0;
int eventType;
int enableff=0;
int results;

int ch1h;
DV_TPT tpt;
DX_IOTT iott;

DV_DIGIT digp;
void ctrl_c_hdlr(int sig);
DWORD WINAPI play_thread(int *mode);
HANDLE recordh;
int n;
DWORD threadid;
int exitvalue;
int mode;
int fileh;

void ctrl_c_hdlr(int sig){
printf(&quot;Exiting Application\n&quot;);
exitvalue=1;
exit(0);
}
char filename[1024];

int modevalue;

int main( int argc, char *argv[])
{

if (argc <= 1) {
printf(&quot;\n Usage: %s \n\n&quot;,argv[0]);
printf(&quot;\n (i.e.) %s data.vox\n&quot;,argv[0]);
exit(1);
}

sprintf(filename,&quot;%s&quot;,argv[1]);

printf(&quot;File to Open: %s\n&quot;,filename);




if ( (ch1h = dx_open(&quot;dxxxB1C1&quot;,0)) == -1){

printf(&quot;ERROR: on dx_open() on device dxxxB1C1\n&quot;);
printf(&quot;ERROR: is %d\n&quot;,errno);
exit(0);
}
printf(&quot;Opened dxxxB1C1 (%08lx)\n&quot;, ATDX_FWVER(ch1h));

printf (&quot;Going Onhook . . . . . . . . . . &quot;);
if (dx_sethook(ch1h,DX_ONHOOK,EV_SYNC)){
printf (&quot;\n&quot;);
printf (&quot;Error setting onhook\n&quot;);
exit(0);
}
printf(&quot;done\n&quot;);


printf (&quot;Waiting for call . . . . . . . . \n&quot;);
if (dx_wtring(ch1h,1,DX_OFFHOOK,30) == -1) {
printf (&quot;\n&quot;);
printf(&quot;Error executing dx_wtring\n&quot;);
printf(&quot;Last error = %d ErrMsg = %s \n&quot;,ATDV_LASTERR(ch1h),ATDV_ERRMSGP(ch1h));
exit(0);
}
printf (&quot;Ring Event received. Taking Channel Offhook\n&quot;);

printf(&quot;\nSelect one of the options and then dial into channel 1\n\n&quot;);
printf(&quot;\n*** Press \t'1' \tto play %s at 6Khz ADPCM &quot;,filename);
printf(&quot;\n*** Press \t'2' \tto play %s at 8Khz ADPCM&quot;,filename);
printf(&quot;\n*** Press \t'3' \tto play %s at 6Khz PCM &quot;,filename);
printf(&quot;\n*** Press \t'4' \tto play %s at 8Khz PCM &quot;,filename);

printf(&quot;\n\n*** Press \t's' \tto stop playing&quot;);
printf(&quot;\n*** Press \t'ESC' \tto EXIT\n\n\n&quot;);

while( 1 ) {

if ( kbhit() ) {
switch( getch() ) {
case 27:
exit(1) ;
case '1':
// record at 6K ADPCM w/ AGC
modevalue=RM_SR6|MD_ADPCM|EV_SYNC;

recordh = CreateThread(NULL,0,play_thread,
&modevalue,
CREATE_SUSPENDED,&threadid);
SetThreadPriority(recordh , THREAD_PRIORITY_NORMAL);
ResumeThread(recordh );
printf(&quot;\n< Hit 's' to stop recording. Hit 'Esc' to exit >\n&quot;);
break;
case '2':
// record at 8K ADPCM w/ AGC
modevalue=RM_SR8|MD_ADPCM|EV_SYNC;

recordh = CreateThread(NULL,0,play_thread,
&modevalue,
CREATE_SUSPENDED,&threadid);
SetThreadPriority(recordh, THREAD_PRIORITY_NORMAL);
ResumeThread(recordh);
printf(&quot;\n< Hit 's' to stop recording. Hit 'Esc' to exit >\n&quot;);
break;
case '3':
// record at 6K PCM w/ AGC
modevalue=RM_SR6|MD_PCM|EV_SYNC;

recordh = CreateThread(NULL,0,play_thread,
&modevalue,
CREATE_SUSPENDED,&threadid);
SetThreadPriority(recordh, THREAD_PRIORITY_NORMAL);
ResumeThread(recordh);
printf(&quot;\n< Hit 's' to stop recording. Hit 'Esc' to exit >\n&quot;);
break;
case '4':
// record at 8K PCM w/ AGC
modevalue=RM_SR8|MD_PCM|EV_SYNC;

recordh = CreateThread(NULL,0,play_thread,
&modevalue,
CREATE_SUSPENDED,&threadid);
SetThreadPriority(recordh, THREAD_PRIORITY_NORMAL);
ResumeThread(recordh);
printf(&quot;\n< Hit 's' to stop recording. Hit 'Esc' to exit >\n&quot;);
break;

case 's':
// issuing the stopchannel
if ( dx_stopch(ch1h,EV_SYNC) == -1){
printf(&quot;Error issuing stopchannel\n&quot;);
exit(0);
}
printf(&quot;Stop channel issued succesfully\n&quot;);

break;
}
}
}

return 0;
}


DWORD WINAPI play_thread(int *mode)
{
static DV_TPT tptx;
static DX_IOTT iottx;

printf(&quot;...play_thread: Inside the thread\n&quot;);

switch(*mode){
case(RM_SR6|MD_ADPCM|EV_SYNC):
printf(&quot;...play_thread: Play at RM_SR6|MD_ADPCM|EV_SYNC\n&quot;);
break;
case(RM_SR6|MD_PCM|EV_SYNC):
printf(&quot;...play_thread: Play at RM_SR6|MD_PCM|EV_SYNC\n&quot;);
break;
case(RM_SR8|MD_PCM|EV_SYNC):
printf(&quot;...play_thread: Play at RM_SR8|MD_PCM|EV_SYNC\n&quot;);
break;
case(RM_SR8|MD_ADPCM|EV_SYNC):
printf(&quot;...play_thread: Play at RM_SR8|MD_ADPCM|EV_SYNC\n&quot;);
break;

} // end switch


/////////////////////////
printf(&quot;...play_thread: Starting to Play....\n&quot;);

tptx.tp_type = IO_EOT;
tptx.tp_termno = DX_MAXDTMF;
tptx.tp_length = 1;
tptx.tp_flags = TF_MAXDTMF;

printf (&quot;...play_thread: Playing on Channel 1. . . . . . . . . . \n&quot;);

printf(&quot;...play_thread: About to play file: %s\n&quot;,filename);

if (dx_playf(ch1h,filename,&tptx,*mode) == -1) {
printf (&quot;Error playing %s\n&quot;,ATDV_ERRMSGP(ch1h));
}

printf(&quot;...play_thread: Exiting the play thread\n&quot;);
return 1;
}
}

Could you help me ???

Very thanks ...

Danilo Almeida.
 
Thats mean that at the time of linking the libraries, the functions and definitions:

__imp__dx_stopch
__imp__dx_open
.....
and so on.... can not be found to be linked.

Try to look them and add them to your project.

Good Luck.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top