修复编译问题

This commit is contained in:
xiongziliang 2018-03-21 11:35:00 +08:00
parent bec36b257e
commit 30aa71cb53
4 changed files with 11 additions and 3 deletions

View File

@ -113,6 +113,10 @@ if(NOT WIN32)
add_compile_options(-Wno-predefined-identifier-outside-function) add_compile_options(-Wno-predefined-identifier-outside-function)
endif() endif()
if(WIN32)
list(APPEND LINK_LIB_LIST ws2_32)
endif()
# #
if(NOT IOS AND NOT ANDROID) if(NOT IOS AND NOT ANDROID)
add_library(${CMAKE_PROJECT_NAME}_shared SHARED ${SRC_LIST}) add_library(${CMAKE_PROJECT_NAME}_shared SHARED ${SRC_LIST})

View File

@ -19,8 +19,9 @@
#define MIN_LOG2_MAX_FRAME_NUM 4 #define MIN_LOG2_MAX_FRAME_NUM 4
#define H264_MAX_PICTURE_COUNT 36 #define H264_MAX_PICTURE_COUNT 36
#define CODEC_FLAG2_IGNORE_CROP 0x00010000 ///< Discard cropping information from SPS. #define CODEC_FLAG2_IGNORE_CROP 0x00010000 ///< Discard cropping information from SPS.
#ifndef INT_MAX
#define INT_MAX 65535 #define INT_MAX 65535
#endif //INT_MAX
/* report level */ /* report level */
#define RPT_ERR (1) // error, system error #define RPT_ERR (1) // error, system error

View File

@ -39,7 +39,7 @@ foreach(TEST_SRC ${TEST_SRC_LIST})
if(ANDROID) if(ANDROID)
target_link_libraries(${TEST_EXE_NAME} ${CMAKE_PROJECT_NAME}_static ${LINK_LIB_LIST}) target_link_libraries(${TEST_EXE_NAME} ${CMAKE_PROJECT_NAME}_static ${LINK_LIB_LIST})
elseif(WIN32) elseif(WIN32)
target_link_libraries(${TEST_EXE_NAME} ${CMAKE_PROJECT_NAME}_shared ${LINK_LIB_LIST}) target_link_libraries(${TEST_EXE_NAME} ${CMAKE_PROJECT_NAME}_shared ${LINK_LIB_LIST} )
else() else()
target_link_libraries(${TEST_EXE_NAME} ${CMAKE_PROJECT_NAME}_shared ${LINK_LIB_LIST} pthread) target_link_libraries(${TEST_EXE_NAME} ${CMAKE_PROJECT_NAME}_shared ${LINK_LIB_LIST} pthread)
endif() endif()

View File

@ -136,7 +136,7 @@ static onceToken s_token([](){
}, nullptr); }, nullptr);
#if !defined(SIGHUP) #if !defined(SIGHUP)
#defined SIGHUP 1 #define SIGHUP 1
#endif #endif
int main(int argc,char *argv[]) { int main(int argc,char *argv[]) {
@ -148,7 +148,10 @@ int main(int argc,char *argv[]) {
Logger::Instance().add(std::make_shared<ConsoleChannel>("stdout", LTrace)); Logger::Instance().add(std::make_shared<ConsoleChannel>("stdout", LTrace));
Logger::Instance().setWriter(std::make_shared<AsyncLogWriter>()); Logger::Instance().setWriter(std::make_shared<AsyncLogWriter>());
//加载配置文件,如果配置文件不存在就创建一个 //加载配置文件,如果配置文件不存在就创建一个
InfoL << mINI::Instance().dump();
Config::loadIniConfig(); Config::loadIniConfig();
InfoL << mINI::Instance().dump();
{ {
//这里是拉流地址支持rtmp/rtsp协议负载必须是H264+AAC //这里是拉流地址支持rtmp/rtsp协议负载必须是H264+AAC