error LNK2019: unresolved external symbol imc_timed_status_line referenced in function trnMoveItem

Hi All,

I have inherited an old C application that we ran on a handheld barcode scanner (dos os).  We just bought new barcode scanners that have the Windows CE OS on them and I am upgrading the old C code to be compatible with the CE environment.  I am receiving the above error when I try to build the project.  I think I am just missing the library or something.  I am using Microsoft eMbedded Visual C++ 4.0 to do the conversion.  Below are code snipets.  I'm not real sure why this won't work and any help would be greatly appreciated!!!

Here is the definition in a header file called imscreen.h

int far imc_timed_status_line(char far * pszStatusLine,IM_USHORT iTimeout, IM_USHORT iLine);

I am including the header file in my main C program:

//INCLUDES//
#include "imt24lib.h"
#include "imstdio.h"
#include "imscreen.h"
#include "string.h"
#include "conio.h"
#include "iman.h"


Here is where the variable is being set within the function trnMoveItem:

  if ( iTranStatus == TRXEX_OK )
  {
    im_status_line ( EmptyString, IM_FALSE, IMgiStatusLine );
    imc_timed_status_line ( "Move accepted...", IMgiStatusTime, IMgiStatusLine );
    iReturnValue = trnCopyMove( );
  }
 

All the pieces seem to be there so that is why I am thinking it could be a library issue???  Any help would be great.  

Thanks!
Courtney
coope08Asked:
Who is Participating?
 
jkrCommented:
Try to add that thorugh 'Project|Add existing Item...', navigate to the .lib and double click to select it.
0
 
jkrCommented:
Try to declare that function as

extern "C"
int far imc_timed_status_line(char far * pszStatusLine,IM_USHORT iTimeout, IM_USHORT iLine);

If the above is in a file with a .cpp extension, C++ name mangling can cause that error.
0
 
coope08Author Commented:
Thanks jkr,

That cleared up the linking error but now I have another error:


Error executing clarm.exe


ideas???
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
jkrCommented:
If the result is a Windows CE executable, you can't run that on a desktop PC.
0
 
itsmeandnobodyelseCommented:
>>>> Error executing clarm.exe

Most likely the imt24lib.dll (or whatever is the name) couldn't be loaded. Put it into the same directory as teh executable.

Regards, Alex


0
 
coope08Author Commented:
Here, sorry, I didn't scroll up enough (there are something like 150 warnings that I am ignoring at the minute) to see what the actual error was, I just assumed that the Error executing clarm.exe was the only error.  Here is the real error below:


c:\program files\intermec\developer library\include\imscreen.h(675) : error C2059: syntax error : 'string'

it's thrown at the declaration above that I changed to extern "C" (extern "C" int far imc_timed_status_line(char far * pszStatusLine,IM_USHORT iTimeout, IM_USHORT iLine);)
0
 
jkrCommented:
Remove the 'far' statements, they'e no longer needed:

extern "C"
int imc_timed_status_line(char* pszStatusLine,IM_USHORT iTimeout, IM_USHORT iLine);
0
 
coope08Author Commented:
Still getting the same error but here is what that line of code looks like now:

extern "C" int imc_timed_status_line(char * pszStatusLine, IM_USHORT iTimeout, IM_USHORT iLine);


Also, just to clarify:

typedef unsigned short  IM_USHORT;


Thanks Again!
0
 
jkrCommented:
Ah, I see - the same with

#ifdef __cplusplus
#define EXTERN_C extern "C"
#else
#define EXTERN_C
#endif

EXTERN_C int imc_timed_status_line(char * pszStatusLine, IM_USHORT iTimeout, IM_USHORT iLine);

?
0
 
coope08Author Commented:
nope, that didn't work either, back to the linker error...  I included the def of IM_USHORT cuz I thought it might be of some use?  Sorry I am so unhelpful.  C/C++ was never a strong suit of mine.


Linking...
iman.obj : error LNK2019: unresolved external symbol imc_timed_status_line referenced in function trnMoveItem
ARMV4IDbg/IMAN.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

0
 
jkrCommented:
Hm, is this the only error? Maybe you forgot to link with the .lib file. Is there a 'imt24.lib' (or similar)?
0
 
coope08Author Commented:
yes, this is the only error.  See below.  

I am doing the following:  under Tools, Options, Directories (Show directories for Include files) I have mapped a path to the C:\Program Files\Intermec\Developer Library\Include directory where the .h files exist and under Tools, Options, Directories (Show directories for Library files) I have mapped a path to C:\Program Files\Intermec\Developer Library\Lib\WCE420\iCE-Premium\ArmV4I where the imt24.lib and all the other vendor supplied libraries exist.  

Under Project, Settings, Link, the only object/library modules listed here are commctrl.lib and coredll.lib so I may be missing it here but when I add imt24.lib (just the name not the path to the library) it doesn't change.  I think this is where I am confused.  I ma not sure what the settings for the project should be.



--------------------Configuration: IMAN - Win32 (WCE ARMV4I) Debug--------------------
Linking...
iman.obj : error LNK2019: unresolved external symbol imc_timed_status_line referenced in function trnMoveItem
ARMV4IDbg/IMAN.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

IMAN.exe - 2 error(s), 0 warning(s)


0
 
itsmeandnobodyelseCommented:
Try

#ifdef __cplusplus
extern "C"
{
#endif

int imc_timed_status_line(char * pszStatusLine,IM_USHORT iTimeout, IM_USHORT iLine);

#ifdef __cplusplus
}
#endif

Regards, Alex

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.