grishka / libtgvoip

VoIP library for Telegram clients
The Unlicense
387 stars 156 forks source link

ifaddrs.h: No such file or directory #include <ifaddrs.h> #47

Closed sagarnayak closed 6 years ago

sagarnayak commented 6 years ago

i cloned the telegram for android and used your repo to put into the jni folder. on odk build i am getting this error-

[armeabi] Compile++ thumb: voip <= BufferInputStream.cpp
[armeabi] Compile++ thumb: voip <= BufferOutputStream.cpp
[armeabi] Compile++ thumb: voip <= BlockingQueue.cpp
[armeabi] Compile++ thumb: voip <= AudioInput.cpp
[armeabi] Compile++ thumb: voip <= AudioInputOpenSLES.cpp
[armeabi] Compile++ thumb: voip <= MediaStreamItf.cpp
[armeabi] Compile++ thumb: voip <= AudioOutput.cpp
[armeabi] Compile++ thumb: voip <= OpusEncoder.cpp
[armeabi] Compile++ thumb: voip <= AudioOutputOpenSLES.cpp
[armeabi] Compile++ thumb: voip <= JitterBuffer.cpp
[armeabi] Compile++ thumb: voip <= OpusDecoder.cpp
[armeabi] Compile++ thumb: voip <= BufferPool.cpp
[armeabi] Compile++ thumb: voip <= OpenSLEngineWrapper.cpp
[armeabi] Compile++ thumb: voip <= AudioInputAndroid.cpp
[armeabi] Compile++ thumb: voip <= AudioOutputAndroid.cpp
[armeabi] Compile++ thumb: voip <= EchoCanceller.cpp
[armeabi] Compile++ thumb: voip <= CongestionControl.cpp
[armeabi] Compile++ thumb: voip <= VoIPServerConfig.cpp
[armeabi] Compile++ thumb: voip <= Resampler.cpp
[armeabi] Compile++ thumb: voip <= NetworkSocket.cpp
[armeabi] Compile++ thumb: voip <= NetworkSocketPosix.cpp
jni/./libtgvoip/os/posix/NetworkSocketPosix.cpp:16:21: fatal error: ifaddrs.h: No such file or directory
 #include <ifaddrs.h>
                     ^
compilation terminated.
make: *** [obj/local/armeabi/objs/voip/./libtgvoip/os/posix/NetworkSocketPosix.o] Error 1

Can you please suggest a fix ?

grishka commented 6 years ago

Please copy the relevant part from the Android.mk from https://github.com/DrKLO/Telegram

grishka commented 6 years ago

Also please make sure to use the libtgvoip version the client you're building comes with. This is normally done by cloning recursively.

sagarnayak commented 6 years ago

I need to clone the Telegram repo with (--recursive), right ? after that i need to ndk-build the TMessageProj. after that, I can run the app?

grishka commented 6 years ago

I need to clone the Telegram repo with (--recursive), right ?

Yes.

after that i need to ndk-build the TMessageProj.

No, you don't need to build the NDK library separately, it's integrated with Gradle. The only thing to look for is that it might not work with the latest NDK.

sagarnayak commented 6 years ago

Which NDK version would suggest? i have 12.1.2977051.

grishka commented 6 years ago

That would work fine.

sagarnayak commented 6 years ago

when i run the app i am getting this error

`Build command failed. Error while executing process D:\android-sdks\ndk-bundle\ndk-build.cmd with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=D:\Android_Projects\Telegram\TMessagesProj\jni\Android.mk NDK_APPLICATION_MK=D:\Android_Projects\Telegram\TMessagesProj\jni\Application.mk APP_ABI=armeabi-v7a NDK_ALL_ABIS=armeabi-v7a NDK_DEBUG=1 APP_PLATFORM=android-16 NDK_OUT=D:/Android_Projects/Telegram/TMessagesProj/build/intermediates/ndkBuild/armv7/debug/obj NDK_LIBS_OUT=D:\Android_Projects\Telegram\TMessagesProj\build\intermediates\ndkBuild\armv7\debug\lib NDK_APPLICATION_MK:=jni/Application.mk APP_PLATFORM:=android-14 D:/Android_Projects/Telegram/TMessagesProj/build/intermediates/ndkBuild/armv7/debug/obj/local/armeabi-v7a/libtmessages.27.so} [armeabi-v7a] SharedLibrary : libtmessages.27.so arm-linux-androideabi-g++: error: CreateProcess: No such file or directory make: *** [D:/Android_Projects/Telegram/TMessagesProj/build/intermediates/ndkBuild/armv7/debug/obj/local/armeabi-v7a/libtmessages.27.so] Error 1

`

grishka commented 6 years ago

No idea. I've never tried to build the Android app on Windows.