编译并使用Live555 Libs -Windows和Mingw(未解决的引用)
Compile and use Live555 libs - Windows and MinGW (unresolved references)
我正在尝试使用mingw在Windows上编译Live555库。该官员并没有真正指定如何做(只有VC和Borland)。我编辑了win32config,所以它说:
NODEBUG=1
TARGETOS = WINNT
UI_OPTS = $(guilflags) $(guilibsdll)
CONSOLE_UI_OPTS = $(conlflags) $(conlibsdll)
CPU=i386
TOOLS32 = C:Toolsmingw491_32bin
COMPILE_OPTS = $(INCLUDES) $(cdebug) $(cflags) $(cvarsdll) -I. -I"$(TOOLS32)include"
C = c
C_COMPILER = "$(TOOLS32)gcc.exe"
C_FLAGS = $(COMPILE_OPTS)
CPP = cpp
CPLUSPLUS_COMPILER = "$(TOOLS32)g++.exe"
CPLUSPLUS_FLAGS = $(COMPILE_OPTS)
OBJ = o
LINK = $(CXX) -o
LIBRARY_LINK = $(LD) -o
LIBRARY_LINK_OPTS = $(LINK_OPTS) -r -Bstatic
LINK_OPTS = -L.
CONSOLE_LINK_OPTS = $(LINK_OPTS_0) $(CONSOLE_UI_OPTS)
SERVICE_LINK_OPTS = kernel32.lib advapi32.lib shell32.lib -subsystem:console,$(APPVER)
LIB_SUFFIX = lib
LIBS_FOR_CONSOLE_APPLICATION =
LIBS_FOR_GUI_APPLICATION =
MULTIMEDIA_LIBS = winmm.lib
EXE = .exe
PLATFORM = Windows
rc32 = "$(TOOLS32)binrc"
.rc.res:
$(rc32) $<
然后,我运行genwindowsmakefiles.cmd文件,该文件在子文件夹中创建 *.mak文件。我将它们重命名为Makefile,并在每个子文件夹中进行一次跑步:USAGEENVIRNTMENT,GROUPSOCK,LIVEMEDIA,BASICUSUSAGEENVIRONMENT。这给了我 *.lib文件,但是当我在项目中链接它们时,我得到了很多未解决的参考文献:
c:/Tools/live555/libBasicUsageEnvironment.lib:BasicUsageEnvironment.cpp:(.text+0x502): undefined reference to `_imp__WSAGetLastError@0'
c:/Tools/live555/libBasicUsageEnvironment.lib:BasicTaskScheduler.cpp:(.text+0xf89): undefined reference to `_imp__closesocket@4'
c:/Tools/live555/libBasicUsageEnvironment.lib:BasicTaskScheduler.cpp:(.text+0x11ca): undefined reference to `_imp__select@20'
c:/Tools/live555/libBasicUsageEnvironment.lib:BasicTaskScheduler.cpp:(.text+0x11e1): undefined reference to `_imp__WSAGetLastError@0'
c:/Tools/live555/libBasicUsageEnvironment.lib:BasicTaskScheduler.cpp:(.text+0x147a): more undefined references to `__WSAFDIsSet@8' follow
和错误:
c:/Tools/mingw491_32/bin/../lib/gcc/i686-w64-mingw32/4.9.1/../../../../i686-w64-mingw32/bin/ld.exe: c:/Tools/live555/libgroupsock.lib: warning: COMDAT symbol '.eh_frame$_ZNK10NetAddress4dataEv' does not match section name '.eh_frame'
c:/Tools/mingw491_32/bin/../lib/gcc/i686-w64-mingw32/4.9.1/../../../../i686-w64-mingw32/bin/ld.exe: c:/Tools/live555/libliveMedia.lib: warning: COMDAT symbol '.eh_frame$_ZNK9HashTable7IsEmptyEv' does not match section name '.eh_frame'
c:/Tools/mingw491_32/bin/../lib/gcc/i686-w64-mingw32/4.9.1/../../../../i686-w64-mingw32/bin/ld.exe: c:/Tools/live555/libBasicUsageEnvironment.lib: bad reloc address 0x1c in section `.text$_ZN13DelayIntervalC1Ell[__ZN13DelayIntervalC1Ell]'
知道我做错了什么?我该如何修复?
mingw更靠近unix风格的makefile,而不是尝试适应VC Makefile,而是应该尝试:
./genMakefiles mingw
make
我设法解决了问题。未定义的参考来自Winsock库。它在编译Live555时链接了,但是我没有使用Live555链接在项目中(我不知道应该)。将-lws2_32添加到链接选项解决问题。
时,我还以" _unwind _ "关键字遇到了对许多功能的不确定引用 - 原因是在构建Live555和项目中使用的编译器版本之间的原因是不兼容的。
<</p> <</p> <</p>相关文章:
- 节俭并发:未解决的外部问题
- 未解决的外部链接问题
- Visual Studio 2017 中的 QtMetaObject 未解决的外部错误
- 在Embarcadero C++ Builder中生成的DLL未解决的外部链接错误
- 解释未解决的外部C++
- 矛盾的未解决的外部符号+未使用的库与VS2017和FFMPEG 4
- 函数路径追加上未解决的外部符号错误
- Lapack函数DGTSV通过C /Visual Studio提供未解决的外部符号
- 类型长的长度和未解决的超载函数类型的类型的操作数与二进制运算符
- 运算符过载上未解决的外部符号
- 尝试使用堆栈简化目录路径时出现未解决的分段错误
- qfilesystemwatcher未解决的外部
- C 未解决的外部符号(公共静态INT)
- C++ SQLite3 查询问题未解决
- MIDL COM库中未解决的外部符号
- 未解决的外部符号sf ::带有SFML的时间
- C++编译错误LNK2019:未解决的外部符号错误
- VTK / ITK/ QT - 未解决的外部符号错误 (LNK2001)
- 未解决的外部包括AUX_KLIB内核库
- 编译并使用Live555 Libs -Windows和Mingw(未解决的引用)