paullouisageneau / libdatachannel

C/C++ WebRTC network library featuring Data Channels, Media Transport, and WebSockets
https://libdatachannel.org/
Mozilla Public License 2.0
1.81k stars 365 forks source link

rtp::binary cause lnk1169 on windows #1292

Open vipcxj opened 4 days ago

vipcxj commented 4 days ago

detail see here

It seems that rtp::binary declared in a __declspec(dllimport) class causing we can not declare another std::vector<std::byte> in our application.

I know the c++ api compatibility is very poor, especially with the c++ api that uses stl. what I didn't anticipate was the conflicts that arise even when compiling libdatachannel with the source code~.

paullouisageneau commented 1 day ago

rtc::binary is not declared in a __declspec(dllimport) class, it is just a type declared at namespace top-level. No import should be involved.

vipcxj commented 17 hours ago

I know, but the reality is that defining a vector<byte> directly myself causes the lnk1169 error, and including "rtc/common.hpp" directly still gives the same error, but including "rtc/track.hpp" or including "rtc/rtc.hpp" the error disappears. So I deduced that it had something to do with __declspec(dllimport).