sunlubo / SwiftFFmpegDemo-iOS

Simple demo about how to use SwiftFFmpeg on iOS
Apache License 2.0
14 stars 3 forks source link

Ah, duplicate library ? problem ? #1

Open smhk opened 5 years ago

smhk commented 5 years ago

This runs perfectly, build to a device and run.

However when you Archive the project, unfortunately:

Image

ld: 57 duplicate symbols for architecture arm64

So, VideoUtil.o has many dupes (with AVError.o, AudioUtil.o etc etc) such as _swift_AVERROR_HTTP_OTHER_4XX etc.

any easy fix ?!


sunlubo commented 5 years ago

I don't know why this problem occurs. But you can add static specifier to these declarations to solve this problem. e.g. const int swift_AVERROR_BSF_NOT_FOUND = AVERROR_BSF_NOT_FOUND; => static const int swift_AVERROR_BSF_NOT_FOUND = AVERROR_BSF_NOT_FOUND;.

smhk commented 5 years ago

Thanks a lot for that.

As sunlubo explains to solve this

1) go to file avutil_shim.h

2) every const becomes static const

3) there are 57 of them to change

it might even be a soft apple bug, because, it seems to "happen sometimes yes/no" if you just keep starting fresh as an experiment.

anyway SUN LUBO ROCKS as usual