chào các bạn, mình có xem qua phần tạo âm thanh trong cuốn lập trình C của GS phạm văn ất
mình có test thử một đoạn code tạo một tiếng “bíp”
đây là code mà mình test
#include <stdio.h>
#include <stdlib.h>
#include <dos.h>
void beep(void);
void beep(void)
{
sound(150);
delay(150);
nosound();
}
int main()
{
int n;
printf("nhap 1 so tu 1 ->5\n");
scanf("%d",&n);
if(n>5||n<1)
{
beep();
printf("\nsai");
}
else
printf("dung\n");
printf("nhan enter\n");
}
nhưng mà khi mình compiler nó báo lỗi
như thế này undefined reference to `sound'|
undefined reference to `delay'|
undefined reference to `nosound'|
error: ld returned 1 exit status
có phải là do code block không hỗ trợ thư viện dos.h phải không mọi người