You are not logged in.
Pages: 1
Hello,
g++ produces not executable executables.
I can compile and run Ardour, which is wirtten in c++, but when i try to compile:
main.cpp
#include <iostream>
using namespace std;
int main ()
{
cout << "this was a test\n";
return 0;
}it compiles. Then i try to execute but i get:
sudo: unable to execute ./a.out: Permission denied
EDIT
i forgot: i can use the same code/commands on my laptop and it works fine
Last edited by killedbymonkeys (2014-03-20 15:17:53)
Offline
chmod +x a.out
...
Offline
that would be easy
but no its already 755 and i'm the owner
Offline
Will you please post the command you use to compile that source code?
Do the bad computer and good computer both run Arch Linux x86_64? (Just wondering)
...and what's up with the "sudo"? I think that's the tricky part here... What the heck, please post your sudo config too. ![]()
Offline
Also, what filesystem is a.out on, and what options is it mounted with?
Drop the sudo. You don't need root privileges to say hello world.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
check if your filesystem is mounted with the "noexec" option with the mount command.
Offline
its on my root partition with ext4 filesystem.
/etc/fstab:
UUID=2f85b33e-e5cf-40b8-b863-e8c6c634d077 / ext4 discard,rw,relatime,data=ordered 0 1
I tried sudo because it original said it had no permission, i know it doesn't make sense. But I just tried ![]()
The command i used is:
g++ main.cpp
And yes both systems run Arch x86_64.
Offline
Okay its solved. I had a NAS share from a third arch system mounted there. Thanks a lot for your help.
Offline
Good to hear. Glad we helped to set you on the right track. ![]()
Remember to mark your topic as [SOLVED] by editing the title in the first post.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
Pages: 1