我正在开发一个用 C 编写的项目,但我想使用 Boost。我已将 Boost 库包含在我的主文件中,如下所示:
#define GNU_SOURCE
#define _GNU_SOURCE
#include <stdlib.h>
#include "initialize.h"
#include <stdio.h>
#include <math.h>
#include <boost/random/linear_congruential.hpp>
Run Code Online (Sandbox Code Playgroud)
我正在编译gcc -W -Wall -I/usr/local/boost_1_76_0 main.c -o executable -lm -lboost_random。
main.c:8:10: fatal error: iostream: No such file or directory
8 | #include <iostream>
Run Code Online (Sandbox Code Playgroud)
我猜 Boost 库正在使用<iostream>,但由于它不是 C 库,我不知道如何处理这个问题......我应该用 C++ 编译吗?
| 归档时间: |
|
| 查看次数: |
1487 次 |
| 最近记录: |