Developing with Windows 10, Visual Studio 15

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Sergio Verduzco-Flores
Posts: 9
Joined: Wed May 23, 2012 3:55 pm

Developing with Windows 10, Visual Studio 15

Post by Sergio Verduzco-Flores » Thu Feb 25, 2016 2:35 am

Hello. I am attempting to program with the OpenSim C++ API, but there are some problems.

In order to begin compiling, I followed the instructions here:
http://simtk-confluence.stanford.edu:80 ... ep+Example

Using Windows 10, CMake 3.4.3 and Visual Studio 15 I had to make some adjustments in order to compile the TugOfWar1_CreateModel.cpp model. Namely:
* I generated the solution file with Visual Studio 14 2015 as my generator.
* I removed the definitions for the 'signbit' and 'timespec' objects.
* Downloaded a SimTKlapack.lib which seemed to be missing in my OpenSim library.

This allowed me to successfully compile. However, when following the next tutorial, e.g.
http://simtk-confluence.stanford.edu:80 ... n+Part+One
I ran into some trouble. Basically, after I add the block and the joint elements I can still compile the program, but running the executable causes errors:
Unhandled exception at 0x00007FF95CF9E71C (ntdll.dll) in exampleMain.exe: 0xC0000374: A heap has been corrupted (parameters: 0x00007FF95CFF22B0).
I haven't been able to figure what's the problem, and any insights would be appreciated.

User avatar
Ayman Habib
Posts: 2233
Joined: Fri Apr 01, 2005 12:24 pm

Re: Developing with Windows 10, Visual Studio 15

Post by Ayman Habib » Tue Mar 01, 2016 11:29 am

Sergio,

The "signbit" issue you mentioned was specific to version 3.2 and is fixed in version 3.3 which was released/built using VisualStudio 2015. What version of the source are you using and where did you download it from?

Thanks,
-Ayman

User avatar
Sergio Verduzco-Flores
Posts: 9
Joined: Wed May 23, 2012 3:55 pm

Re: Developing with Windows 10, Visual Studio 15

Post by Sergio Verduzco-Flores » Wed Mar 02, 2016 11:56 pm

Thanks for the reply. I did not mention that I was building OpenSim 3.1 (downloaded from this site), so I could work with a particular project (https://simtk.org/home/upexdyn).

After some time I realized that I should be building Simbody from source. After some more time I decided that building 3.1 from source with Windows 10 and Visual Studio 15 would be tricky, so I decided to try something else. I attempted to compile Simbody and OpenSim from source using two configurations:

The first configuration used Windows 8.1, CMake 3.4.3, and VS Express 2010 to compile SimBody 3.1 and OpenSim 3.1 .
The second configuration used Windows 10, CMake 3.4.3, and VS 14 2015 to compile Simbody 3.5.3 and OpenSim 3.3 .

I was able to successfully compile and test the programs for both cases without any gimmicks like the 'signbit' thing.

Next I tried once more the API tutorial: http://simtk-confluence.stanford.edu:80 ... n+Part+One .

I got an error when compiling the example that only creates the OpenSim model. It was the same error for both of my builds:
LINK : fatal error LNK1104: cannot open file 'OpenSim_SimTKcommon.lib'
I noticed that I have the file ../sdk/lib/SimTKcommon.lib, but not OpenSim_SimTKcommon.lib . I seem to recall that I did everything using the "RelWidthDebInfo" and "x64" settings in Visual Studio. Does anyone see what might be causing this error?

User avatar
Christopher Dembia
Posts: 506
Joined: Fri Oct 12, 2012 4:09 pm

Re: Developing with Windows 10, Visual Studio 15

Post by Christopher Dembia » Thu Mar 03, 2016 10:41 am

When we build OpenSim and Simbody for distribution, we set a Simbody CMake variable called `BUILD_USING_NAMESPACE` to `OpenSim_` to avoid conflicts with other Simbody libraries you may have.

Simply rename `SimTKcommon.lib` etc to `OpenSim_SimTKcommon.lib`, or rebuild Simbody with `BUILD_USING_NAMESPACE` set to `OpenSim_`.

EDIT: The namespace should be `OpenSim`, not `OpenSim_`.

User avatar
Sergio Verduzco-Flores
Posts: 9
Joined: Wed May 23, 2012 3:55 pm

Re: Developing with Windows 10, Visual Studio 15

Post by Sergio Verduzco-Flores » Thu Mar 03, 2016 10:50 pm

Thanks!
Prepending 'OpenSim_" to the SimTK* files solved the problem.

POST REPLY