[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 309
  • Last Modified:

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
0
coope08
Asked:
coope08
  • 6
  • 5
  • 2
2 Solutions
 
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
 
jkrCommented:
If the result is a Windows CE executable, you can't run that on a desktop PC.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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
 
jkrCommented:
Try to add that thorugh 'Project|Add existing Item...', navigate to the .lib and double click to select it.
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

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 6
  • 5
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now