简体   繁体   English

需要帮助使用gcc编译C程序

[英]Need help compiling c program using gcc

I am running FreeBSD 9.2, attempting to compile Dalnet ircd df4.6.5. 我正在运行FreeBSD 9.2,试图编译Dalnet ircd df4.6.5。

I am running into this error, and do not understand it. 我遇到此错误,并且不理解。

channel.c:2536: error: lvalue required as left operand of assignment

Which is this line of code: 这行代码是哪行:

lopt->next = (LOpts *)lopt->yeslist=lopt->nolist=(Link *)NULL;

All of the previous answers to this error I have found was when someone has used = instead of == in an if statement, I know that this code compiles on earlier versions of FreeBSD, but I do not understand what it is doing in the first place to attempt to fix it. 我发现此错误的所有先前答案是,当某人在if语句中使用=而不是==时,我知道此代码可在FreeBSD的早期版本上编译,但我不了解它在第一版中的作用尝试修复它的地方。

Thank you. 谢谢。

(LOpts *)lopt->yeslist is not an lvalue. (LOpts *)lopt->yeslist不是左值。 Hence the compiler error. 因此,编译器错误。

Change the line to: 将行更改为:

lopt->yeslist=lopt->nolist=(Link *)NULL;
lopt->next = (LOpts *)NULL;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM