问题描述:

I have a C++-Makefile Project that I built and linked and everything went fine.

-- Configuring done

-- Generating done

-- Build files have been written to: /folder/build/

First I used the bash to configure the project with cmake, then I loaded the project as "existing makefileproject" in eclipse and built it. Building went fine too but than I try to run the program and I get an error:

Error starting process.

Exec_tty error:Cannot run program "/folder/build/programname": Unknown reason

Exec_tty error:Cannot run program "/folder/build/programname": Unknown reason

Exec_tty error:Cannot run program "/folder/build/programname": Unknown reason

I tried to run the project from the bash as well but the resulting error message was:

If 'programname' is not a typo you can use command-not-found to lookup the package that contains it, like this:

cnf programname

I used ls -l programname to get information about the file.

-rw-r--r-- 1 username users 6411620 Apr 27 13:54 programname

when I try to change the read and write modus with

chmod 777 programname

nothing happens and programnames information stays the same.

What went wrong with my building of the project??

网友答案:

Here are a few things to try:

  • Try a simple program (e.g. hello world) to make sure your environment is set up correctly. If you do hello world, make sure you put a sleep(5); statement or something similar so it will stay on the screen long enough to see it.
  • Try to build the program in Eclipse, and let it generate the make file for you.
  • Make sure your permissions are set correctly (which you were doing with chmod), but do another ls -l to ensure your permission changes were effective. I would suggest chmod 760 programname to be more in compliance with security policies.
  • To run your program in Linux, you can cd to the directory that contains the program, and type ./programname

Hopefully one of these will work for you!

相关阅读:
Top