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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem linking libraries for WindowsCE and ARM platform

Status
Not open for further replies.

izzz

Technical User
Oct 15, 2010
2
ES
Hello,

I'm working with an embedded ARM platform with WindowsCE and external libraries. I managed to adapt the libraries for WindowsCE with the SDK of my platform (that libraries are not intended for WindowsCE but Windows, QNX and others, some of the functions are not able in WindowsCE). The libraries compile OK but when I use them in a console project (for example) I only get linker errors like:

error LNK2019: símbolo externo nd_m_malloc sin resolver al que se hace referencia en la función rcb_info_var_create
error LNK2019: símbolo externo nd_m_free sin resolver al que se hace referencia en la función rcb_info_var_destroy
error LNK2001: símbolo externo m_smem_ctxt sin resolver
error LNK2019: símbolo externo getch sin resolver al que se hace referencia en la función kbService
error LNK2019: símbolo externo kbhit sin resolver al que se hace referencia en la función kbService
error LNK2019: símbolo externo setbuf sin resolver al que se hace referencia en la función main
error LNK2019: símbolo externo stricmp sin resolver al que se hace referencia en la función _transportType_EFun

...and so on...

So I don't know what's happening. I included the libraries and headers folder in the Options - Projects - Directories section, I also included the .lib libraries name inside the dependencies section.

As a test, I tried to create a dummy project with a dummy library. The library has four functions. Inside that functions I use two standard functions (_gecth and sqrt). I create the library and use it in a dummy project. That's a console project where I can call the functions from the dummy library. In this case, compiling for Win32 works OK, but when compiling with the SDK I have the same problem, linker error:

error LNK2019: símbolo externo _getch sin resolver al que se hace referencia en la función dummySuma

Any idea?

---------------

DUMMY LIBRARY

dummyLib.h

int dummySuma(double a, double b, double *ret);
int dummyResta(double a, double b, double *ret);
int dummyMultiplicacio(double a, double b, double *ret);
int dummyDivisio(double a, double b, double *ret);
int dummySqrt(double a, double *ret);

dummyLib.c

#include "dummyLib.h"
#include "conio.h"
#include "math.h"

int dummySuma(double a, double b, double *ret)
{
*ret = a+b;
_getch();
return 0;
}

int dummyResta(double a, double b, double *ret)
{
*ret = a-b;
return 0;
}

int dummyMultiplicacio(double a, double b, double *ret)
{
*ret = a*b;
return 0;
}

int dummyDivisio(double a, double b, double *ret)
{
if((b==0) || (a==0 && b==0))
return -1;
*ret = a/b;
return 0;
}

int dummySqrt(double a, double *ret)
{
*ret = sqrt(a);
return 0;
}

DUMMY CONSOLE PROJECT

dummyLib.h

int dummySuma(double a, double b, double *ret);
int dummyResta(double a, double b, double *ret);
int dummyMultiplicacio(double a, double b, double *ret);
int dummyDivisio(double a, double b, double *ret);
int dummySqrt(double a, double *ret);

main.c

#include "stdio.h"
#include "dummyLib.h"

int main(int argc, char * argv[])
{
double c=9, d=3, e=-1, f=-5, g=0;
dummySqrt(c,&d);
dummySuma(c,d,&e);
dummyResta(d,e,&g);
return 0;
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top