Support : Knowledge base

Knowledge Base

Welcome to OPAL-RT’s Knowledge Base

OPAL-RT offers a repository of support information for optimal use of its technology.

Loading…

Please note that OPAL-RT knowledge base is not fully optimized for mobile platforms.

For optimal experience, use a desktop computer.

Reference Number: AA-02225// Views: AA-02225// Created: 2023-09-13 11:40:05// Last Updated: 2023-09-13 11:49:23
Problem & Solution
Build Error - First Argument Must Be Text / Error in sg.model.build.Hooks.entry

Problem

When trying to build a model, I get the following error (with certain specific MATLAB versions only):

-------------------- Generating rtdemo1_1_sm_computation C code --------------------

??? Error using coder.internal.invoke_rtwbuild_custom_hook

Error encountered while executing custom build hooks sg.model.build.Hooks.entry(modelName,dependencyObject);:

First argument must be text.

Error in coder.internal.invoke_rtwbuild_custom_hook

Error in coder.internal.callMakeHook

Error in coder.internal.ModelBuilder>i_buildProcedure (line 250)

makeHookData = coder.internal.callMakeHook...

Error in coder.internal.ModelBuilder.make_rtw (line 119)

[buildResult, mainObjFolder] = i_buildProcedure...

Error in build_target

Error in build_target

Error in build_standalone_rtw_target

Error in slbuild_private

Error in slbuild_private

Error in sl_feval

Error in slbuild

Error in slbuild

Error in rtwbuild

Error in opMakeRTW - Show complete stack trace

Caused by:
Error using contains

    First argument must be text. - Show complete stack trace

??? Error generating C code for rtdemo1_1_sm_computation subsystem.


Solution

The error might be due to a bug in the Speedgoat I/O Blockset, as explained in this MathWorks answer. Please go to the Speedgoat website and update the I/O blockset toolbox.

For MATLAB 2022a, updating to version 9.6 solved the issue.