Closed sionzee closed 5 years ago
Try a branch "fix/201902082055_cmake" without your workarounds.
Hello. Thank you for quick answer.
Your commits fixed issue with library not found. But still is here issue with undefined references.
You can easily reproduce it when building only part ltjs_snd_drv_dx8
. (it happens when building All also)
There is my error log with verbose mode on when building All.
// Note after log there is next text
[ 22%] Building CXX object engine/runtime/ui/src/CMakeFiles/ltjs_lib_ui.dir/cuioption.cpp.obj
cd /d cmake-build-debug\engine\runtime\ui\src && C:\MinGW\mingw64\bin\g++.exe -DNOMINMAX -DNOPS2 -D_DEBUG -D__D3D -D__D3DREND @CMakeFiles/ltjs_lib_ui.dir/includes_CXX.rsp -g -w -std=c++14 -o CMakeFiles\ltjs_lib_ui.dir\cuioption.cpp.obj -c engine\runtime\ui\src\cuioption.cpp
CMakeFiles\ltjs_snd_drv_dx8.dir/objects.a(ltjs_audio_decoder.cpp.obj): In function `ltjs::AudioDecoder::Impl::close()':
engine/runtime/sound/src/ltjs_audio_decoder.cpp:104: undefined reference to `swr_free'
engine/runtime/sound/src/ltjs_audio_decoder.cpp:105: undefined reference to `avcodec_free_context'
engine/runtime/sound/src/ltjs_audio_decoder.cpp:106: undefined reference to `avformat_close_input'
engine/runtime/sound/src/ltjs_audio_decoder.cpp:107: undefined reference to `av_frame_free'
engine/runtime/sound/src/ltjs_audio_decoder.cpp:116: undefined reference to `av_freep'
engine/runtime/sound/src/ltjs_audio_decoder.cpp:120: undefined reference to `avio_context_free'
engine/runtime/sound/src/ltjs_audio_decoder.cpp:124: undefined reference to `av_freep'
CMakeFiles\ltjs_snd_drv_dx8.dir/objects.a(ltjs_audio_decoder.cpp.obj): In function `ltjs::AudioDecoder::Impl::decode(void*, int)':
engine/runtime/sound/src/ltjs_audio_decoder.cpp:169: undefined reference to `av_init_packet'
engine/runtime/sound/src/ltjs_audio_decoder.cpp:177: undefined reference to `av_read_frame'
engine/runtime/sound/src/ltjs_audio_decoder.cpp:187: undefined reference to `av_packet_unref'
engine/runtime/sound/src/ltjs_audio_decoder.cpp:199: undefined reference to `av_packet_unref'
engine/runtime/sound/src/ltjs_audio_decoder.cpp:205: undefined reference to `av_packet_unref'
engine/runtime/sound/src/ltjs_audio_decoder.cpp:213: undefined reference to `avcodec_send_packet'
engine/runtime/sound/src/ltjs_audio_decoder.cpp:215: undefined reference to `av_packet_unref'
engine/runtime/sound/src/ltjs_audio_decoder.cpp:246: undefined reference to `avcodec_receive_frame'
engine/runtime/sound/src/ltjs_audio_decoder.cpp:305: undefined reference to `swr_convert'
CMakeFiles\ltjs_snd_drv_dx8.dir/objects.a(ltjs_audio_decoder.cpp.obj): In function `ltjs::AudioDecoder::Impl::set_position(int)':
engine/runtime/sound/src/ltjs_audio_decoder.cpp:416: undefined reference to `avcodec_flush_buffers'
engine/runtime/sound/src/ltjs_audio_decoder.cpp:427: undefined reference to `av_seek_frame'
CMakeFiles\ltjs_snd_drv_dx8.dir/objects.a(ltjs_audio_decoder.cpp.obj): In function `ltjs::AudioDecoder::Impl::initialize_current_thread()':
engine/runtime/sound/src/ltjs_audio_decoder.cpp:543: undefined reference to `av_log_set_level'
engine/runtime/sound/src/ltjs_audio_decoder.cpp:544: undefined reference to `av_register_all'
engine/runtime/sound/src/ltjs_audio_decoder.cpp:546: undefined reference to `av_find_input_format'
CMakeFiles\ltjs_snd_drv_dx8.dir/objects.a(ltjs_audio_decoder.cpp.obj): In function `ltjs::AudioDecoder::Impl::open_internal(ltjs::AudioDecoder::OpenParam const&)':
engine/runtime/sound/src/ltjs_audio_decoder.cpp:605: undefined reference to `av_malloc'
engine/runtime/sound/src/ltjs_audio_decoder.cpp:612: undefined reference to `avio_alloc_context'
engine/runtime/sound/src/ltjs_audio_decoder.cpp:632: undefined reference to `avformat_alloc_context'
engine/runtime/sound/src/ltjs_audio_decoder.cpp:641: undefined reference to `avformat_open_input'
engine/runtime/sound/src/ltjs_audio_decoder.cpp:687: undefined reference to `avformat_find_stream_info'
engine/runtime/sound/src/ltjs_audio_decoder.cpp:702: undefined reference to `avcodec_alloc_context3'
engine/runtime/sound/src/ltjs_audio_decoder.cpp:709: undefined reference to `avcodec_parameters_to_context'
engine/runtime/sound/src/ltjs_audio_decoder.cpp:719: undefined reference to `avcodec_find_decoder'
engine/runtime/sound/src/ltjs_audio_decoder.cpp:726: undefined reference to `avcodec_open2'
engine/runtime/sound/src/ltjs_audio_decoder.cpp:833: undefined reference to `av_get_default_channel_layout'
engine/runtime/sound/src/ltjs_audio_decoder.cpp:834: undefined reference to `av_get_default_channel_layout'
engine/runtime/sound/src/ltjs_audio_decoder.cpp:836: undefined reference to `swr_alloc_set_opts'
engine/runtime/sound/src/ltjs_audio_decoder.cpp:853: undefined reference to `swr_init'
engine/runtime/sound/src/ltjs_audio_decoder.cpp:863: undefined reference to `av_frame_alloc'
CMakeFiles\ltjs_snd_drv_dx8.dir/objects.a(ltjs_audio_decoder.cpp.obj): In function `ltjs::AudioDecoder::Impl::rewind_internal()':
engine/runtime/sound/src/ltjs_audio_decoder.cpp:887: undefined reference to `avcodec_flush_buffers'
engine/runtime/sound/src/ltjs_audio_decoder.cpp:889: undefined reference to `av_seek_frame'
CMakeFiles\ltjs_snd_drv_dx8.dir/objects.a(ltjs_audio_utils.cpp.obj):ltjs_audio_utils.cpp:(.rdata$.refptr._ZN4ltjs10AudioUtils13mb_min_volumeE[.refptr._ZN4ltjs10AudioUtils13mb_min_volumeE]+0x0): undefined reference to `ltjs::AudioUtils::mb_min_volume'
CMakeFiles\ltjs_snd_drv_dx8.dir/objects.a(ltjs_audio_utils.cpp.obj):ltjs_audio_utils.cpp:(.rdata$.refptr._ZN4ltjs10AudioUtils13mb_max_volumeE[.refptr._ZN4ltjs10AudioUtils13mb_max_volumeE]+0x0): undefined reference to `ltjs::AudioUtils::mb_max_volume'
CMakeFiles\ltjs_snd_drv_dx8.dir/objects.a(ltjs_audio_utils.cpp.obj):ltjs_audio_utils.cpp:(.rdata$.refptr._ZN4ltjs10AudioUtils10ds_min_panE[.refptr._ZN4ltjs10AudioUtils10ds_min_panE]+0x0): undefined reference to `ltjs::AudioUtils::ds_min_pan'
CMakeFiles\ltjs_snd_drv_dx8.dir/objects.a(ltjs_audio_utils.cpp.obj):ltjs_audio_utils.cpp:(.rdata$.refptr._ZN4ltjs10AudioUtils10ds_max_panE[.refptr._ZN4ltjs10AudioUtils10ds_max_panE]+0x0): undefined reference to `ltjs::AudioUtils::ds_max_pan'
CMakeFiles\ltjs_snd_drv_dx8.dir/objects.a(ltjs_audio_utils.cpp.obj):ltjs_audio_utils.cpp:(.rdata$.refptr._ZN4ltjs10AudioUtils10lt_min_panE[.refptr._ZN4ltjs10AudioUtils10lt_min_panE]+0x0): undefined reference to `ltjs::AudioUtils::lt_min_pan'
CMakeFiles\ltjs_snd_drv_dx8.dir/objects.a(ltjs_audio_utils.cpp.obj):ltjs_audio_utils.cpp:(.rdata$.refptr._ZN4ltjs10AudioUtils10lt_max_panE[.refptr._ZN4ltjs10AudioUtils10lt_max_panE]+0x0): undefined reference to `ltjs::AudioUtils::lt_max_pan'
CMakeFiles\ltjs_snd_drv_dx8.dir/objects.a(ltjs_audio_utils.cpp.obj):ltjs_audio_utils.cpp:(.rdata$.refptr._ZN4ltjs10AudioUtils13ds_min_volumeE[.refptr._ZN4ltjs10AudioUtils13ds_min_volumeE]+0x0): undefined reference to `ltjs::AudioUtils::ds_min_volume'
CMakeFiles\ltjs_snd_drv_dx8.dir/objects.a(ltjs_audio_utils.cpp.obj):ltjs_audio_utils.cpp:(.rdata$.refptr._ZN4ltjs10AudioUtils13ds_max_volumeE[.refptr._ZN4ltjs10AudioUtils13ds_max_volumeE]+0x0): undefined reference to `ltjs::AudioUtils::ds_max_volume'
CMakeFiles\ltjs_snd_drv_dx8.dir/objects.a(ltjs_audio_utils.cpp.obj):ltjs_audio_utils.cpp:(.rdata$.refptr._ZN4ltjs10AudioUtils13lt_min_volumeE[.refptr._ZN4ltjs10AudioUtils13lt_min_volumeE]+0x0): undefined reference to `ltjs::AudioUtils::lt_min_volume'
CMakeFiles\ltjs_snd_drv_dx8.dir/objects.a(ltjs_audio_utils.cpp.obj):ltjs_audio_utils.cpp:(.rdata$.refptr._ZN4ltjs10AudioUtils13lt_max_volumeE[.refptr._ZN4ltjs10AudioUtils13lt_max_volumeE]+0x0): undefined reference to `ltjs::AudioUtils::lt_max_volume'
CMakeFiles\ltjs_snd_drv_dx8.dir/objects.a(s_dx8.cpp.obj):s_dx8.cpp:(.rdata$.refptr._ZN4ltjs10AudioUtils14eax_min_reverbE[.refptr._ZN4ltjs10AudioUtils14eax_min_reverbE]+0x0): undefined reference to `ltjs::AudioUtils::eax_min_reverb'
CMakeFiles\ltjs_snd_drv_dx8.dir/objects.a(s_dx8.cpp.obj):s_dx8.cpp:(.rdata$.refptr._ZN4ltjs10AudioUtils14eax_max_reverbE[.refptr._ZN4ltjs10AudioUtils14eax_max_reverbE]+0x0): undefined reference to `ltjs::AudioUtils::eax_max_reverb'
CMakeFiles\ltjs_snd_drv_dx8.dir/objects.a(s_dx8.cpp.obj):s_dx8.cpp:(.rdata$.refptr._ZN4ltjs10AudioUtils19eax_min_reflectionsE[.refptr._ZN4ltjs10AudioUtils19eax_min_reflectionsE]+0x0): undefined reference to `ltjs::AudioUtils::eax_min_reflections'
CMakeFiles\ltjs_snd_drv_dx8.dir/objects.a(s_dx8.cpp.obj):s_dx8.cpp:(.rdata$.refptr._ZN4ltjs10AudioUtils19eax_max_reflectionsE[.refptr._ZN4ltjs10AudioUtils19eax_max_reflectionsE]+0x0): undefined reference to `ltjs::AudioUtils::eax_max_reflections'
CMakeFiles\ltjs_snd_drv_dx8.dir/objects.a(s_dx8.cpp.obj):s_dx8.cpp:(.rdata$.refptr._ZN4ltjs10AudioUtils12eax_min_roomE[.refptr._ZN4ltjs10AudioUtils12eax_min_roomE]+0x0): undefined reference to `ltjs::AudioUtils::eax_min_room'
CMakeFiles\ltjs_snd_drv_dx8.dir/objects.a(s_dx8.cpp.obj):s_dx8.cpp:(.rdata$.refptr._ZN4ltjs10AudioUtils12eax_max_roomE[.refptr._ZN4ltjs10AudioUtils12eax_max_roomE]+0x0): undefined reference to `ltjs::AudioUtils::eax_max_room'
collect2.exe: error: ld returned 1 exit status
mingw32-make.exe[2]: Leaving directory 'cmake-build-debug'
mingw32-make.exe[2]: Entering directory 'cmake-build-debug'
mingw32-make.exe[2]: Leaving directory 'cmake-build-debug'
mingw32-make.exe[2]: *** [engine\runtime\sound\src\sys\s_dx8\CMakeFiles\ltjs_snd_drv_dx8.dir\build.make:144: engine/runtime/sound/src/sys/s_dx8/ltjs_snddrv.dll] Error 1
mingw32-make.exe[1]: *** [CMakeFiles\Makefile2:1098: engine/runtime/sound/src/sys/s_dx8/CMakeFiles/ltjs_snd_drv_dx8.dir/all] Error 2
mingw32-make.exe[1]: *** Waiting for unfinished jobs....
${libs}:
PathToProject/ThirtyParty/ffmpeg-4.1-win32-dev/lib/libavformat.dll.a;PathToProject/ThirtyParty/ffmpeg-4.1-win32-dev/lib/libavfilter.dll.a;PathToProject/ThirtyParty/ffmpeg-4.1-win32-dev/lib/libavutil.dll.a;PathToProject/ThirtyParty/ffmpeg-4.1-win32-dev/lib/libswresample.dll.a;PathToProject/ThirtyParty/ffmpeg-4.1-win32-dev/lib/libswscale.dll.a;dsound;dxguid;winmm;iconv;z
${LTJS_FFMPEG_INCLUDE_DIR}:
PathToProject/ThirtyParty/ffmpeg-4.1-win32-dev/include
This is the last issue. Building CXX went to 100% and only show this. Any tips how to fix it?
You can easily reproduce it when building only part
ltjs_snd_drv_dx8
.
I can't. Maybe because I have higher version of MinGW - 7.0. But encountered some another compiling errors (in CLion) which should be fixed in the updated branch I mentioned earlier.
After your last changes the list with undefined references was reduced to 10 max errors insteadof 50+. Thank you for everything man. I like your work and I very appreciate it.
I also downloaded latest MinGW, 8.1.0, i686, posix threads and dwarf EH. (posix because it wont compile with win32) ATM recking with these issues:
[100%] Linking CXX shared library ltjs_snddrv.dll
cd /d PathToProject\cmake-build-debug\AVP2LTJS\Jupiter\engine\runtime\sound\src\sys\s_dx8 && C:\Users\jan\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\183.4886.39\bin\cmake\win\bin\cmake.exe -E cmake_link_script CMakeFiles\ltjs_snd_drv_dx8.dir\link.txt --verbose=1
C:\Users\jan\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\183.4886.39\bin\cmake\win\bin\cmake.exe -E remove -f CMakeFiles\ltjs_snd_drv_dx8.dir/objects.a
C:\PROGRA~2\MINGW-~1\I686-8~1.0-W\mingw32\bin\ar.exe cr CMakeFiles\ltjs_snd_drv_dx8.dir/objects.a @CMakeFiles\ltjs_snd_drv_dx8.dir\objects1.rsp
C:\PROGRA~2\MINGW-~1\I686-8~1.0-W\mingw32\bin\G__~1.EXE -g -shared -o ltjs_snddrv.dll -Wl,--out-implib,libltjs_snddrv.dll.a -Wl,--major-image-version,0,--minor-image-version,0 -Wl,--whole-archive CMakeFiles\ltjs_snd_drv_dx8.dir/objects.a -Wl,--no-whole-archive @CMakeFiles\ltjs_snd_drv_dx8.dir\linklibs.rsp
CMakeFiles\ltjs_snd_drv_dx8.dir/objects.a(ltjs_audio_decoder.cpp.obj): In function `ZN4ltjs12AudioDecoder4Impl5closeEv':
PathToProject/engine/runtime/sound/src/ltjs_audio_decoder.cpp:105: undefined reference to `avcodec_free_context'
CMakeFiles\ltjs_snd_drv_dx8.dir/objects.a(ltjs_audio_decoder.cpp.obj): In function `ZN4ltjs12AudioDecoder4Impl6decodeEPvi':
PathToProject/engine/runtime/sound/src/ltjs_audio_decoder.cpp:169: undefined reference to `av_init_packet'
PathToProject/engine/runtime/sound/src/ltjs_audio_decoder.cpp:187: undefined reference to `av_packet_unref'
PathToProject/engine/runtime/sound/src/ltjs_audio_decoder.cpp:199: undefined reference to `av_packet_unref'
PathToProject/engine/runtime/sound/src/ltjs_audio_decoder.cpp:205: undefined reference to `av_packet_unref'
PathToProject/engine/runtime/sound/src/ltjs_audio_decoder.cpp:213: undefined reference to `avcodec_send_packet'
PathToProject/engine/runtime/sound/src/ltjs_audio_decoder.cpp:215: undefined reference to `av_packet_unref'
PathToProject/engine/runtime/sound/src/ltjs_audio_decoder.cpp:246: undefined reference to `avcodec_receive_frame'
CMakeFiles\ltjs_snd_drv_dx8.dir/objects.a(ltjs_audio_decoder.cpp.obj): In function `ZN4ltjs12AudioDecoder4Impl12set_positionEi':
PathToProject/engine/runtime/sound/src/ltjs_audio_decoder.cpp:416: undefined reference to `avcodec_flush_buffers'
CMakeFiles\ltjs_snd_drv_dx8.dir/objects.a(ltjs_audio_decoder.cpp.obj): In function `ZN4ltjs12AudioDecoder4Impl13open_internalERKNS0_9OpenParamE':
PathToProject/engine/runtime/sound/src/ltjs_audio_decoder.cpp:702: undefined reference to `avcodec_alloc_context3'
PathToProject/engine/runtime/sound/src/ltjs_audio_decoder.cpp:709: undefined reference to `avcodec_parameters_to_context'
PathToProject/engine/runtime/sound/src/ltjs_audio_decoder.cpp:719: undefined reference to `avcodec_find_decoder'
PathToProject/engine/runtime/sound/src/ltjs_audio_decoder.cpp:726: undefined reference to `avcodec_open2'
CMakeFiles\ltjs_snd_drv_dx8.dir/objects.a(ltjs_audio_decoder.cpp.obj): In function `ZN4ltjs12AudioDecoder4Impl15rewind_internalEv':
PathToProject/engine/runtime/sound/src/ltjs_audio_decoder.cpp:887: undefined reference to `avcodec_flush_buffers'
collect2.exe: error: ld returned 1 exit status
mingw32-make.exe[3]: Leaving directory 'PathToProject/cmake-build-debug'
mingw32-make.exe[2]: Leaving directory 'PathToProject/cmake-build-debug'
mingw32-make.exe[3]: *** [engine\runtime\sound\src\sys\s_dx8\CMakeFiles\ltjs_snd_drv_dx8.dir\build.make:144: runtime/sound/src/sys/s_dx8/ltjs_snddrv.dll] Error 1
mingw32-make.exe[2]: *** [CMakeFiles\Makefile2:1098: engine/runtime/sound/src/sys/s_dx8/CMakeFiles/ltjs_snd_drv_dx8.dir/all] Error 2
mingw32-make.exe[1]: *** [CMakeFiles\Makefile2:1110: engine/runtime/sound/src/sys/s_dx8/CMakeFiles/ltjs_snd_drv_dx8.dir/rule] Error 2
mingw32-make.exe[1]: Leaving directory 'PathToProject/cmake-build-debug'
mingw32-make.exe: *** [Makefile:400: ltjs_snd_drv_dx8] Error 2
I fixed it by adding
avcodec
to FindLTJS_FFmpeg when finding library.
So from:
set(
LTJS_FFMPEG_TMP_REF_LIBS
avformat
avfilter
avutil
swresample
swscale
)
to
set(
LTJS_FFMPEG_TMP_REF_LIBS
avcodec
avformat
avfilter
avutil
swresample
swscale
)
Again: Thank you very much.
Also is possible to inform developer to enable ˙LTJS_INSTALL_SND_DRV_DX8˙ when has enabled LTJS_USE_D3DX9
? Or disallow combination of D3DX9 and OAL?
Because I forgot to switch from LTJS_INSTALL_SND_DRV_OAL
and tried to compile it. It will fail with errors at VertexShaderMgr. (I'm not sure if OAL and D3DX9 are compatible. Just suggesting)
I had the same issue compiling in RPI3 and found this post that resoved the issue
Add the following to the ./configure parameters.
--extra-ldflags="-latomic"
So your command becomes:
./configure --extra-ldflags="-latomic" --arch=armel --target-os=linux --enable-gpl --enable-omx --enable-omx-rpi --enable-nonfree
Hello. When I'am building this project through MinGW it fails with:
Building with CLion: CLion\ch-0\183.4886.39\bin\cmake\win\bin\cmake.exe -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - MinGW Makefiles" MinGW64 - w64 6.0 CMake: 3.13.2
I downloaded "ffmpeg-4.1-win32-dev" from ffmpeg page When you select version 4.1 and win32 arch with dev linking.
The files are present in the directory but have additional suffix. For example instead of libavformat.a there is libavformat.dll.a. There are also .lib files.
When I remove the ".dll" from these files or set
CMAKE_STATIC_LIBRARY_SUFFIX
to.dll.a
it will start compiling but fails with (lines within close function)and soo many other errors related to undefined reference.
I also tried the default ".lib" with
It ends with undefined reference too.
There are my CMake variables:
Seems like it cannot resolve .cpp files. But it should take them from the libs.