Page 1 of 1

Run Fail: ExampleMain

Posted: Tue Sep 07, 2021 1:02 am
by goldenknight
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 665 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).

Re: Run Fail: ExampleMain

Posted: Tue Sep 07, 2021 7:38 am
by aymanh
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

Re: Run Fail: ExampleMain

Posted: Tue Sep 07, 2021 8:05 am
by goldenknight
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

Re: Run Fail: ExampleMain

Posted: Thu Mar 16, 2023 2:26 am
by imihasan
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 502 times
3.png
3.png (7.55 KiB) Viewed 502 times
2.png
2.png (7.44 KiB) Viewed 502 times
1.png
1.png (7.3 KiB) Viewed 502 times
I also got this warning from in the Cmake GUI.
5.png
5.png (8.29 KiB) Viewed 502 times
Any clues how I this could be solved?

Thanks!

Re: Run Fail: ExampleMain

Posted: Thu Mar 16, 2023 3:16 am
by imihasan
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.