notedit / media-server-go

WebRTC media server for go
GNU General Public License v2.0
537 stars 119 forks source link

installing in mac problem #65

Open lgphp opened 4 years ago

lgphp commented 4 years ago

lgphp@mac-pro ~GOPATH/media-server-go (master●)$ go install [ruby-2.3.7p456]

github.com/notedit/media-server-go/wrapper

Undefined symbols for architecture x86_64: "_X509_getm_notAfter", referenced from: DTLSConnection::GenerateCertificate() in libmediaserver.a(dtls.o) "_X509_getm_notBefore", referenced from: DTLSConnection::GenerateCertificate() in libmediaserver.a(dtls.o) ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

Leeaandrob commented 4 years ago

I had similar issues installing on ubuntu =/

imtiyazs commented 4 years ago

It seems you are having wrong compiler.

I am using latest MacOS Catalina and below is the clang version:

Apple clang version 11.0.3 (clang-1103.0.32.59)
Target: x86_64-apple-darwin19.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
lgphp commented 4 years ago

i am using clang complier : Apple clang version 11.0.0 (clang-1100.0.33.17) Target: x86_64-apple-darwin18.7.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

imtiyazs commented 4 years ago

May be this can help.

I know this is an old issue, but just for resolution: using g++/clang++ in place of gcc/clang solves the issue.

Google led me to this thread once again, and replacing clang with clang++ solved the issue again :)

Switching from gcc to g++ to compile solved this issue for me (for a non-JSON issue, but similar issue).

https://stackoverflow.com/questions/7533321/error-when-compiling-some-simple-c-code

https://github.com/nlohmann/json/issues/285

notedit commented 4 years ago

@imtiyazs thanks

imtiyazs commented 4 years ago

@notedit My Pleasure :)