build problems (int8_t redefinition) with msvc 2017?

251 views
Skip to first unread message

nige

unread,
Nov 7, 2017, 5:34:48 PM11/7/17
to coin3d-discuss
I have been trying to build Coin under Windows 10 using MS VisualStudio 2017:
1/ I downloaded the latest repository version from  https://bitbucket.org/Coin3D/coin/downloads
2/ Opened ..\build\msvc10\coin4.sln with msvc17 and allowed it to update the solution file.
3/ Fixed complaints about missing boost\detail\workaround.hpp by adding my boost header location to the include path

It then successfully compiled most of the first group of files under src/actions, but failed to compile SoGLRenderAction.cpp:
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include\stdint.h(17): error C2371: 'int8_t': redefinition; different basic types
1>C:\Apps\Coin3d\reposNov7\build\msvc10\include\Inventor/system/inttypes.h(138): note: see declaration of 'int8_t'

Does anybody have a simple fix or workaround for this problem?

Thanks in advance for any help I can get.

Bastiaan Veelo

unread,
Nov 8, 2017, 3:38:54 AM11/8/17
to coin3d-...@googlegroups.com

Coin builds without errors on Windows 10 using MSVC 2017 if you check out the CMake branch [1]. Follow the instructions in INSTALL [2].

[1] https://bitbucket.org/Coin3D/coin/branch/CMake

[2] https://bitbucket.org/Coin3D/coin/src/8e8337f61b05f6e59a6b5b2be944afbebf603f25/INSTALL?at=CMake&fileviewer=file-view-default
--
You received this message because you are subscribed to the Google Groups "coin3d-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coin3d-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mark Goldberg

unread,
Apr 19, 2019, 1:56:29 PM4/19/19
to coin3d-discuss
Thanks for pointing out the updated Wiki to use CMAKE
      https://bitbucket.org/Coin3D/coin/wiki/BuildWithCMake

I followed it,
   It failed to compile with VS 2012 Ultimate, stopping after 100 errors
        I was using 2012 due to linking problems with earlier coin source
 
   I had success with VS 2015 Community
       I finally have documentation -- yeah !
 

Feedback:

1) Doxygen is not optional, as the cmake -Bcoin_build (etc.) fails when doxygen is not installed

2) the cmake -Bcoin_build (etc.) complains "doxygen missing components: dot"
          a little research pointed me to https://graphviz.gitlab.io/download/ for GraphViz which includes dot
          apparently dot creates hierarchal or layered drawings of directed graphs
          my guess is it's used to show class hierarchy in the generated help

3) Hg should be available at the command line
          I had cloned coin using sourceTree,
               but SourceTree doesn't add Hg to the path for the command line
          When Hg isn't available via the command line then           
          cmake -Bcoin_build (etc.) command output ends with 
              CMake Warning at cpack.d/CMakeLists.txt:16 (message):  Mercurial not found, PACKAGE_BUILD_NUMBER set to 1
          I'm not sure if this is a problem, but adding Hg to the path solves this cmake warning  
 
4) Some explanation of the CMAKE -G seems to be in order
          use Cmake --Help  to get a list of generators
 
5) When downloading the boost binaries
            since I'm using Visual Studio, I found a reference to msvc numbering to be helpful
            https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B#Internal_version_numbering
         
6) the Coin4 repository was changed Feb/2019, to remove boost as a sub-repo
          which is (sort of) mentioned on the page
          however don't we also need to set  -DBOOST_ROOT=<folder>
               as part of the the cmake -Bcoin_build (etc.) command ?

7) consider using the newer cmake -S in the command lines
          and add a note about the older -H
          instead of the other way around

8) as a newbie with CMake, I'm not clear what the CMAKE_INSTALL_PREFIX accomplishes
         it is mentioned in the CMake Configuration Options section of the wiki page
         but the description doesn't really sink in for me.
         first off, what are the "install directories" ?

9) the --target ALL_BUILD
          possibly mention that the doxygen portion of the compile generates a LOT of warnings
          which then overflows the cmd buffer, so the warnings from compiling coin are lost
          consider suggesting a redirection of output

10) the cpack command requires NSIS to be installed 
          https://nsis.sourceforge.io/Download
          Please explain that this is creating an installer for the coin binaries and headers
              and is therefore an optional step

11)  remove the coin_build folder 
         Wouldn't that lead to a loss of the documentation ?
             unless I'm mistaken and it was copied somewhere else along the way.
             yes, it is included in the optionally built installer using cpack

12) It would be nice to point out where the documentation can be found

13) It would be nice to add the documentation to https://bitbucket.org/Coin3D/coin/downloads/
           I had success compiling coin3 and 4 using the Visual Studio using the solutions under coin\build\msvc*
           However I never had any success getting doxygen to generate until I used CMake

14) Is there some way to get a .CHM (to help with searches) ?
            vs. the index.hmtl approach

             

Thanks again for updated BuildWithCMake page


Mark Goldberg

unread,
Apr 19, 2019, 3:40:26 PM4/19/19
to coin3d-discuss
To answer a few of my own questions


