Missing jdataview methods in Max SDK 8.20

Shakeeb Alireza's icon

Shakeeb Alireza

Apr 13, 2025, 7:14 AM

While I was converting Alex Harker's externals collection to cmake-based builds, I found that I couldn't build two of the externals due to missing Max SDK 8.20 support for 3 methods which were in jdataview.h: jdataview_getselectedrowsforview, jdataview_redrawcolumn, and jdataview_selectedrowcount.

These are not referenced in the api docs nor used in the dbview example in the max-sdk, but they do appear in the jdataview.h header.

I would love to know if there is are any known work-arounds for these methods via object_method or the like.

S

Rob Ramirez's icon

Rob Ramirez

Apr 14, 2025, 5:26 PM

These all appear to be in the latest version of the max-sdk, and they are also exported so I'm unsure what issues you are running into using them.

Shakeeb Alireza's icon

Shakeeb Alireza

Apr 14, 2025, 6:18 PM

Hi Rob,

I have commented out these method to make the current commit of the project compile. If I reverse this to expose the relevant methods in this diff:

diff --git a/source/descriptors/entrymatcher/database_view.cpp b/source/descriptors/entrymatcher/database_view.cpp
index f3bbb56e..a15cc8aa 100644
--- a/source/descriptors/entrymatcher/database_view.cpp
+++ b/source/descriptors/entrymatcher/database_view.cpp
@@ -349,8 +349,8 @@ void database_view_update(t_database_view *x)
         }
     }
     
-    // for (long i = 0; i < database.num_columns(); i++)
-    //     jdataview_redrawcolumn(x->dataview, database.get_column_name(i));
+    for (long i = 0; i < database.num_columns(); i++)
+        jdataview_redrawcolumn(x->dataview, database.get_column_name(i));
 }
 
 // Notifications
@@ -492,8 +492,8 @@ void database_view_sort(t_database_view *x, t_symbol *colname, t_privatesortrec
     
     long selection_index = -1;
     
-    // if (jdataview_selectedrowcount(x->dataview))
-    //     selection_index = map_rowref_to_index(x, *jdataview_getselectedrowsforview(x->dataview, x->patcherview));
+    if (jdataview_selectedrowcount(x->dataview))
+        selection_index = map_rowref_to_index(x, *jdataview_getselectedrowsforview(x->dataview, x->patcherview));
     
     // Get the column and store the sorting direction
     

... I get the following undefined symbols error :

Undefined symbols for architecture arm64:
  "_jdataview_getselectedrowsforview", referenced from:
      database_view_sort(t_database_view*, symbol*, _privatesortrec*) in database_view.o
  "_jdataview_redrawcolumn", referenced from:
      database_view_update(t_database_view*) in database_view.o
  "_jdataview_selectedrowcount", referenced from:
      database_view_sort(t_database_view*, symbol*, _privatesortrec*) in database_view.o
ld: symbol(s) not found for architecture arm64
clang++: error: linker command failed with exit code 1 (use -v to see invocation)

Joshua Kit Clayton's icon

Joshua Kit Clayton

Apr 15, 2025, 2:02 AM

Thank you for the report. On brief scan, these symbols are exported, AFAICT, and are not available via object_method. I just took it for a spin adding the use of these functions to the dbviewer example, and was able to reproduce similar experience.

For some reason, the max-sdk-base/script/max-linker-flags.txt is out of sync with the max-sdk-base/c74support/max-includes/c74_linker_flags.txt file. Running the following perl script should let you regenerate the max-linker-flags.txt file with all of the exports. This then compiles properly for me.

perl -pe "s/(-Wl,-U,_\S+)/'\$1'/g" max-sdk/source/max-sdk-base/c74support/max-includes/c74_linker_flags.txt > max-sdk/source/max-sdk-base/script/max-linker-flags.txt

I've made a ticket and also attached a new max-linker-flags.txt for your convenience.

max-linker-flags.txt
txt

Hope this helps!

Shakeeb Alireza's icon

Shakeeb Alireza

Apr 15, 2025, 5:06 AM

@Joshua and @Robert

That's great! Thanks very much for the help, it worked!

I just committed the fix to the project.

S

Shakeeb Alireza's icon

Shakeeb Alireza

Apr 17, 2025, 9:36 AM

Incidentally, I have created a PR with the max-sdk-base fix due to running the perl script above.