Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

c: Command not found



  • I created an Empty QMake Project at ubuntu / Qt-Creator-4.1 by File --> New File or New Project --> Other Projects --> Empty QMake Project --> ...
    I built it and failed, getting: "c: Command not found".
    What do I miss in my Ubuntu environment?



  • @Stan-Huang

    How did you install Qt creator?
    Which version of Qt did you install?
    Is the tool chain completely installed?



  • This Qt-Creator version is 4.1.0, not installed by me. This installation was left in a work environment and I was assigned to take over that job suddenly. I found Qt-Creator over there and then tried to use it. How can I check if all necessary tools ready in my Ubuntu environment? If it lacks some tools, where can I find to install them?


  • Lifetime Qt Champion

    @Stan-Huang Was this Creator used for Cross-compiling?

    I've seen this error when Creator was started from an "environment-setup" shell script to set up the cross-compiler and then used for "normal" compiling.



  • @aha_1980 Could you say it in detail how I can check if the compilation environment setup legal or not?


  • Lifetime Qt Champion

    @Stan-Huang

    Check the environment variables, especially if PATH is changed or variables like CC.

    How do you start Qt Creator?



  • Just click the Qt-Creator icon from the tool bar.


  • Lifetime Qt Champion

    Can you run gcc --version in a command prompt ?



  • gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
    Copyright (C) 2013 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions. There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.



  • I started up Qt-Creator in such way, then it works
    1 . open Terminal
    2 . execute $~/qtcreator-4.1.0/bin/qtcreator.sh

    The "c: command not found" was gone and it built successfully.

    The content of qtcreator.sh is:

    source /opt/poky/2.1/environment-setup-cortexa9hf-neon-poky-linux-gnueabi .
    #! /bin/sh

    Use this script if you add paths to LD_LIBRARY_PATH

    that contain libraries that conflict with the

    libraries that Qt Creator depends on.

    makeAbsolute() {
    case $1 in
    /*)
    # already absolute, return it
    echo "$1"
    ;;
    *)
    # relative, prepend $2 made absolute
    echo makeAbsolute "$2" "$PWD"/"$1" | sed 's,/.$,,'
    ;;
    esac
    }

    me=which "$0" # Search $PATH if necessary
    if test -L "$me"; then
    # Try readlink(1)
    readlink=type readlink 2>/dev/null || readlink=
    if test -n "$readlink"; then
    # We have readlink(1), so we can use it. Assuming GNU readlink (for -f).
    me=readlink -nf "$me"
    else
    # No readlink(1), so let's try ls -l
    me=ls -l "$me" | sed 's/^.*-> //'
    base=dirname "$me"
    me=makeAbsolute "$me" "$base"
    fi
    fi

    bindir=dirname "$me"
    libdir=cd "$bindir/../lib" ; pwd

    Add path to deployed Qt libraries in package

    qtlibdir=$libdir/Qt/lib
    if test -d "$qtlibdir"; then
    qtlibpath=:$qtlibdir
    fi

    Add Qt Creator library path

    LD_LIBRARY_PATH=$libdir:$libdir/qtcreator$qtlibpath${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
    export LD_LIBRARY_PATH
    exec "$bindir/qtcreator" ${1+"$@"}



  • @Stan-Huang !
    I'm facing the similar problem and the error i have is
    c: command not found
    My Qt version is 5.9 and i'm using ubuntu 14.04.

    and also, can you please send me the instructions to install this "source /opt/poky/2.1/environment-setup-cortexa9hf-neon-poky-linux-gnueabi ." as i couldn't find this in my PC.

    -Thanks in advance


  • Lifetime Qt Champion

    Hi @Adarsh_Kumar

    do you actually want to cross-compile? If not, then you have another problem.

    Regards



  • Hi @aha_1980,
    Yes I want to cross compile


  • Lifetime Qt Champion

    @Adarsh_Kumar then please tell us more about your setup.

    • which target?
    • which toolchain did you install and where?
    • have you setup Creator for cross compiling? what did you do?

    Regards


Log in to reply