8) as a newbie with CMake, I'm not clear what the CMAKE_INSTALL_PREFIX accomplishes
         it is mentioned in the CMake Configuration Options section of the wiki page
         but the description doesn't really sink in for me.
         first off, what are the "install directories" ?
 
 
11)  remove the coin_build folder 
         Wouldn't that lead to a loss of the documentation ?
             unless I'm mistaken and it was copied somewhere else along the way.
             yes, it is included in the optionally built installer using cpack
 

12) It would be nice to point out where the documentation can be found

For questions 8, 11 and 12
 
the cmake --build coin_build --target INSTALL  (etc)
    appears to copy content to folders under CMAKE_INSTALL_PREFIX\share
    documentation is found at CMAKE_INSTALL_PREFIX\share\doc\Coin\html



14) Is there some way to get a .CHM (to help with searches) ?
            vs. the index.hmtl approach

I found a switch, by looking at the coin_build\CmakeCache.txt 
COIN_BUILD_DOCUMENTATION_CHM=On

Which initially is compiled to coin_build\html\coin.chm
and is later copied to CMAKE_INSTALL_PREFIX\share\doc\Coin\Coin.chm
And it actually works - who knew :-) 
 


Volker Enderlein

unread,
Apr 19, 2019, 7:20:26 PM4/19/19
to coin3d-...@googlegroups.com, Mark Goldberg
Hi Mark,

thanks for your valuable feedback. It is very appreciated.

Unfortunately I was not able to reproduce your build issues with VS2012. Using the latest sources from Bitbucket I got no errors when building Coin.
I checked the build process for VS2005, VS2010 and VS2012 and everything built as expected (VS2015, VS2017 and VS2019 are checked with AppVeyor CI).
You may file a bug in the issue tracker https://bitbucket.org/Coin3D/coin/issues and attach the output of your build process there. Please provide the full build commands you are using for the failed build.

With regard to your feedback:

1) Fully agreed. I'll correct the docs for it to be required.

2) GraphViz's dot may be used in the documentation if available, but is not strongly required for the proper generation of the documentation. I'll add a comment about it.

3) hg on the command line is only used for packaging. If you do not intend to package your build artifacts you won't need it. That's why configuration process works despite of this warning.

4) Fully agreed. I'll add a comment about how to find available CMake generators.

5) Fully agreed. A comment will be added.

6) You are right, it need to be clearly stated, that -DBOOST_ROOT=<xxx> is definitly needed on Windows. Other platforms (Linux, MacOS) may not need it.

7) -H option was preferred over -S as the latter was introduced first in CMake 3.13 and -H option still works in current CMake.
It's just making this work for most of the users, as many of them might use CMake versions older than 3.13.
It is also mentioned in the comments to the step 2 of the build recipe.

8) Coin install into different directories (bin/lib/include/...). The Install Prefix is the directory where those subdirectories are placed inside in the installation step.

9) Redirection has to be added to the build tool options (MSBuild, make, ...). Need to figure out how to do it.

10) Fully agreed. Will add a comment about packaging to the build steps.

11) As you later found out, only if you do not install the build artifacts. Otherwise they are copied to the documentation directory under the installation folder.

12) Will add a comment on that.

13) The current state of the documentation should be always accessible under https://bitbucket.org/Coin3D/coin/wiki/Documentation
The solutions under build/msvc<xx> are not actively maintained anymore for Coin4 as CMake can regenerate them easily. Newly added sources may be missing from them.

14) The different help formats available are not cleary communicated but hidden in the CMake configuration options. It was implicitly assumed that the CMake user knows how to add them to the build command line. We may explicitly add a paragraph to the build steps about how to adapt configurations.

Again, thanks for your valuable feedback.

Cheers, Volker

Mark Goldberg

unread,
Apr 23, 2019, 9:33:54 AM4/23/19
to coin3d-discuss

Hi Volker,

Thanks for the quick response.  It is very appreciated.

Unfortunately I was not able to reproduce your build issues with VS2012. Using the latest sources from Bitbucket I got no errors when building Coin.
I checked the build process for VS2005, VS2010 and VS2012 and everything built as expected (VS2015, VS2017 and VS2019 are checked with AppVeyor CI).
You may file a bug in the issue tracker https://bitbucket.org/Coin3D/coin/issues and attach the output of your build process there. Please provide the full build commands you are using for the failed build.

While preparing to submit the VS2012 failing to compile issue, 
I dug into the errors, and I found a hacked file
I've confirmed that it was altered by someone else
my clue that it was hacked was a reference to COIN in a standard file

C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\stdint.h
had the following

#if !defined(COIN_INTERNAL)
typedef signed char        int8_t;
#endif

replacing stdint.h with a pristine copy, FIXED the problem.
 
I'm sorry for wasting your time on this issue.


v.r.en...@googlemail.com

unread,
Apr 23, 2019, 4:47:21 PM4/23/19
to coin3d-discuss
Hi Mark,

thanks for your response and for confirming the build process works for you now. I already had planned to check whether the current sources still can be build using VS2005 so it was not wasted time. Older versions of Coin were not properly compilable by newer compilers so I do not wonder about the hack.

Cheers, Volker
Reply all
Reply to author
Forward
0 new messages