No such module 'MP42Foundation' when trying to build from Source

Issue #445 closed
Jack XU created an issue

In the beginning, I was trying to add metadata to the National Geographic TV series, Genius: Einstein (Season 1), but I found that while iTunes has this offering as id1219427045, Subler could not find it — whether I type Genius, Genius Einstein or Genius 2017. So I figured maybe I could look into the way Subler actually searched for it and find out how to address this, and keep my media library well organized.

Stage 1: tracing to the source of Subler

I was trying to diagnose this interesting runtime issue about iTunes search, by building Subler and running it in debugging mode. However, I am having some trouble building it.

Stage 2: building and debugging Subler

At this line of code,

// at the beginning of Token.swift
import MP42Foundation

Xcode would say No such module 'MP42Foundation'.

While I can only get the source of MP42Foundation from your repository, I also have time building it. However, I could not create an issue on that repository. So I am appending what I encountered in Stage 3.

Stage 3: Building the imported framework MP42Foundation

When I was building MP42Foundation, I got an error about not having mp4v2, so I installed it via HomeBrew.

However, Xcode still could not build it. So I added the following header search paths to the cloned MP42Foundation project:

  • /usr/local/include/mp4v2
  • /usr/local/include

But now, when I build, at this line of code,

// Line 188-189, MP42VideoTrack.m
MP4AddCleanAperture(fileHandle, self.trackId, _cleanApertureWidthN, 
    _cleanApertureWidthD, _cleanApertureHeightN, _cleanApertureHeightD, 
    _horizOffN, _horizOffD, _vertOffN, _vertOffD);

Xcode reports two issues:

  1. An error: Implicit declaration of function 'MP4AddCleanAperture' is invalid in C99
  2. An warning: This function declaration is not a prototype

Now, I am kinda stuck here. Could you help me out? I really wish add the Genius: Einstein series to my media library. XD

Comments (3)

  1. Priit Varik

    Hi Damiano,

    I am stuck at exactly the same place as Jack XU... Just pulling the MP42Foundation and contrib modules from git won't do the trick. Still the "No such module 'MP42Foundation'." when compiling Token.swift NB! MP42Foundation.xcodeproj itself builds normally, so does the libmp42.a When I adjust the "Framework Search Path" so that MP42Foundation.framework becomes accessible, Subler build still fails, now with 57 Swift compile errors. BuldFailed.jpg

    What am I doing wrong?

  2. Log in to comment