WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: GCC fails to compile anything  (Read 2939 times)

Offline eagleking95

  • Newbie
  • *
  • Posts: 2
GCC fails to compile anything
« on: February 19, 2016, 08:05:13 AM »
Hello everyone. I have a TCL virtual machine on VirtualBox. I have installed gcc.tcz, gcc_libs.tcz, gcc_libs-dev.tcz and gcc_base-dev.tcz using Apps. However I cannot compile.

For example for the following C code:
Code: [Select]
int main() { return 0; }

Raises errors from /usr/local/bin/ld: cannot find crt1.o. If I add
Code: [Select]
#include <stdio.h> then it says: fatal error: stdio.h: No such file or directory.

Any ideas how can I get it to work? Thanks!!

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: GCC fails to compile anything
« Reply #1 on: February 19, 2016, 08:18:54 AM »
Hi,
install  compiletc.tcz .
Download a copy and keep it handy: Core book ;)

Offline eagleking95

  • Newbie
  • *
  • Posts: 2
Re: GCC fails to compile anything
« Reply #2 on: February 19, 2016, 08:40:34 AM »
It works, thanks!

However I came across another issue. I am trying to compile a program that is using ptrace to block some system calls but I cannot access their codes neither using __NR_<callName> or SYS_<call_name>. For example the compiler gives the error that __NR_socket or SYS_socket is undeclared.

I have included sys/syscall.h, syscall.h and bits/syscall.h ... I don't understand why it says it's undeclared. These constants are defined in those header files.

Any tips/ideas?

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11640
Re: GCC fails to compile anything
« Reply #3 on: February 19, 2016, 11:07:22 AM »
Hi eagleking95
Quote
For example the compiler gives the error that __NR_socket or SYS_socket is undeclared.
That's because they are called  __NR_socketcall  or  SYS_socketcall.

Quote
I have included sys/syscall.h, syscall.h and bits/syscall.h
From  bits/syscall.h:
Quote
"Never use <bits/syscall.h> directly; include <sys/syscall.h> instead."

Information about what you are trying to compile and exact error messages will make it easier to help you.