Page 1 of 1

Tutorial RE

Posted: 21 Aug 2023
by bansky0
Hi, I propose this topic so new developers can ask questions that might find during RE tutorial.

So, I try to follow the tutorial writing the code instead of copy/paste. So probably as many I struggle a bit with the syntax and spend a lot of time try to be as accurate as possible while understand what each part of the code does.

Long story short I finally I get to the tutorial part where I have to make the lamp flashes but I realize that my code editor point me out that can not fin the source file Jukebox, either in the HeyWorld.cpp and my HeyWorld.h. (I replaced hello by hey from the beginning)

I try to build but it show me the following error:

Code: Select all

Building HeyWorld.cpp
HeyWorld.cpp:3:12: error: out-of-line definition of 'CHeyWorld' does not match any declaration in 'CHeyWorld'
CHeyWorld::CHeyWorld(TJBox_Float32 iSampleRate)
           ^~~~~~~~~
HeyWorld.cpp:12:46: error: use of undeclared identifier 'kCustomPropsTag_LampState'
    JBox_StoreMOMPropertyByTag(fCustomProps, kCustomPropsTag_LampState, JBox_MakeBoolean(iLampState) );      
                                             ^
HeyWorld.cpp:12:90: error: use of undeclared identifier 'iLampState'
    JBox_StoreMOMPropertyByTag(fCustomProps, kCustomPropsTag_LampState, JBox_MakeBoolean(iLampState) );      
                                                                                         ^
3 errors generated.
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 815, in local45
    intermediate45File = build45IntermediateFormat(rackExtensionName, intermediateDir, platform, configuration, otherCompilerFlags)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "...\SDKRootFolder\SDK\Tools\Build\build.py", line 583, in build45IntermediateFormat
    clang(dspFile, outputFile, platform, configuration, otherCompilerFlags)
  File "...\SDKRootFolder\SDK\Tools\Build\build.py", line 460, in clang
    runCommand(commandLineAnalyze)
    runCommand(commandLineAnalyze)
  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 '['..\\..\\Tools\\LLVM\\Win\\bin\\clang', '--analyze', '-target', 'x86_64-darwin', '-O0', '-g0', '-fmsc-version=0', '-fno-ms-compatibility', '-D__STDC__', '-DJUKEBOX_SDK=1', '-DDEBUG=1', '-I..\\..\\Tools\\Libs\\Jukebox\\ShimABI', '-I..\\..\\API', '-I..\\..\\Tools\\LLVM\\Jukebox\\libc\\include', '-I..\\..\\Tools\\LLVM\\Jukebox\\libcxx\\include', '-nostdlibinc', '-Wall', '-D__phdsp__', '-fno-aligned-allocation', '-std=c++17', '-D__phdsp64__', 'HeyWorld.cpp']' returned non-zero exit status 1.
Any Ideas how I might solve it?

Re: Tutorial RE

Posted: 21 Aug 2023
by buddard
Did you include HeyWorld.h from HeyWorld.cpp? It seems that neither the class definition (CHeyWorld) nor the constant (kCustomPropsTag_LampState) are found when compiling HeyWorld.cpp. Also iLampState seems to be unknown.

It's hard to draw any definitive conclusions without seeing the code, but I would start by looking at whether HeyWorld.h is properly included.

Re: Tutorial RE

Posted: 22 Aug 2023
by bansky0
buddard: Yes, I did inlude them. Or at least I follow the tutorial. I have attached so you can have a look at the files.