Skip to content

Add missing export markers (OTIO_API) for constructors#1992

Open
jlskuz wants to merge 1 commit intoAcademySoftwareFoundation:mainfrom
jlskuz:work/msvc-exports
Open

Add missing export markers (OTIO_API) for constructors#1992
jlskuz wants to merge 1 commit intoAcademySoftwareFoundation:mainfrom
jlskuz:work/msvc-exports

Conversation

@jlskuz
Copy link
Contributor

@jlskuz jlskuz commented Jan 18, 2026

This is a follow up to #1953
I am working on MSVC support for Kdenlive (currently MinGW is used for Windows) and hit

kdenliveLib.lib(otioexport.cpp.obj) : error LNK2019: unresolved external symbol "public: __cdecl opentimelineio::v0_18_1::GeneratorReference::GeneratorReference(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::optional<class opentime::v0_18_1::TimeRange> const &,class opentimelineio::v0_18_1::AnyDictionary const &,class opentimelineio::v0_18_1::AnyDictionary const &,class std::optional<class Imath_3_1::Box<class Imath_3_1::Vec2<double> > > const &)" (??0GeneratorReference@v0_18_1@opentimelineio@@QEAA@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@0AEBV?$optional@VTimeRange@v0_18_1@opentime@@@4@AEBVAnyDictionary@12@2AEBV?$optional@V?$Box@V?$Vec2@N@Imath_3_1@@@Imath_3_1@@@4@@Z) referenced in function "private: void __cdecl OtioExport::exportClip(class std::shared_ptr<class TimelineItemModel> const &,struct OtioExport::ClipData const &,struct opentimelineio::v0_18_1::SerializableObject::Retainer<class opentimelineio::v0_18_1::Track> &)" (?exportClip@OtioExport@@AEAAXAEBV?$shared_ptr@VTimelineItemModel@@@std@@AEBUClipData@1@AEAU?$Retainer@VTrack@v0_18_1@opentimelineio@@@SerializableObject@v0_18_1@opentimelineio@@@Z)
bin\cachetest.exe : fatal error LNK1120: 1 unresolved externals 

this brought to my attention that only some classes have OTIO_API on their constructors, while others, such as GeneratorReference, have not causing the above failure. As far as I understand all of these classes and ctors are public API however (please check and confirm) and hence should have OTIO_API.

@darbyjohnston Was #1953 just in complete or did you only add it to certain classes on purpose? This does probably not only affect the ctors, but also other class members. Should I add OTIO_API to all of them (either here or in a seperate PR)? Is it safe to assume that everything in the public: section of src/opentimelineio/*.h files is public api and hence should have OTIO_API?

Signed-off-by: Julius Künzel <julius.kuenzel@kde.org>
@jlskuz jlskuz force-pushed the work/msvc-exports branch from 9571621 to 19698db Compare January 18, 2026 00:18
@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.13%. Comparing base (2429dd5) to head (19698db).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1992   +/-   ##
=======================================
  Coverage   85.13%   85.13%           
=======================================
  Files         181      181           
  Lines       12783    12783           
  Branches     1206     1206           
=======================================
  Hits        10883    10883           
  Misses       1717     1717           
  Partials      183      183           
Flag Coverage Δ
py-unittests 85.13% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/opentimelineio/effect.h 80.00% <ø> (ø)
src/opentimelineio/errorStatus.h 100.00% <100.00%> (ø)
src/opentimelineio/generatorReference.h 50.00% <ø> (ø)
src/opentimelineio/imageSequenceReference.h 56.52% <ø> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2429dd5...19698db. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@darbyjohnston
Copy link
Contributor

Hi @jlskuz, thanks for catching this, there definitely may have been places I missed adding the exports. I think the rule of thumb was all member functions that are not inline, but all of the details are here:
https://github.com/PixarAnimationStudios/OpenUSD/blob/dev/pxr/base/arch/export.h

Were you seeing errors about the ErrorStatus class?

@jlskuz
Copy link
Contributor Author

jlskuz commented Jan 22, 2026

No, I did not see an error about the ErrorStatus class. The only real world issue I saw with Kdenlive was related to GeneratorReference

@darbyjohnston
Copy link
Contributor

I was wondering because it looks like the ErrorStatus members are inline, which I didn't think needed the export decorations (inline makes them visible by default).

@jlskuz
Copy link
Contributor Author

jlskuz commented Jan 23, 2026

Oh, yes I confused at least one operator with a conatructor

@darbyjohnston
Copy link
Contributor

Maybe remove the exports from the ErrorStatus constructors and operators, otherwise this looks good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants