Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 556491
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:55:31+00:00 2026-05-13T11:55:31+00:00

Can anybody please help me to configure Visual Studio 2005 (if that’s the solution

  • 0

Can anybody please help me to configure Visual Studio 2005 (if that’s the solution to the problem). I’m using some external libs and I’m getting this error:

1>Compiling...
1>main.cpp
1>c:\documents and settings\mz07\desktop\project\vs8test1\vs8test1\main.cpp(99) : warning C4996: 'getch' was declared deprecated
1>        c:\program files\microsoft visual studio 8\vc\include\conio.h(145) : see declaration of 'getch'
1>        Message: 'The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _getch. See online help for details.'
1>c:\documents and settings\mz07\desktop\project\vs8test1\vs8test1\main.cpp(110) : warning C4996: 'getch' was declared deprecated
1>        c:\program files\microsoft visual studio 8\vc\include\conio.h(145) : see declaration of 'getch'
1>        Message: 'The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _getch. See online help for details.'
1>c:\documents and settings\mz07\desktop\project\vs8test1\vs8test1\main.cpp(128) : warning C4996: 'getch' was declared deprecated
1>        c:\program files\microsoft visual studio 8\vc\include\conio.h(145) : see declaration of 'getch'
1>        Message: 'The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _getch. See online help for details.'
1>Compiling manifest to resources...
1>Linking...
1>hdu.lib(hduError.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<(class std::basic_ostream<char,struct std::char_traits<char> > &,char const *)" (__imp_??6std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z) referenced in function "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl operator<<(class std::basic_ostream<char,struct std::char_traits<char> > &,struct HDErrorInfo const &)" (??6@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@AAV01@ABUHDErrorInfo@@@Z)
1>C:\Documents and Settings\mz07\Desktop\project\vs8Test1\Debug\vs8Test1.exe : fatal error LNK1120: 1 unresolved externals

I’ve been googling it for hours. PLEASE, stackoverflow is my last hope!

Sorry I forgot to include the code:

#include "atl/stdafx.h"
#include <cstdio>
#include <cassert>

#if defined(WIN32)
# include <conio.h>
#else
# include "conio.h"
#endif

#include <HD/hd.h>
#include <HDU/hduVector.h>
#include <HDU/hduError.h>

#pragma comment(lib, "hdu.lib")
#pragma comment(lib, "hlu.lib")
#pragma comment(lib, "hd.lib")
#pragma comment(lib, "hl.lib")

/*******************************************************************************
Haptic sphere callback.  
The sphere is oriented at 0,0,0 with radius 40, and provides a repelling force 
if the device attempts to penetrate through it. 
*******************************************************************************/

HDCallbackCode HDCALLBACK FrictionlessSphereCallback(void *data)
{
  const double sphereRadius = 40.0;
  const hduVector3Dd spherePosition(0,0,0);

// Stiffness, i.e. k value, of the sphere.  Higher stiffness results
// in a harder surface.
const double sphereStiffness = .25;

hdBeginFrame(hdGetCurrentDevice());

// Get the position of the device.
hduVector3Dd position;
hdGetDoublev(HD_CURRENT_POSITION, position);

// Find the distance between the device and the center of the
// sphere.
double distance = (position-spherePosition).magnitude();

// If the user is within the sphere -- i.e. if the distance from the user to 
// the center of the sphere is less than the sphere radius -- then the user 
// is penetrating the sphere and a force should be commanded to repel him 
// towards the surface.
if (distance < sphereRadius)
{
    // Calculate the penetration distance.
    double penetrationDistance = sphereRadius-distance;

    // Create a unit vector in the direction of the force, this will always 
    // be outward from the center of the sphere through the user's 
    // position.
    hduVector3Dd forceDirection = (position-spherePosition)/distance;

    // Use F=kx to create a force vector that is away from the center of 
    // the sphere and proportional to the penetration distance, and scsaled 
    // by the object stiffness.  
    // Hooke's law explicitly:
    double k = sphereStiffness;
    hduVector3Dd x = penetrationDistance*forceDirection;
    hduVector3Dd f = k*x;
    hdSetDoublev(HD_CURRENT_FORCE, f);
}

hdEndFrame(hdGetCurrentDevice());

HDErrorInfo error;
if (HD_DEVICE_ERROR(error = hdGetError()))
{
    hduPrintError(stderr, &error, "Error during main scheduler callback\n");

    if (hduIsSchedulerError(&error))
    {
        return HD_CALLBACK_DONE;
    }        
}

return HD_CALLBACK_CONTINUE;
}


/******************************************************************************
main function
Initializes the device, creates a callback to handle sphere forces, terminates
upon key press.
******************************************************************************/

int main(int argc, char* argv[])
{
HDErrorInfo error;
// Initialize the default haptic device.
HHD hHD = hdInitDevice(HD_DEFAULT_DEVICE);
if (HD_DEVICE_ERROR(error = hdGetError()))
{
    hduPrintError(stderr, &error, "Failed to initialize haptic device");
    fprintf(stderr, "\nPress any key to quit.\n");
    getch();
    return -1;
}

// Start the servo scheduler and enable forces.
hdEnable(HD_FORCE_OUTPUT);
hdStartScheduler();
if (HD_DEVICE_ERROR(error = hdGetError()))
{
    hduPrintError(stderr, &error, "Failed to start scheduler");
    fprintf(stderr, "\nPress any key to quit.\n");
    getch();
    return -1;
}

// Application loop - schedule our call to the main callback.
HDSchedulerHandle hSphereCallback = hdScheduleAsynchronous(
    FrictionlessSphereCallback, 0, HD_DEFAULT_SCHEDULER_PRIORITY);

printf("Sphere example.\n");
printf("Move the device around to feel a frictionless sphere\n\n");
printf("Press any key to quit.\n\n");

while (!_kbhit())
{
    if (!hdWaitForCompletion(hSphereCallback, HD_WAIT_CHECK_STATUS))
    {
        fprintf(stderr, "\nThe main scheduler callback has exited\n");
        fprintf(stderr, "\nPress any key to quit.\n");
        getch();
        break;
    }
}

// For cleanup, unschedule our callbacks and stop the servo loop.
hdStopScheduler();
hdUnschedule(hSphereCallback);
hdDisableDevice(hHD);

return 0;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T11:55:31+00:00Added an answer on May 13, 2026 at 11:55 am

    I think the library you’re importing (hdu.lib) is built with a different runtime library – either you’re mixing debug and release libraries here or static vs DLL runtimes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 266k
  • Answers 266k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Most answers we find on the web are FUD and… May 13, 2026 at 12:43 pm
  • Editorial Team
    Editorial Team added an answer You don't have to refer to id as long as… May 13, 2026 at 12:43 pm
  • Editorial Team
    Editorial Team added an answer Pushing and popping a view with UINavigationController or UITabController will… May 13, 2026 at 12:43 pm

Related Questions

I am working on a project that requires me to generate a java .class
I have some c# code that uses the Microsoft Scripting Control to evaluate some
I've never used the ListView control before and am trying to programmatically insert items
I'm currently writing an iPhone application which gets some data from the user and
I am working on Iphone application and new to dev. I am sorry if

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.