Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
16 years ago

uart file point

#include "system.h"# include <string.h>

# include "altera_avalon_jtag_uart.h"# include "altera_avalon_jtag_uart_fd.h"# include "altera_avalon_jtag_uart_regs.h"# include <stdio.h>

int main(void)

{

char *mag="hebei";

FILE *fp;

fp=fopen("/dev/jtag_uart","w");

if(fp)

{

fprintf(fp,"%s\n",mag);

fclose(fp);

}

return 0;

}

error : in funtion &#39;mian&#39;

undefined reference to &#39;fclose&#39;

undefined reference to &#39;fopen&#39;

I donnot kown if or not some liberary is not added,so those errors generate ,

I have tried compiling nots of time ,the errors also show,

I hope somebody can help me ,thanks!

1 Reply