My professor gave me a code with no errors.
When I compile it's fine, it doesn't show any errors, but when I try to execute it shows this:
I searched through the Internet but I couldn't find any solution. Please!!!
Someone suggested to try with another computer, but I don't have any other computer I can try to execute the program with.
Please review the rules, which you agreed to when you registered, if you have not already done so.
If the following suggestion doesn't solve your problem, please repost your question in the proper forum with a filled out template.
What is the name of your C++ source file? What command did you use to compile the source code to your C++ program?
If your source file is named program.cpp and you compiled it using the command:
that would create an executable file named program and you would execute it with the command:
or, depending on how your PATH environment variable is set:
If you built it with something like:
that would create executable file named a.out and you would execute it with one of:
or:
From the error message you provided it looks like you tried to execute the source file (program.cpp) instead of the compiled object file (program or a.out).
Hi there,
When I am trying to execute any shell script.
The shell script only execute line 1 and I notice that the rest o the program was not executed. Please advise.
# bash +x vmscript-4.sh
Even when I enter this command there is not output.
sudo su
cd /tmp
cp... (2 Replies)
Hi Experts,
I am creating a script to monitor a certain applications running in my Unix system.
My script order goes this way:
df -h /of/a/filesystem
tail -5 /path/to/an/application/availability
su -c "jsmon pf=(profile of my application) `echo "p"`" usradm
#EOF
I am... (7 Replies)
Hello,
I have a c program executable which I need to run inside a shell script.
But the c program runs in a subshell because of which all the actions done by the c program is not available to the current shell.
Is there any way to execute a C program binary executable in the current shell? (4 Replies)
Hi
I want to create a shell script tha executes a C program and then retrieves information about it.
I managed to run the program with:
#!/bin/bash
gcc -o program program.c
./program
Now i want to get the id of the process (pid)
Any help would be appreciated,
Thank you (18 Replies)
Hi,
I am a complete newbie for unix. I have just installed mysql on my MAC. I was wondering every time I wanted to use mysql I had to ./mysql or sh mysql everytime on /usr/local/bin/mysql/bin. How can I execute the mysql program without using ./ or sh. I chmod +x already. And what do I have to... (3 Replies)
Hi,
i want to write a script that executes a program (exec?) .
this program then requires a filename as input.
how do i give it this input in the script so the program will be complete run and close by the script.
e.g.
exec prog.exe
program then asks for filename
"enter filename:"... (1 Reply)
I tried using the following code to execute a program but it doesnt seems to be working .. I would like to know whats wrong wit it .
execve("/bin/cat", "words", NULL); (0 Replies)