In file included from /usr/include/X11/Xlib.h:44,
from /home/mpi/example/include/mpi_all.h:35,
from /home/mpi/example/include/test_mpi_all.h:19,
from /home/mpi/example/mod/test_mpi_all.cpp:24:
/homempi/example/include/easylogging++.h:2140:3: error: expected identifier before numeric constant
2140 | None = 1, NormalLog = 2, SysLog = 4
| ^~~~
这里我们可以找到在Xlib.h 中宏定义了None 为 0L;
为了解决冲突,我们修改easylogging++;
在easylogging++.cc 中2474 行,将 base::DispatchAction::None 修改为 base::DispatchAction::E_None;
当然这里可以自定义为其他名称,不起冲突即可;
其次,我们还要修改easylogging++.h;
在2140行,将None修改为E_None;
同样还有2161行,同样修改;
一共三处修改即可;
再次编译,问题即可解决;
源代码:https://github.com/amrayn/easyloggingpp
无需要依赖其他三方库,直接集成到工程理编译就行
If you are working on a small utility or large project in C++, this library can be handy. Its based on single header and only requires to link to single source file. (Originally it was header-only and was changed to use source file in [issue #445](https://github.com/amrayn/easyloggingpp/issues/445). You can still use header-only in [v9.89](https://github.com/amrayn/easyloggingpp/releases/tag/9.89)).
This library has been design
对于 Linux 平台下使用 OBS 进行编译,需要设置一些编译参数。具体步骤如下:
1. 安装 OBS:在终端中输入 `sudo apt-get install obs-studio` 命令进行安装。
2. 打开 OBS:在终端中输入 `obs` 命令打开 OBS。
3. 设置编译参数:在 OBS 中选择“文件”->“设置”->“流”,在“流类型”中选择“自定义流媒体服务器”,在“URL”中填写推流地址,例如 rtmp://localhost/live/test,然后在“流密钥”中填写密钥,例如 test。
4. 开始推流:在 OBS 中选择“开始推流”,即可开始推流。