Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@clan
Copy link
Contributor

@clan clan commented Jul 23, 2025

-lmythfreemheg-35 is used when build libmythtv.35.so, so the visibility of MHCreateEngine & MHSetLogging should be different depends on "-DMTV_API", otherwise build is failed with:

/usr/bin/x86_64-pc-linux-gnu-ld.bfd: obj/mhi.o: in function MHIContext:: MHIContext(InteractiveTV*)':
/var/tmp/portage/media-tv/mythtv-35.0-r1/work/mythtv-35.0/mythtv/libs/libmythtv/mheg/mhi.cpp: 80:(.text+0xec): undefined reference to MHCreateEngine(MHContext*)'
/usr/bin/x86_64-pc-linux-gnu-ld.bfd: obj/interactivetv.o: in function InteractiveTV::InteractiveTV(MythPlayerCaptionsUI*)':
/var/tmp/portage/media-tv/mythtv-35.0-r1/work/mythtv-35.0/mythtv/libs/libmythtv/mheg/interactivetv.cpp: (.text+0x17b): undefined reference to MHSetLogging(_IO_FILE*, unsigned int)'
/usr/bin/x86_64-pc-linux-gnu-ld.bfd: libmythtv-35.so.35.0.0: protected symbol _Z12MHSetLoggingP8_IO_FILEj' isn't defined
/usr/bin/x86_64-pc-linux-gnu-ld.bfd: final link failed: bad value

Thank you for contributing to MythTV!

Please review the checklist below to ensure that your contribution
to MythTV is ready for review by our developers.

It is helpful to regularly rebase your pull request to ensure changes
apply cleanly to the current MythTV development branch.

Checklist

-lmythfreemheg-35 is used when build libmythtv.35.so, so the visibility
of MHCreateEngine & MHSetLogging should be different depends on "-DMTV_API",
otherwise build is failed with:

> /usr/bin/x86_64-pc-linux-gnu-ld.bfd: obj/mhi.o: in function MHIContext:: MHIContext(InteractiveTV*)':
> /var/tmp/portage/media-tv/mythtv-35.0-r1/work/mythtv-35.0/mythtv/libs/libmythtv/mheg/mhi.cpp: 80:(.text+0xec): undefined reference to MHCreateEngine(MHContext*)'
> /usr/bin/x86_64-pc-linux-gnu-ld.bfd: obj/interactivetv.o: in function InteractiveTV::InteractiveTV(MythPlayerCaptionsUI*)':
> /var/tmp/portage/media-tv/mythtv-35.0-r1/work/mythtv-35.0/mythtv/libs/libmythtv/mheg/interactivetv.cpp: (.text+0x17b): undefined reference to MHSetLogging(_IO_FILE*, unsigned int)'
> /usr/bin/x86_64-pc-linux-gnu-ld.bfd: libmythtv-35.so.35.0.0: protected symbol _Z12MHSetLoggingP8_IO_FILEj' isn't defined
> /usr/bin/x86_64-pc-linux-gnu-ld.bfd: final link failed: bad value

Signed-off-by: Z. Liu <[email protected]>
@linuxdude42 linuxdude42 self-assigned this Jul 23, 2025
@linuxdude42
Copy link
Contributor

I'm very surprised that this problem has never come up before. Thank you for the patch. I've tweaked it slightly so that the decision doesn't depend on anything external to the libmythfreemheg directory, but depends on a new MHEG_API define that's part of that directory.

@linuxdude42
Copy link
Contributor

What system are you compiling for? Reading through qcompilerdetection.h, Q_DECL_EXPORT and Q_DECL_IMPORT only appear to be different for windows compilers (or old hpux compilers).

@clan
Copy link
Contributor Author

clan commented Jul 24, 2025

What system are you compiling for? Reading through qcompilerdetection.h, Q_DECL_EXPORT and Q_DECL_IMPORT only appear to be different for windows compilers (or old hpux compilers).

Gentoo

@clan clan deleted the mheg branch July 24, 2025 14:12
@linuxdude42
Copy link
Contributor

I haven't noticed any problem on my gentoo builder. I'll have to go double check it.

Is this a recent problem?

@clan
Copy link
Contributor Author

clan commented Jul 24, 2025

I haven't noticed any problem on my gentoo builder. I'll have to go double check it.

Is this a recent problem?

I find this problem when try to fix https://bugs.gentoo.org/960489, which is related to Qt6.9.
But I didn't see any connection with Qt6.9 for this PR (or maybe there are some changes for Q_DECL_* since Qt6.9?).
IIRC, I have successful build before Qt6.9.

@linuxdude42
Copy link
Contributor

That's it. Qt6 has a QT_USE_PROTECTED_VISIBILITY define that changes Q_DECL_EXPORT from "default" to "protected" visibility. Gentoo must have started building qt6 with the "no_direct_extern_access" feature, which is what causes that define to get set.

@clan
Copy link
Contributor Author

clan commented Jul 25, 2025

That's it. Qt6 has a QT_USE_PROTECTED_VISIBILITY define that changes Q_DECL_EXPORT from "default" to "protected" visibility. Gentoo must have started building qt6 with the "no_direct_extern_access" feature, which is what causes that define to get set.

should be this commit: gentoo/gentoo@496ea7a

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.

2 participants