Login
Username:

Password:

Remember me



Lost Password?

Register now!
Main Menu
H3D.org Feeds


Browsing this Thread:   1 Anonymous Users






Recompiling H3D API in Windows 10 "timespec" error
#1
Just popping in
Just popping in


See User information
Hello,

I wrote a new node and I'm attempting to recompile H3DAPI and HAPI to include in my next environment. I created a source file and header file for each program (HAPI, H3DAPI). As far as I understand, I followed instructions in the manual/wiki.

The problem comes when I try to recompile. I'm using Windows 10, CMake 3.10.2, and Visual Studio 2017. CMake gave DIR-NOTFOUND for all wxWidgets... but still produced a solution file. When I tried building in Studio, both ALL_BUILD and H3DAPI did not complete successfully. The first error, which seems to be referenced in most of the other errors was:

Quote:
Error C2011 'timespec': 'struct' type redefinition (compiling source file C:\H3D\H3DUtil\src\Threads.cpp) H3DUtil C:\H3D\External\include\pthread\pthread.h 307


The error somehow does not point to the other place timespec was defined, I am unsure how to proceed from here.

Help is much appreciated.

Thank you,
-Yaz

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


Re: Recompiling H3D API in Windows 10 "timespec" error
#2
Webmaster
Webmaster


See User information
Hello,

The latest release will not compile with visual studio 2015 and 2017 unless you:
- Make some changes in the code to compile (fixing timespec issue for example) it is fixed in the latest trunk.
- Compile the external libraries with the desired compiler, or get the ones from subversion repository https://h3dapi.org:8090/External/vs2017

If you are going to use visual studio 2017 and you are comfortable with svn checkouts I would recommend to just checkout latest trunk for H3DWithToolkitsWin (see information in wiki) and replace the checked out External directory with the visual studio 2017 one above.
We have started the process of making a new release but due to time limitations it will not be done any time soon.

You could also get the latest source code from here ftp://www.h3dapi.org/pub/nightlybuilds/source/
but like I said, you still need the Visual studio 2017 externals.

Posted on: 1/25 8:08
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong Top


Re: Recompiling H3D API in Windows 10 "timespec" error
#3
Just popping in
Just popping in


See User information
Thank you Markus for the quick response and easy-to-follow instructions. Here's what I did so far:

1- Reinstalled H3D 2.3.0 (to start clean)
2- Added my cpp and header files in the appropriate folders, then copied and replaced files with the new trunk H3D release you pointed me to. Finally, I deleted the old "External" directory and copied the new files from your link.
3- Re-ran CMake with Quote:
C:\H3D\
failed, so I used Quote:
C:\H3D\build\
, that succeeded and produced a solution file (after changing configure settings to Studio 2017 x64)
4- Opened the solution file in Visual Studio 2017, changed from debug to release and built "ALL_BUILD", that succeeded without errors (Thank you!)
5- Copied the few dll files it was looking for into the h3dload release folder and the h3dviewer release folder
6- created an x3d file with a sphere and my new node and ran it inside h3dviewer

Now, if I look at the console inside h3dviewer (under Advanced), it says it cannot find my node:
Quote:
Warning: Could not create "X" node. It does not exist in the H3DNodeDatabase (C:\H3D\H3DAPI\examples\All\Y.x3d line 14)


(X and Y are stand-ins for the actual names)

How do I add the node that was compiled in the H3DNodeDatabase? I have the requisite
H3DNodeDatabase X::database

in my cpp file, and when you recompile, cmake just adds all the files in the source and include folders, right? Basically, the way I understand it, CMakeLists.txt adds folders, not individual files.

Thanks again,
-Yaz

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


Re: Recompiling H3D API in Windows 10 "timespec" error
#4
Webmaster
Webmaster


See User information
Hello,

Good that my instructions helped you to get it to compile at least.

Quote:
cmake just adds all the files in the source and include folders, right?


No this is not entirely true, it depends on the authors of the CMakeLists.txt. It is actually not recommended (if I remember correclty) to use the commands that add all files in directories to the project. It is much better to list the files. So you have a couple of choices.

1. Add the files manually to the generated project.
2. Modify H3DAPI\build\H3DAPISourceFiles.txt so that your files are added in the list (should be a fairly self explanatory file)
3. Create a completely different project in the style of MedX3D or UI that you can then import into your x3d files using the ImportLibrary nodes url field (see example x3d files in UI or MedX3D).

Posted on: 1/29 9:36
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong Top


Re: Recompiling H3D API in Windows 10 "timespec" error
#5
Just popping in
Just popping in


See User information
Hello Markus,

Thank you! Adding the files to the existing solution in visual studio worked. Now the project is seeing (most) files and compiling at least. There are few issues with my code but those are not related to the compilation.

I have a small issue that popped up with two of the header files I wrote. The files are part of the H3DAPI project. The cpp files are seen and are compiling, but the first line is returning an error saying it cannot find the associated header files. the line in the cpp file is written as:

#include <X.h>


I also tried:
#include <H3D/X.h>

#include <H3DAPI/X.h>

and, trying to follow the folder structure, I tired:
#include <H3DAPI/H3D/X.h>


for some reason it still cannot find the header files. Am I missing something here? Should I just move the two offending header files (both of which I wrote) to the same folder as the cpp files under H3DAPI?

Best,
-Yaz

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


Re: Recompiling H3D API in Windows 10 "timespec" error
#6
Webmaster
Webmaster


See User information
Hello,

if you have put the header files in the same location as the other H3D header files (H3DAPI/H3D/include) then you should use the H3D/X.h variant.

Just make sure that there is not any kind of case sensitivity going on. i.e are they named X.h or x.h? or perhaps Xy.h instead of XY.h.

If you have them in a completely different location than the other H3D headers just make sure that this include directory is added to the project settings.

If you can not figure it out put them with the source file and use "" instead of <>. Although it should just be a matter of writing the correct path.

As a final warning, not related to this issue, adding files to the existing solution will work fine as long as you never touch any of the CMakeLists.txt files or regenerate the solution using CMake because if you do that you have to readd them manually.. When you are set on what the files should be called then I would recommend that you add them in cmake so they are always in the solution file.

Posted on: 2/5 9:59
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong Top


Re: Recompiling H3D API in Windows 10 "timespec" error
#7
Just popping in
Just popping in


See User information
Thank you Markus, the instructions worked perfectly.

I deleted the new files from the project, changed the include statement to H3D/X.h and added them to the project again. Now the compiler sees all the files.

HAPI compiled successfully, had a few errors at first that I fixed without much trouble. H3DAPI is not compiling at all though.

I don't know if this forum/thread is the appropriate place to ask about this, since it is related to the node I'm adding to H3D. The first error (sorted by line, the way I usually debug) states that one of my node elements is not a member of H3D::[Node name]. I thought the code in the header file will define that node and its members, but it seems I'm missing something.

Posted on: 2/21 6:25
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong Top


Re: Recompiling H3D API in Windows 10 "timespec" error
#8
Webmaster
Webmaster


See User information
Really hard for me to help you with this without any kind of code.

If you do not want to share the code at this point could you at least just create a simple class that exhibits the behaviour?

Create some new files, name them something like TestClass or similar and add only one member and see if you can get the issue you are having.

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







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