#include "graph.c"无法找到原文件怎么办

weixin_42163912 2019-03-20 10:15:39
想用VS2017运行基本遗传算法源程序时报错,求大神帮助解决一下

# include <stdio.h>
# include <graphics.h>
# include <math.h>
# include "graph.c"
struct individual
{
unsigned * chrom;
double fitness;
double varible;
int xsite;
int parent[2];
int * utility;
};
struct bestever
{
unsigned * chrom;
double fitness;
double varible;
int generation;
};
struct individual * oldpop;
struct individual * newpop;
struct bestever bestfit;
double sumfitness;
double max;
double avg;
double min;
float pcross;
float pmutation;
int popsize;
int lchrom;
int chromsize;
int gen;
int maxgen;
int run;
int maxruns;
int printstrings;
int nmutation;
int ncross;
static double oldrand[55];
static int jrand;
static double mdx2;
static int mdcalcflag;

FILE * outfp;
void advance_random();
int flip(float); rnd(int, int);
void randomize();
double randomnormaldeviate();
float randomperc(), rndreal(float, float);
void warmup_random(float);
void initialize(), initdata(), initpop();
void initreport(), generation(), initmalloc();
void freeall(), nomernory(char *), report();
void writepop(), writechrom(unsigned *);
void preselect();
void statistics(struct individual *);
void title(), repchar(FILE *, char *, int);
void skip(FILE *, int);
int select();
void objtunc(struct individual *);
int crossover(unsigned *, unsigned *, unsigned *, unsigned *);
void mutation(unsigned *);
...全文
237 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
weixin_42163912 2019-03-23
  • 打赏
  • 举报
回复
引用 4 楼 xian_wwq 的回复:
[quote=引用 1 楼 weixin_42163912 的回复:] 再就是#include<graphics.h>也出错,但是装了Easyx就好了,但是显示easyx只能在C++里运行,这怎么办?
c和c++可以混合编译 没有问题呀 [/quote] 您是怎么混合编译的呢
xian_wwq 2019-03-23
  • 打赏
  • 举报
回复
百度 extern "C"
xian_wwq 2019-03-21
  • 打赏
  • 举报
回复
引用 1 楼 weixin_42163912 的回复:
再就是#include<graphics.h>也出错,但是装了Easyx就好了,但是显示easyx只能在C++里运行,这怎么办?

c和c++可以混合编译
没有问题呀
weixin_42163912 2019-03-20
  • 打赏
  • 举报
回复
@luodongshui
weixin_42163912 2019-03-20
  • 打赏
  • 举报
回复
@u012997273
weixin_42163912 2019-03-20
  • 打赏
  • 举报
回复
再就是#include<graphics.h>也出错,但是装了Easyx就好了,但是显示easyx只能在C++里运行,这怎么办?

69,371

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