Error : Cannot run C compiled programs. if you meant to cross compile use --host' Ubuntu

18,615

The problem is almost certainly because you are trying to run the configure command on an external drive that does not support Unix-style executable permissions.

Although it is possible to mount some non-Linux drives with execute permissions, the easiest solution will be to copy the archive to somewhere in your actual Ubuntu home directory and try again there.

If you are trying to save disk space in your home directory you can keep the actual tar.gz file on the external disk.

Share:
18,615

Related videos on Youtube

Ali.A
Author by

Ali.A

Updated on September 18, 2022

Comments

  • Ali.A
    Ali.A over 1 year

    I'm completely new to Ubuntu I downloaded and unpacked a tar.gz package, after extraction, it is said in its documentation : "type ./configure --disable-gts"

    But when I run this command alone it tells me "Permission Denied" error. Then I tried to use sh ./configure --disable-gts instead, but this time I faced this error:

    > configure: error: cannot run C compiled programs.
    If you meant to cross compile, use `--host'.
    

    How can I overcome these two problems? (I mean permission and compile error) I'm just a rookie and I need urgent help.

    • Warren Hill
      Warren Hill over 10 years
      Most new users do not need to compile from source as many programs either exist in the software centre or there is a ppa or deb package available. Tell us what you are trying to do and we may be able to recommend an easier way to install it. Also provide a link to what you downloaded so if you do have to install from source we can give detailed instructions.
    • steeldriver
      steeldriver over 10 years
      Where did you download / unpack the archive to? these kinds of execution issues often occur if you are trying to run commands on an NFTS or FAT partition
    • Ali.A
      Ali.A over 10 years
      To compile, follow these steps (in which I assume only a passing familiarity with linux/unix): 1) Save the file lbflow-1.1.tar.gz in a directory where you have write privilege. 2) Open a terminal window and navigate to that directory 3) upack with the following command (note that '>' indicates the command prompt, you don't type it!): > tar -zxf lbflow-1.1.tar.gz This will produce a directory called lbflow-1.1 4) Navigate to the new directory with: > cd lbflow-1.1 5) Configure and build with: > ./configure --disable-gts > make > make docs
    • Ali.A
      Ali.A over 10 years
      @steeldriver /media/New Volume/Uni/Seminar/Lattice Boltzmann/LBM Codes/LBFlow/lbflow/lbflow-1.1
    • dobey
      dobey over 10 years
      You need to install the requisite dependencies to build anything from source, including the necessary compiler and tools, which are not installed by default.
    • Ali.A
      Ali.A over 10 years
      @dobey No. It's not me
    • dobey
      dobey over 10 years
      Yes it is. I've been doing this for a very long time. Look at your config.cache. You have a misconfigured environment, and possibly missing a thing or two. Read the config.log file in the directory where configure is, to find more info about the problem.
    • steeldriver
      steeldriver over 10 years
      @Ali.A can you please add to your post the output of the command mount | grep media? I strongly suspect the drive is not a native Linux filesystem e.g. NTFS or FAT
    • Ali.A
      Ali.A over 10 years
      @dobey I replied to your first comment, not the 2nd one ;) ok. i will read it and make you know
    • Ali.A
      Ali.A over 10 years
      @steeldriver here's the output: /dev/sda1 on /media/2CC80C2AC80BF0BE type fuseblk (rw,nosuid,nodev,allow_other,default_permissions,blksize=409‌​6) /dev/sda2 on /media/B8907ACD907A919C type fuseblk (rw,nosuid,nodev,allow_other,default_permissions,blksize=409‌​6) /dev/sda3 on /media/New Volume type fuseblk (rw,nosuid,nodev,allow_other,default_permissions,blksize=409‌​6)
  • Ali.A
    Ali.A over 10 years
    Thanx steeldriver for your answer and guides :) But i gained no results even when i copied the whole folder to my /home directory. I finally used "sh ./configure" rather than "./config" and it worked! but i faced anpther problem with "make" command that i will ask in another question and will tag you in order to see my question. (I afraid some moody person give me another negative vote just because of asking questions!)
  • steeldriver
    steeldriver over 10 years
    Probably because you unpacked the archive on the external device first and then copied the folder, the configure script's execute permission got lost - instead of using sh it likely would have worked if you set the file's execute permission and then did './configure' as per the original instructions. Or you could have unpacked the archive again in your /home dir.
  • Ali.A
    Ali.A over 10 years
    I would give it a try. This is my next error : askubuntu.com/questions/360529/error-using-make-command I would be appreciated if you take a look at it too
  • steeldriver
    steeldriver over 10 years
    I have just commented on your new thread - I suggest you start over and unpack the tar.gz file again in your home dir instead of using the folder you copied from the external drive
  • Rok Jarc
    Rok Jarc about 9 years
    had this problem trying to run ./configure from synced folder (Vagrant on OS X). copying files to /home on VM made all the difference :)