Run Fail: ExampleMain

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Bojun Huang
Posts: 5
Joined: Tue Dec 04, 2018 7:25 pm

Run Fail: ExampleMain

Post by Bojun Huang » Tue Sep 07, 2021 1:02 am

Hello,
I try to build and run a C++ Example(ExampleMain), following the guide https://simtk-confluence.stanford.edu/p ... d=29165309.
When I went to Compiling and running the example, it showed "string too long", like fig.1.
fig.1.png
fig.1.png (17.26 KiB) Viewed 666 times

How can I fix the problem?
Thanks.

Environment: Visual studio 2019 x64, OpenSim4.1, CMake 3.21.2

Build Message:

Code: Select all

Rebuild started...
1>------ Rebuild All started: Project: ZERO_CHECK, Configuration: Debug x64 ------
1>Checking Build System
2>------ Rebuild All started: Project: exampleMain, Configuration: Debug x64 ------
2>Building Custom Rule C:/Users/siat/Documents/OpenSim/4.1/Code/CPP/ExampleMain/CMakeLists.txt
2>TugOfWar1_CreateModel.cpp
2>exampleMain.vcxproj -> C:\Users\siat\Documents\OpenSim\4.1\Code\CPP\ExampleMain\build\Debug\exampleMain.exe
3>------ Skipped Rebuild All: Project: ALL_BUILD, Configuration: Debug x64 ------
3>Project not selected to build for this solution configuration 
========== Rebuild All: 2 succeeded, 0 failed, 1 skipped ==========
Output Message:

Code: Select all

'exampleMain.exe' (Win32): Loaded 'C:\Users\siat\Documents\OpenSim\4.1\Code\CPP\ExampleMain\build\Debug\exampleMain.exe'. Symbols loaded.
'exampleMain.exe' (Win32): Loaded 'C:\Windows\System32\ntdll.dll'. 
'exampleMain.exe' (Win32): Loaded 'C:\Windows\System32\kernel32.dll'. 
'exampleMain.exe' (Win32): Loaded 'C:\Windows\System32\KernelBase.dll'. 
'exampleMain.exe' (Win32): Loaded 'D:\OpenSim 4.1\bin\osimTools.dll'. Module was built without symbols.
'exampleMain.exe' (Win32): Loaded 'C:\Windows\System32\ucrtbase.dll'. 
'exampleMain.exe' (Win32): Loaded 'D:\OpenSim 4.1\bin\osimAnalyses.dll'. Module was built without symbols.
'exampleMain.exe' (Win32): Loaded 'D:\OpenSim 4.1\bin\osimActuators.dll'. Module was built without symbols.
'exampleMain.exe' (Win32): Loaded 'D:\OpenSim 4.1\bin\osimSimulation.dll'. Module was built without symbols.
'exampleMain.exe' (Win32): Loaded 'D:\OpenSim 4.1\bin\osimCommon.dll'. Module was built without symbols.
'exampleMain.exe' (Win32): Loaded 'C:\Windows\System32\msvcp140d.dll'. 
'exampleMain.exe' (Win32): Loaded 'C:\Windows\System32\vcruntime140d.dll'. 
'exampleMain.exe' (Win32): Loaded 'C:\Windows\System32\vcruntime140_1d.dll'. 
'exampleMain.exe' (Win32): Loaded 'C:\Windows\System32\ucrtbased.dll'. 
'exampleMain.exe' (Win32): Loaded 'D:\OpenSim 4.1\bin\SimTKmath.dll'. Module was built without symbols.
'exampleMain.exe' (Win32): Loaded 'D:\OpenSim 4.1\bin\SimTKcommon.dll'. Module was built without symbols.
'exampleMain.exe' (Win32): Loaded 'D:\OpenSim 4.1\bin\liblapack.dll'. 
'exampleMain.exe' (Win32): Loaded 'C:\Windows\System32\msvcrt.dll'. 
'exampleMain.exe' (Win32): Loaded 'C:\Windows\System32\msvcp140.dll'. 
'exampleMain.exe' (Win32): Loaded 'C:\Windows\System32\vcruntime140.dll'. 
'exampleMain.exe' (Win32): Loaded 'D:\OpenSim 4.1\bin\SimTKsimbody.dll'. Module was built without symbols.
'exampleMain.exe' (Win32): Loaded 'D:\OpenSim 4.1\bin\osimLepton.dll'. Module was built without symbols.
'exampleMain.exe' (Win32): Loaded 'D:\OpenSim 4.1\bin\BTKCommon.dll'. Module was built without symbols.
'exampleMain.exe' (Win32): Loaded 'D:\OpenSim 4.1\bin\BTKBasicFilters.dll'. Module was built without symbols.
'exampleMain.exe' (Win32): Loaded 'D:\OpenSim 4.1\bin\BTKIO.dll'. Module was built without symbols.
'exampleMain.exe' (Win32): Loaded 'D:\OpenSim 4.1\bin\libblas.dll'. 
'exampleMain.exe' (Win32): Loaded 'D:\OpenSim 4.1\bin\libgcc_s_sjlj-1.dll'. 
'exampleMain.exe' (Win32): Loaded 'D:\OpenSim 4.1\bin\libgfortran-3.dll'. 
'exampleMain.exe' (Win32): Loaded 'C:\Windows\System32\advapi32.dll'. 
'exampleMain.exe' (Win32): Loaded 'C:\Windows\System32\sechost.dll'. 
'exampleMain.exe' (Win32): Loaded 'C:\Windows\System32\rpcrt4.dll'. 
'exampleMain.exe' (Win32): Loaded 'C:\Windows\System32\user32.dll'. 
'exampleMain.exe' (Win32): Loaded 'C:\Windows\System32\win32u.dll'. 
'exampleMain.exe' (Win32): Loaded 'C:\Windows\System32\gdi32.dll'. 
'exampleMain.exe' (Win32): Loaded 'C:\Windows\System32\gdi32full.dll'. 
'exampleMain.exe' (Win32): Loaded 'C:\Windows\System32\msvcp_win.dll'. 
'exampleMain.exe' (Win32): Loaded 'C:\Windows\System32\vcruntime140_1.dll'. 
'exampleMain.exe' (Win32): Loaded 'C:\mingw64\bin\libquadmath-0.dll'. Module was built without symbols.
'exampleMain.exe' (Win32): Unloaded 'C:\mingw64\bin\libquadmath-0.dll'
'exampleMain.exe' (Win32): Loaded 'C:\mingw64\bin\libquadmath-0.dll'. Module was built without symbols.
'exampleMain.exe' (Win32): Loaded 'C:\mingw64\bin\libgcc_s_seh-1.dll'. Module was built without symbols.
'exampleMain.exe' (Win32): Loaded 'C:\mingw64\bin\libwinpthread-1.dll'. Module was built without symbols.
'exampleMain.exe' (Win32): Loaded 'C:\Windows\System32\imm32.dll'. 
The thread 0x5d78 has exited with code 0 (0x0).
Exception thrown at 0x00007FFBFC983FE9 in exampleMain.exe: Microsoft C++ exception: std::length_error at memory location 0x000000BCA06FEC20.
'exampleMain.exe' (Win32): Loaded 'C:\Windows\System32\kernel.appcore.dll'. 
The thread 0x6500 has exited with code 1 (0x1).
The thread 0x1eb4 has exited with code 1 (0x1).
The program '[16860] exampleMain.exe' has exited with code 1 (0x1).

