davidlattimore / wild

Apache License 2.0
449 stars 11 forks source link

Missing "undefined reference to" error reporting #20

Open marxin opened 1 month ago

marxin commented 1 month ago

Please add error reports:

❯ echo "int foo(); int main() { return foo(); }" | gcc -x c++ - -B ~/Programming/wild/
✦ ❯ ./a.out 
./a.out: symbol lookup error: ./a.out: undefined symbol: _Z3foov
✦ ❯ echo "int foo(); int main() { return foo(); }" | gcc -x c++ -
/usr/lib64/gcc/x86_64-suse-linux/13/../../../../x86_64-suse-linux/bin/ld: /tmp/ccuujEtS.o: in function `main':
<stdin>:(.text+0x5): undefined reference to `foo()'
collect2: error: ld returned 1 exit status
davidlattimore commented 1 month ago

I've had undefined symbols reports errors at various points in the past. I think this time when I fix it, it might be time to add a test :)