Login
Username:

Password:

Remember me



Lost Password?

Register now!
Main Menu
H3D.org Feeds


Browsing this Thread:   1 Anonymous Users




(1) 2 »


Compiling VHTK with Visual C++
#1
Not too shy to talk
Not too shy to talk


See User information
Hi,

I have installed H3D 1.5 without any problems, and the demos work fine.

After that, I have unzipped VHTK 1.4 and applied "update.py" found in VHTK\build\win32\vc7. I have opened VHTK.vcpr in Visual C++ 2005 Express, and converted it as requested.

When I tried to build it, .obj compiled well but I got 84 link errors (unresolved external symbol), first one:

HapticModes.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall H3D::MField,class std::allocator > >::erase(class std::_Vector_iterator,class std::allocator >,class std::allocator,class std::allocator > > >,class std::_Vector_iterator,class std::allocator >,class std::allocator,class std::allocator > > >,int)" (?erase@?$MField@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@H3D@@UAEXV?$_Vector_iterator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@0H@Z)

Same problem in Debug or Release configuration (with "only" 65 errors in the last case), with the original library H3DAPI.lib located either in vc7\Debug or vc7\Release directory respectively.

I am sure that the H3DApi.lib path is correct in the linker configuration (I got a message H3DAPI.lib not found if I change it in the project properties).

Same problem with Visual Studio 2005. Same problem with the original project (before "update.py").

Any help would be appreciated !

Thanks.

Gilles

Posted on: 2007/1/31 6:48
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong Top


Re: Compiling VHTK with Visual C++
#2
Webmaster
Webmaster


See User information
If you use visual 2005 (express) I think you have to recompile h3dapi with the same compiler, then set up all the linker paths correctly ( in vhtk) and then compile vhtk. However, if you compile VHTK against H3DAPI 1.5 using visual c++ express you will get a run-time error due to some bug. The latest subversion of H3DAPI 1.5 should have a fix for this bug.

So in order to get VHTK and H3DAPI working together when using visual c++ 2005 you need to compile everything using this. Remember to set the PATH environment variable to point to the correct version of H3DAPI.dll.

I think this is causing the linker problem. Maybe someone else see some other problem.

Posted on: 2007/1/31 7:49
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong Top


Re: Compiling VHTK with Visual C++
#3
Not too shy to talk
Not too shy to talk


See User information
Hi,

Thank you for this quick answer.

As you can imagine, after this failure my second idea was of course to recompile H3DAPI and so I did, and then I succeeded in compiling VHTK. But as you write, I got runtime errors with the examples.

After your answer, following your advice I downloaded the latest subversion of H3DAPI, recompiled it, recompiled VHTK, and... now it works. Unfortunately, I am not at my lab and for the moment I can just try the visual aspect and not the haptic one.

The only thing I had to change in the H3DAPI code came from this error:
SpaceWareSensor.cpp(158) : error C2440: 'initialisation' : impossible de convertir de 'long' en 'SpwRetVal'
so I added this cast:
SpwRetVal err = static_cast( SiInitialize() );
and no more problem at compile time - but please let me know if it could be a source of trouble at runtime.

Thanks again for your efficient help.

Gilles


Posted on: 2007/1/31 14:27
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong Top


Re: Compiling VHTK with Visual C++
#4
Webmaster
Webmaster


See User information
Oh right, forgot about that one :) I fixed it the same way and I have only run the demos for VHTK, never made an application of my own so I do not know if it could be a source of trouble during runtime. But I do not see any reason why it should.

Posted on: 2007/2/1 4:09
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong Top


Re: Compiling VHTK with Visual C++
#5
Not too shy to talk
Not too shy to talk


See User information
Ok, thank you.

By the way, all VHTK demos work fine with my Phantom Omni device.

Best regards,

Gilles

Posted on: 2007/2/1 4:23
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong Top


Re: Compiling VHTK with Visual C++
#6
Quite a regular
Quite a regular


See User information
For I worked to compile VHTK, following some tips here from forum:

"Converting from vc7 to vc8 does not always go smooth. Most of the time it does for me but there is one setting that is set to one default value in vc7 which is different in vc8.
Check that the choice "Treat wchar_t as Built-in Type" is set to No for vc8, default for vc8 is yes, default for vc7 is no. This choice can be found in the project properties page under "Configuration Properties -> C/C++ -> Language"."

"Open the Project properties: (right-click on your project in the solution explorer)
Select Configuration Properties->Linker->Input

Additional Dependencies field: msvcrtd.lib (Add this)
Ignore Specific Library: msvcrt.lib (Add this)"

and

Linker>General>Additional Library Directories
"$(H3D_ROOT)\build\win32\vc8\Debug";"$(H3D_EXTERNAL_ROOT)\lib"

!!!!!!!!!!!! But I still have a lot of warnings like:

warning C4018: '<' : signed/unsigned mismatch
warning C4244: 'argument' : conversion from 'int' to 'H3D::H3DFloat', possible loss of data
warning C4244: 'argument' : conversion from 'double' to 'H3D::H3DFloat', possible loss of data

Posted on: 2007/7/20 16:39
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong Top


Re: Compiling VHTK with Visual C++
#7
Webmaster
Webmaster


See User information
Those are just warnings. The can be easily fixed (to not give warnings) and they will most probably not prevent your build to succeed or run.

Posted on: 2007/7/20 17:21
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong Top


Re: Compiling VHTK with Visual C++
#8
Guru
Guru


See User information
It seems like VC is producing a lot more warnings than GCC, and I'm primarily concerned about errors that might occure. If you could point out the offending lines, however, I'll see what I can do about them for the next version. There should be no problem running the toolkit despite the warnings, however.

Posted on: 2007/7/21 12:11
KJ Lundin Palmerius
C Research
Linköping University, Sweden
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong Top


Re: Compiling VHTK with Visual C++
#9
Quite a regular
Quite a regular


See User information
i had try to rebuild the h3dapi as u mentioned.
but there is an error msg.The msg said that missing windows.h file. i try to search the h3d folder but i can't find any file called windows.h.

Thanks.

Posted on: 2007/8/13 19:07
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong Top


Re: Compiling VHTK with Visual C++
#10
Guru
Guru


See User information
The file windows.h should be distributed with your development environment. As I mentioned in another thread, you might want to upgrade from VC++ version 6 to at least 7.

Posted on: 2007/8/14 9:38
KJ Lundin Palmerius
C Research
Linköping University, Sweden
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong Top




(1) 2 »



You can view topic.
You cannot start a new topic.
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create pdf.
You cannot get print page.

[Advanced Search]





(C) 2012 SenseGraphics AB    ---    Powered by XOOPS