OSIP2编译CodeBlocks错误
osip2 compiling codeblocks errors
我正在尝试使用OSIP2库版本5.0.0运行一个简单的程序。这是我的代码,我有一些我无法弄清楚的错误。我正在使用CodeBlocks。
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <osip2/osip.h>
#include <osipparser2/osip_parser.h>
#include <string.h>
#include <winsock2.h>
int main() {
int i; osip_t *osip; i=osip_init(&osip); if (i!=0) return -1; }
错误:
||=== Build: Debug in cos2 (compiler: GNU GCC Compiler) ===|
..libosip2-5.0.0libosip2-5.0.0includeosip2osip.h|211|error: field 'timer_a_start' has incomplete type 'timeval'|
..libosip2-5.0.0libosip2-5.0.0includeosip2osip.h|213|error: field 'timer_b_start' has incomplete type 'timeval'|
..libosip2-5.0.0libosip2-5.0.0includeosip2osip.h|215|error: field 'timer_d_start' has incomplete type 'timeval'|
..libosip2-5.0.0libosip2-5.0.0includeosip2osip.h|232|error: field 'timer_e_start' has incomplete type 'timeval'|
..libosip2-5.0.0libosip2-5.0.0includeosip2osip.h|234|error: field 'timer_f_start' has incomplete type 'timeval'|
..libosip2-5.0.0libosip2-5.0.0includeosip2osip.h|236|error: field 'timer_k_start' has incomplete type 'timeval'|
..libosip2-5.0.0libosip2-5.0.0includeosip2osip.h|254|error: field 'timer_g_start' has incomplete type 'timeval'|
..libosip2-5.0.0libosip2-5.0.0includeosip2osip.h|256|error: field 'timer_h_start' has incomplete type 'timeval'|
..libosip2-5.0.0libosip2-5.0.0includeosip2osip.h|258|error: field 'timer_i_start' has incomplete type 'timeval'|
..libosip2-5.0.0libosip2-5.0.0includeosip2osip.h|273|error: field 'timer_j_start' has incomplete type 'timeval'|
..libosip2-5.0.0libosip2-5.0.0includeosip2osip.h|294|error: field 'srv_is_broken' has incomplete type 'timeval'|
..libosip2-5.0.0libosip2-5.0.0includeosip2osip.h|536|error: field 'start' has incomplete type 'timeval'|
C:UsersemergencyDocumentsanalizercos2main.cpp|8|error: '::main' must return 'int'|
C:UsersemergencyDocumentsanalizercos2main.cpp||In function 'int main()':|
C:UsersemergencyDocumentsanalizercos2main.cpp|16|error: cannot convert 'osip_message_t** {aka osip_message**}' to 'osip_t** {aka osip**}' for argument '1' to 'int osip_init(osip_t**)'|
||=== Build failed: 14 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|
库中显示代码的部分的错误:
struct osip_ict {
int timer_a_length; /**< Timer A A=T1, A=2xT1... (unreliable only) */
struct timeval timer_a_start; /**< Timer A (retransmission) */
int timer_b_length; /**< Timer B B = 64* T1 */
struct timeval timer_b_start; /**< Timer B (fire when transaction timeout) */
int timer_d_length; /**< Timer D D >= 32s for unreliable tr (or 0) */
struct timeval timer_d_start; /**< Timer D */
char *destination; /**< IP used to send requests */
int port; /**< port of next hop */
};
结构timeval
不是标准C结构,它起源于Unix World,并在POSIX中进行标准化。
在Windows上,它在<winsock2.h>
标头文件中定义(因为它是由select
"网络"函数使用的,请参见MSDN上的struct timeval
参考,以获取更多信息)。
由于您包括<winsock2.h>
在<osip2osip.h>
中使用的结构,因此您会收到错误。最简单的解决方案是重新排列您的包含文件的顺序。
相关文章:
- 警告处理为错误这里有什么问题
- "error: no matching function for call to"构造函数错误
- boost::进程间消息队列引发错误
- C++,OpenCV,尝试显示图像时"OpenCV(4.3.0) Error: Assertion failed (size.width>0 && size.height>0)"此错误
- 有关插入适配器的错误。[错误]请求从 'back_insert_iterator<vector<>>' 类型转换为非标量类型
- CodeBlocks,C++,mingw-w64编译器,Windows 10,错误:对`DAQmxCreateTask&
- 错误:LD返回1个退出状态-CodeBlocks
- 在CodeBlocks上编译C 中的Oracle数据库环境时的错误
- CodeBlocks C 在W/ GCC上编译错误
- 尝试解决"out of scope"编译错误:CodeBlocks,Linux Fedora
- OSIP2编译CodeBlocks错误
- QT程序无法编译/具有运行时错误(IDE:CodeBlocks/QTCreator)
- 字符串和结构的CodeBlocks错误
- C++:在CodeBlocks上编译和运行的程序可以工作,但从终端它给出错误语句
- 图形库中的CodeBlocks错误
- c++ Codeblocks + libcurl以链接错误结束
- visual studio中出现错误.它在CodeBlocks中工作.请求const
- C++ CodeBlocks & Xcode 中的编译器错误
- SFML 2.3 和 CodeBlocks 错误编译
- 在CodeBlocks中编译c++代码时出现多个定义错误