Closed spacelg closed 2 months ago
Missing -pthreads
On Wed, 24 Jul 2024 at 4:08 PM, spacelg @.***> wrote:
Hi,
OpenFrameworks failed to build due to 'error LNK2001: unresolved external symbol _Cnd_timedwait_for' with MSVC on Windows target arm64 or arm64ec. but it can build pass on target x64. This issue can reproduce on version cbb57f2 https://github.com/openframeworks/openFrameworks/commit/cbb57f2b70385269cc6dd745f2bb8ed3e5a54b43 on master branch. Could you please help look at this issue? Thanks in advance.
Repro steps:
- Open VS2022 amd64 cmd.
- git -C "C:\gitP" clone --no-checkout https://github.com/openframeworks/openFrameworks openframeworks\openFrameworks
- git submodule init
- git submodule update
- "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -host_arch=amd64 -arch=arm64
- cd /d C:\gitP\openframeworks\openFrameworks
- "C:\Program Files\Git\bin\sh.exe" ./scripts/ci/vs/install_bleeding.sh -p vs --silent
- msbuild examples/templates/emptyExample/emptyExample.vcxproj /p:configuration=Release /p:platform=arm64 /p:PlatformToolset=v143
Error log: build_arm64.log https://github.com/user-attachments/files/16357844/build_arm64.log
Error info: openframeworksLib.lib(ofThread.obj) : error LNK2001: unresolved external symbol _Cnd_timedwait_for [C:\gitP\openframeworks\openFrameworks\examples\templates\emptyExample\emptyExample.vcxproj] bin\emptyExample.exe : fatal error LNK1120: 1 unresolved externals [C:\gitP\openframeworks\openFrameworks\examples\templates\emptyExample\emptyExample.vcxproj] C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(1151,5): error MSB6006: "link.exe" exited with code 1120. [C:\gitP\openframeworks\openFrameworks\examples\templates\emptyExample\emptyExample.vcxproj] Done Building Project "C:\gitP\openframeworks\openFrameworks\examples\templates\emptyExample\emptyExample.vcxproj" (default targets) -- FAILED.
— Reply to this email directly, view it on GitHub https://github.com/openframeworks/openFrameworks/issues/8058, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGK2HGBVPYPZ3I7QPZKWALZN5AENAVCNFSM6AAAAABLLYKZR6VHI2DSMVQWIX3LMV43ASLTON2WKOZSGQZDMNRXGY3DQNY . You are receiving this because you are subscribed to this thread.Message ID: @.***>
@spacelg could you try this:
msbuild examples/templates/emptyExample/emptyExample.vcxproj /p:configuration=Release /p:platform=arm64 /p:PlatformToolset=v143 /p:AdditionalDependencies=concrt.lib
add: /p:AdditionalDependencies=concrt.lib
Okay traced to inconsistency with C standard.
https://en.cppreference.com/w/c/thread/cnd_timedwait
@spacelg please try again now with C17 set
Hi,
OpenFrameworks failed to build due to 'error LNK2001: unresolved external symbol _Cnd_timedwait_for' with MSVC on Windows target arm64 or arm64ec. but it can build pass on target x64. This issue can reproduce on version cbb57f2 on master branch. Could you please help look at this issue? Thanks in advance.
Repro steps:
Error log: build_arm64.log
Error info: openframeworksLib.lib(ofThread.obj) : error LNK2001: unresolved external symbol _Cnd_timedwait_for [C:\gitP\openframeworks\openFrameworks\examples\templates\emptyExample\emptyExample.vcxproj] bin\emptyExample.exe : fatal error LNK1120: 1 unresolved externals [C:\gitP\openframeworks\openFrameworks\examples\templates\emptyExample\emptyExample.vcxproj] C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(1151,5): error MSB6006: "link.exe" exited with code 1120. [C:\gitP\openframeworks\openFrameworks\examples\templates\emptyExample\emptyExample.vcxproj] Done Building Project "C:\gitP\openframeworks\openFrameworks\examples\templates\emptyExample\emptyExample.vcxproj" (default targets) -- FAILED.