WorldViz User Forum  

Go Back   WorldViz User Forum > Precision Position Tracker (PPT)

 
 
Thread Tools Rating: Thread Rating: 3 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #7  
Old 02-24-2006, 01:38 PM
MiamiTodd MiamiTodd is offline
Member
 
Join Date: Feb 2006
Posts: 15
Perhaps I spoke a bit too soon. When I try to create a project and compile it after compiling the VRPN source code I get all sorts of errors regarding the extern "C" lines and other extern lines in the VRPN source if I compile it as a C module.

I did manage to get to a certain point using C++ project though. But when I try to compile the code I get the following error:
...\extender\Tracker.cpp(8): error C2664: 'int vrpn_Tracker_Remote::register_change_handler(void *,vrpn_TRACKERCHANGEHANDLER,vrpn_int32)' : cannot convert parameter 2 from 'void (void *,vrpn_TRACKERCB)' to 'vrpn_TRACKERCHANGEHANDLER'

I'm trying to get a dll compiled from the below code:

(Tracker.h)
Code:
#include <vrpn_Tracker.h>

class Tracker{
public:
	Tracker(char* address);
	int* getPosition();
	void handlePos(void *userdata, vrpn_TRACKERCHANGEHANDLER t);
	
	vrpn_Tracker_Remote* tracker;
	vrpn_float64* lastPosition;
};
(Tracker.cpp)
Code:
#include <string.h>
#include <vrpn_Tracker.h>
#include "Tracker.h"

Tracker::Tracker(char* address){
	tracker = new vrpn_Tracker_Remote(address);
	//Setup callback for when new position data comes in
	tracker->register_change_handler(NULL, handlePos);
	lastPosition = new vrpn_float64[3];
}

Tracker::handlePos(void *userdata, vrpn_TRACKERCB t){
	lastPosition[0] = t.pos[0];
	lastPosition[1] = t.pos[1];
	lastPosition[2] = t.pos[2];
}

Tracker::getPosition(){
	return lastPosition;
}
I've tried chaning several things such as the vrpn_TRACKERCB to the vrpn_TRACKERCHANGEHANDLER but this doesn't seem to make any headway. I am unfortunately not familiar enough with C/C++ to recognize any simple errors I might be inducing here. Any help you can offer is greatly appreciated.
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 05:10 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC