Problems running spatial simple C++ example

C, C++, and Visual C++
Wolff
Phidgetsian
Posts: 5
Joined: Fri Feb 10, 2012 2:54 pm
Contact:

Problems running spatial simple C++ example

Postby Wolff » Mon Feb 13, 2012 3:10 pm

Hi there,

I am experiencing some trouble running your spatial-simple project. I installed the Phidgets Framework under C:\ProgramFiles\Phidgets.

I followed the instructions in your "Getting started guide for VS C/C++". I set up a new project with all acquired settings that are mentioned in the getting started guide. I created a new source file and basically copied your code to declare a handle and create an object. I also included the phidget21.h header file.

When I am running the program I get this error:
Error LNK1120.png
(121.54 KiB) Not downloaded yet


Can someone help me with this problem? Is it because I am using VS 2008 on a 64bit machine?

User avatar
burley
Human-Cyborg Relations
Posts: 441
Joined: Tue Sep 27, 2011 2:37 pm
Location: Calgary
Contact:

Re: Problems running spatial simple C++ example

Postby burley » Tue Feb 14, 2012 8:26 am

Does our example file compile correctly? That would let you know if it is an issue with your VS set up.

Also, I should mention, the accelerometer examples will not work for the spatial device. You need to use the spatial examples. They should be in the same examples folder.
Brian Burley
403-282-7335 ext. 6003
support@phidgets.com

Wolff
Phidgetsian
Posts: 5
Joined: Fri Feb 10, 2012 2:54 pm
Contact:

Re: Problems running spatial simple C++ example

Postby Wolff » Tue Feb 14, 2012 10:43 am

I just ran the spatial-example.
It's unable to link. This is the error that I get:
fatal error LNK1181.PNG
fatal error LNK1181
(185.21 KiB) Not downloaded yet

I usually either get this error, or the error that I explained before.

Thanks,

Thomas

fraser
Engineering
Posts: 271
Joined: Thu Nov 19, 2009 4:41 pm
Contact:

Re: Problems running spatial simple C++ example

Postby fraser » Wed Feb 15, 2012 10:28 am

there is a problem with the x64 library file, see this topic for the temporary solution

http://www.phidgets.com/phorum/viewtopic.php?f=37&t=5314

Wolff
Phidgetsian
Posts: 5
Joined: Fri Feb 10, 2012 2:54 pm
Contact:

Re: Problems running spatial simple C++ example

Postby Wolff » Wed Feb 15, 2012 3:06 pm

Thanks. I solved the problem by referencing to the library in the folder of the examples itself by setting:

Properties - Configuration Porperties - C/C++ - Additional Include Directories:
----> ..\..\

Properties - Configuration Porperties - Linker - Input - Additional Dependencies
----> ..\..\phidget21.lib

As I installed the driver and program on a 64bit machine, Visual Studio, which is by default running on 32bit, can't use these files. Referring to the library that is in the examples solves the problem.

Thanks for getting back to me anyway.

User avatar
burley
Human-Cyborg Relations
Posts: 441
Joined: Tue Sep 27, 2011 2:37 pm
Location: Calgary
Contact:

Re: Problems running spatial simple C++ example

Postby burley » Thu Feb 16, 2012 11:27 am

viewtopic.php?f=37&t=5314&p=19438#p19438

This post contains instructions on how to fix this issue properly.
Brian Burley
403-282-7335 ext. 6003
support@phidgets.com

Wolff
Phidgetsian
Posts: 5
Joined: Fri Feb 10, 2012 2:54 pm
Contact:

Re: Problems running spatial simple C++ example

Postby Wolff » Thu Feb 16, 2012 11:36 am

Thank you so much.


Return to “C/C++”

Who is online

Users browsing this forum: No registered users and 1 guest