special linker error

S

sg10241024

Hello,

I'm programming MS Visual Studio. Net 2003 Professional. I'm a
beginner and now I have a problem while building my new program.

I've got linker error LNK2001: unresolved external symbol "insigned
int:stdcall joyGetPos(unsigend int, struct
joxinfo_tag*)"(?joyGetPos@@$ Joystick
and the linker fatal error LNK1120: 1 unresolved externals.

I've looked for information in the MSDN Library (Oktober 2004). But it
failed.

Maybe I have an error in my program:

#include<windows.h>
#include<stdio.h>

int main()
{
JOYINFO cpi, *pji;
pji=&cpi;
(*pji).wXpos=40;
joyGetPos(0,pji);
return 0;
}

My purpose is to address a joystick.

Thanks for heldping!

Greeting Sarah
 
A

Antti Keskinen

Hi !

The joyGetPos function is implemented in the Winmm.lib library. You must go
to the project settings, Linker options and specify winmm.lib as an
additional input library. After that, your program compiles just fine.

To avoid similar problems in the future, when you use the MSDN to find out
about functions, always remember to read the "Requirements" section
carefully. It will list all headers, OS versions and libraries you must use
in order to get support to a certain routine.

-Antti Keskinen


sg10241024 said:
Hello,

I'm programming MS Visual Studio. Net 2003 Professional. I'm a
beginner and now I have a problem while building my new program.

I've got linker error LNK2001: unresolved external symbol "insigned
int:stdcall joyGetPos(unsigend int, struct
joxinfo_tag*)"(?joyGetPos@@$ Joystick
and the linker fatal error LNK1120: 1 unresolved externals.

I've looked for information in the MSDN Library (Oktober 2004). But it
failed.

Maybe I have an error in my program:

#include<windows.h>
#include<stdio.h>

int main()
{
JOYINFO cpi, *pji;
pji=&cpi;
(*pji).wXpos=40;
joyGetPos(0,pji);
return 0;
}

My purpose is to address a joystick.

Thanks for heldping!

Greeting Sarah
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top