ultravideo / uvgComm

High performance P2P-Mesh video conferencing
ISC License
53 stars 14 forks source link

Win10 Compiler Failed #1

Closed HikariS97 closed 4 years ago

HikariS97 commented 4 years ago

Hi, I use qt creator to compile kvazzup but failed. Here's my folder structure ./msvc_libs msvc_libs

( Here comes another question. I tried thousand times to compile openHEVC, there's so many compile errors when using cmake and msvc. Finally I got a dll named LibOpenHevcWrapper.dll with out a prefix 'lib'. I use this dll at first, but got a error 'file format not recognized'. Then I replace this dll to the one at openHEVC-hevc_rext\bin\ffmpeg_w32 )

./include include

And I comment off win32-gcc in .pro file. If not, errors like 'cannot find -lkvazaar.dll' appear. But actually, I didn't got dlls for opus, speexdsp and kvazaar.

Finally, I got 1900+ errors like these errors1 erros2

I don't know how to fix these up, could you give me help ?

Here's the screenshot of edited .pro file profile

jrsnen commented 4 years ago

Hi,

First of all thank you for your interest in Kvazzup. Those libraries can be a bit hard to compile.

At quick glance it looks like you are using mix of MinGW and MSVC compiled libraries. You should use the same compiler for all libraries and for Kvazzup. Also there is a known issue for compiling kvzRTP with MSVC so I would recommend using MinGW or waiting until the issue is resolved if you want to use MSVC.

HikariS97 commented 4 years ago

@polusto Hi, thanks for your advice. I tried to complie those libs by using mingw64 + msys2. Except openHEVC, other static libs are compiled successfullly. But when I try to build kvazzup, some errors appeared. Do you have any idea of these erros? It's more better than the beginning ( 1900+ errors). 微信图片_20200423154813

jrsnen commented 4 years ago

Hard to tell exactly with this information, but it seems that your build environment is missing openMP which is giving you those omp/GOMP errors. As for kvazaar, are you sure you have used the same compiler for it?

HikariS97 commented 4 years ago

Yes. I use msys2 and mingw64. Compiled by Clang. There's only one error with kvazaar

jrsnen commented 4 years ago

I'm assuming you are mixing 32-bit and 64-bit MinGW builds which to my knowledge does not work. You have to either use 32-bit or 64-bit for all. I'm not familiar with Clang, but I would assume that it works as long as you build the correct binaries.

HikariS97 commented 4 years ago

@polusto I complied kvazaar by ./configure --host=x86_64-w64-mingw32 make I get the static lib named libkvazaar.a (5412kB) If I use "Desktop Qt 5.14.2 MinGW 64-bit", I got error with __imp_kvz_api_get if I use "Desktop Qt 5.14.2 MinGW 32-bit", the error with kvazaar disappear( but other 64-bit libs alert) Does it mean I'm building 32-bit lib of kvazaar?

HikariS97 commented 4 years ago

微信图片_20200428093551 It seems like 64-bit

fador commented 4 years ago

I think you might have to define KVZ_STATIC_LIB when building Kvazzup, so that the kvazaar.h doesn't define "import library" but the static library functions..

jrsnen commented 4 years ago

I can see the folder msvc_libs in you path which is the default path for MSVC compiler. Are you sure you are using MinGW to compile Kvazzup and have correct libraries at correct places? (which currently is ./lib64 for MinGW libraries).

HikariS97 commented 4 years ago

Yes, I delete "win32-msvc{" and "win32-g++{".

jrsnen commented 4 years ago

Are you mixing 32 and 64 bit libraries or have you compiled all libraries with either 32 or 64 bit MinGW?

HikariS97 commented 4 years ago

fador is right. I add #define KVZ_STATIC_LIB in kvazaar.h, then error disappear.

jrsnen commented 4 years ago

That is great. I'll check the compilation process for kvazaar and afterwards I'll close this issue.

HikariS97 commented 4 years ago

I think it's a confusing process for a rookie to compile kvazzup and dependency libs. If kvzrtp could only be compiled by mingw ( at least, now), u should delete the choice of win32-msvc. And the code in code block win32-g++, which is in .dll format, also confused me.

LIBS += -fopenmp ( yes, it's also need in msvc) LIBS += -lssp (It's required by mingw64) BTW, if someone encounter a compile error when compiling opus by mingw, he could also need add -lssp in makefile.

jrsnen commented 4 years ago

Thank you for your input. The MSVC used to work, but there have been a lot of big changes recently and everything has not been kept up to date as it should have been. Sorry that you had go through unnecessary hoops. I'll comment MSVC out for now and remove those dll endings.