C言語のタグが見つけれらませんでした。
C言語でMakefileを作成し、実行しようとするとエラーが出ます。
どなたかアドバイスいただけないでしょうか?
m1 macを使用しています。
C
1TARGET = Feb18 2CC = gcc 3CFLAGS = -g -std=c99 -Wall -Wextra -pedantic -Werror -target x86_64-apple-darwin20.3.0 4 5$(TARGET): $(TARGET).c 6 $(CC) $(CFLAGS) -o $@ $^ 7 8clean: 9 rm -rf $(TARGET) *.o *.a *.dylib *.dSYM
C
1gcc -g -std=c99 -Wall -Wextra -pedantic -Werror -target x86_64-apple-darwin20.3.0 -o Feb18 Feb18.c 2Undefined symbols for architecture x86_64: 3 "_main", referenced from: 4 implicit entry/start for main executable 5ld: symbol(s) not found for architecture x86_64 6clang: error: linker command failed with exit code 1 (use -v to see invocation) 7make: *** [Feb18] Error 1 8
C
1void* hello(int size) { 2 char* allocated_memory = (char*) * size; 3 return allocated_memory; 4}
C
1#ifndef _FEB18_H 2#define _FEB18_H 3 4#define hello(s) hello(s, __FILE__, __LINE__) 5#define bye(p) bye(p, __FILE__, __LINE__) 6 7void *hello(size_t size, char *file, int line); 8void bye(void *ptr, char *file, int line); 9 10#endif 11
main() が見当たりませんが。
>C言語のタグが見つけれらませんでした。
「C」です。
https://teratail.com/tags で検索できます。