Get started build Error

This forum is for developers of Rack Extensions to discuss the RE SDK, share code, and offer tips to other developers.
bansky0
Posts: 5
Joined: 27 Jul 2023

Post 29 Jul 2023

Hi,

I recently beginning with RE developer started pack, but seems it is pretty well documented although I have troubles building through python.

When I run the command line

Code: Select all

python build45.py local45 Testing
. I got the following messages:

Code: Select all

Building JukeboxExports.cpp
Building SampleSound.cpp
Building VerySimpleSampler.cpp
Building Voice.cpp
Building VoicePool.cpp
   Creating library Intermediate-llvm\Testing\64\dependencytest.lib and object Intermediate-llvm\Testing\64\dependencytest.exp
   Creating library Intermediate-llvm\Testing\64\VerySimpleSampler64.lib and object Intermediate-llvm\Testing\64\VerySimpleSampler64.exp
VerySimpleSampler_static_libraryInst.obj : error LNK2019: unresolved external symbol pow referenced in function _Z23FreqFactorFromSemiNotesd
VerySimpleSampler_static_libraryInst.obj : error LNK2019: unresolved external symbol log referenced in function log2
VerySimpleSampler_static_libraryInst.obj : error LNK2019: unresolved external symbol powf referenced in function exp10f
VerySimpleSampler_static_libraryInst.obj : error LNK2019: unresolved external symbol logf referenced in function log2f
VerySimpleSampler_static_libraryInst.obj : error LNK2019: unresolved external symbol cos referenced in function ccos
VerySimpleSampler_static_libraryInst.obj : error LNK2019: unresolved external symbol sin referenced in function ccos
VerySimpleSampler_static_libraryInst.obj : error LNK2019: unresolved external symbol exp referenced in function _cchsh
VerySimpleSampler_static_libraryInst.obj : error LNK2019: unresolved external symbol cosf referenced in function ccosf
VerySimpleSampler_static_libraryInst.obj : error LNK2019: unresolved external symbol sinf referenced in function ccosf
VerySimpleSampler_static_libraryInst.obj : error LNK2019: unresolved external symbol expf referenced in function _cchshf
RackExtWrapperLib.lib(WinRuntimeInit.obj) : error LNK2019: unresolved external symbol __security_init_cookie referenced in function DSPMain
RackExtWrapperLib.lib(WinRuntimeInit.obj) : error LNK2019: unresolved external symbol __imp_DisableThreadLibraryCalls referenced in function DSPMain
RackExtWrapperLib.lib(WinRuntimeInit.obj) : error LNK2019: unresolved external symbol _CRT_INIT referenced in function DSPMain
clang_rt.builtins-x86_64.lib(muldc3.obj) : error LNK2019: unresolved external symbol _finite referenced in function __muldc3
clang_rt.builtins-x86_64.lib(mulsc3.obj) : error LNK2001: unresolved external symbol _finite
clang_rt.builtins-x86_64.lib(muldc3.obj) : error LNK2019: unresolved external symbol _isnan referenced in function __muldc3
clang_rt.builtins-x86_64.lib(mulsc3.obj) : error LNK2001: unresolved external symbol _isnan
C:\Program Files (x86)\Windows Kits\10\\lib\10.0.22000.0\\um\x86\kernel32.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'x64'
C:\Program Files (x86)\Windows Kits\10\\lib\10.0.22000.0\\um\x86\uuid.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'x64'
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\lib\x86\LIBCMT.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'x64'
Intermediate-llvm\Testing\64\VerySimpleSampler64.dll : fatal error LNK1120: 15 unresolved externals
Build ERROR!
Traceback (most recent call last):
  File "...\SDKRootFolder\SDK\Tools\Build\build.py", line 1207, in doBuild
    local45(re_name, platform, configuration, OTHER_COMPILER_FLAGS, productID)
  File "...\SDKRootFolder\SDK\Tools\Build\build.py", line 823, in local45
    build45DLL(rackExtensionName, intermediate45File, builtLibraryName, intermediateDir, platform, configuration)
  File "...\SDKRootFolder\SDK\Tools\Build\build.py", line 715, in build45DLL
    runCommand(commandLine)
  File "...\SDKRootFolder\SDK\Tools\Build\build.py", line 371, in runCommand
    subprocess.check_call(commandLine)
  File "C:\Python311\Lib\subprocess.py", line 413, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['link', '/NOLOGO', '/DLL', '/ENTRY:DSPMain', '/LIBPATH:..\\..\\Tools\\Libs\\VisualStudio\\x64\\Testing', '/INCREMENTAL:NO', '/DEBUG', '@..\\..\\Tools\\Libs\\RackExtensionWrapper\\x64\\WinDLLExports.txt', '/NODEFAULTLIB:libucrtd', '/NODEFAULTLIB:ucrt', '/NODEFAULTLIB:ucrtd', '/NODEFAULTLIB:libvcruntimed', '/NODEFAULTLIB:vcruntime', '/NODEFAULTLIB:vcruntimed', '/NODEFAULTLIB:libcmtd', '/NODEFAULTLIB:msvcrt', '/NODEFAULTLIB:msvcrtd', '/NODEFAULTLIB:msvcmrt', '/NODEFAULTLIB:msvcmrtd', '/NODEFAULTLIB:msvcurt', '/NODEFAULTLIB:msvcurtd', '/NODEFAULTLIB:libcpmt', '/NODEFAULTLIB:msvcprt', '/NODEFAULTLIB:libcpmtd', '/NODEFAULTLIB:msvcprtd', 'kernel32.lib', '/OUT:Intermediate-llvm\\Testing\\64\\VerySimpleSampler64.dll', 'Intermediate-llvm\\Testing\\64\\VerySimpleSampler_static_libraryInst.obj', '..\\..\\Tools\\Libs\\RackExtensionWrapper\\x64\\Deployment\\RackExtWrapperLib.lib', '..\\..\\Tools\\LLVM\\Win\\lib\\clang_rt.builtins-x86_64.lib', 'Intermediate-llvm\\Testing\\64\\wrapperlibc.obj']' returned non-zero exit status 1120.