Tags:

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

Re: Run Fail: ExampleMain

Post by Ayman Habib » Tue Sep 07, 2021 7:38 am

Hello,

The problem is likely related to trying to build "Debug" since distributed libraries are "Release" and these two configurations (Debug & Release) can't mix on windows. Try building "Release" or "RelWithDebInfo" instead and let us know how it goes.

Best regards,
-Ayman

User avatar
Bojun Huang
Posts: 5
Joined: Tue Dec 04, 2018 7:25 pm

Re: Run Fail: ExampleMain

Post by Bojun Huang » Tue Sep 07, 2021 8:05 am

Hello,

Thank you! Building "Debug" is the reason cause the error, after I try building "Release" or "RelWithDebInfo" as you said.
And it is my mistake that I didn't fully read the documentation.

Best regards,
-Bojun

User avatar
Ibrahim Hasan
Posts: 11
Joined: Tue Feb 22, 2022 11:33 am

Re: Run Fail: ExampleMain

Post by Ibrahim Hasan » Thu Mar 16, 2023 2:26 am

Hi,

Following up on this issue. I built the example with Rlease configuration and I get the following error message when I I try to run the executable.
4.png
4.png (7.29 KiB) Viewed 503 times
3.png
3.png (7.55 KiB) Viewed 503 times
2.png
2.png (7.44 KiB) Viewed 503 times
1.png
1.png (7.3 KiB) Viewed 503 times
I also got this warning from in the Cmake GUI.
5.png
5.png (8.29 KiB) Viewed 503 times
Any clues how I this could be solved?

Thanks!

User avatar
Ibrahim Hasan
Posts: 11
Joined: Tue Feb 22, 2022 11:33 am

Re: Run Fail: ExampleMain

Post by Ibrahim Hasan » Thu Mar 16, 2023 3:16 am

It sounds that the issue was because the Opensim directory was not added to the system path. If you add C:\OpenSim 4.4\bin to the system path the issue is solved.

POST REPLY