I partially solved building with Visual Studio and the solution provided in the examples folder in the SDK. Although I found that I must use the command line to continue with the tutorial and test future RE.

Also, I try some experiments to find other ways to build it. I try using git, powershield and cdm in admin mode with similar results. I really enthusiastic about coding but seems I need someone with more experience to solve it.

jengstrom
Reason Studios
Posts: 101
Joined: 04 May 2015

Post 03 Aug 2023

@bansky0: That one is a classic. You need to make sure you run the script from a command prompt with environment targeting Windows x64 architecture. This is usually done by starting a command prompt from a specific shortcut installed with Visual Studio / MSBuild Desktop Tools, called e.g. "x64 Native Tools Command Prompt for VS 2019".

bansky0
Posts: 5
Joined: 27 Jul 2023

Post 04 Aug 2023

jengstrom wrote:
03 Aug 2023
@bansky0: That one is a classic. You need to make sure you run the script from a command prompt with environment targeting Windows x64 architecture. This is usually done by starting a command prompt from a specific shortcut installed with Visual Studio / MSBuild Desktop Tools, called e.g. "x64 Native Tools Command Prompt for VS 2019".
Thanks @jengstrom, you just pointed me out in the right direction!

Just for the record, if somebody is using Visual Studio 2022. I solved it running in PowerShell in admin mode
...\tools\.\Launch-VsDevShell.ps1 -Arch amd64

And then running the python line.

jengstrom
Reason Studios
Posts: 101
Joined: 04 May 2015

Post 08 Aug 2023

@bansky0: You are not supposed to need admin mode for anything. That can make the resulting files have weird permissions, and cause other problems.

The error message in your earlier post has nothing to do with permissions. The issue is just that the command prompt you started was for 32 bit executables when it should be 64 bit.

Powershell is not needed in any way - it calls for a regular command prompt shortcut for Visual Studio, specifically targeting 64 bit (x64), but good if powershell works too.

Maybe you mean that VS2022 no longer comes with command prompt shortcuts, and they have been replaced by powershell. I'm not sure as I have not tried VS2022 yet.

User avatar
Murf
RE Developer
Posts: 670
Joined: 21 Jun 2019
Location: Brisbane, Australia

Post 08 Aug 2023

jengstrom wrote:
08 Aug 2023
@bansky0: You are not supposed to need admin mode for anything. That can make the resulting files have weird permissions, and cause other problems.

The error message in your earlier post has nothing to do with permissions. The issue is just that the command prompt you started was for 32 bit executables when it should be 64 bit.

Powershell is not needed in any way - it calls for a regular command prompt shortcut for Visual Studio, specifically targeting 64 bit (x64), but good if powershell works too.

Maybe you mean that VS2022 no longer comes with command prompt shortcuts, and they have been replaced by powershell. I'm not sure as I have not tried VS2022 yet.
It definitely comes with the custom shortcuts

bansky0
Posts: 5
Joined: 27 Jul 2023

Post 08 Aug 2023

@jengstorm:

Hi. Yes, It is true I didn't need admin mode. I just tested. Thanks for the tip.

I can see what you mean with 32 bit executables. I realized that the problem was that I should be running in 64 bit.

My VS2022 runs the command line in 32 by default even I have installed and configure all in 64 ( I probably didn't do something properly I'm still a newbie with VS). So, what I did was track dev PowerShell and make it run at 64 bit. It is not a straight forward solution because I need to run it to make the command line at 64 bit at the beginning, but I made it work.

I will have a look at custom shortcuts soon. Currently working on the tutorial for RE.

  • Information
  • Who is online

    Users browsing this forum: CommonCrawl [Bot] and 0 guests