Page 1 of 1

Newbie help: No such file or directory found

Posted: Tue Jun 13, 2023 1:20 am
by sweetac01

Hello! I am currently teaching myself C++ from one of the courses on Udemy. The code I made is:

Code: Select all

#include <iostream>

int main()
{
    int favorite_number;
    std::cout << "Enter your favorite number between 1 and 100: ";
    std::cin >> favorite_number;
    std::cout << "Amazing! That's my favorite number too!" << std::endl;
    return 0;
}

Super basic because I just started. When I build it, there are no errors. Then when I run it, I get this message in my terminal:

Last login: Mon Jun 12 14:18:44 on ttys004
/tmp/codelite-exec.sh ; exit;
alexissweet@Alexiss-MacBook-Air ~ % /tmp/codelite-exec.sh ; exit;
/tmp/codelite-exec.sh: line 3: cd: /Users/alexissweet/Workspaces/Workspaces1/build-Debug/lib: No such file or directory
Hit any key to continue...

When I look at the pathway in my Explorer tab, there are two FirstProgram folders. The first FirstProgram folder is in the build-Debug folder, but that one doesn't have the code. The second one is its own equivalent folder to build-Debug under Workspaces and that is where the code is. How do I change the pathway so I can run my build?

Thank you in advance!


Re: Newbie help: No such file or directory found

Posted: Tue Jun 13, 2023 1:07 pm
by DavidGH

Hi,

Have a look at your Project Settings (the spanner/wrench icon in the Workspace View). You'll see something like this:

IntDir.png

You probably need to add something sensible to the 'Intermediate Directory' field; most likely /Users/alexissweet/Workspaces/Workspaces1/build-Debug

Regards,

David


Re: Newbie help: No such file or directory found

Posted: Tue Jun 13, 2023 6:55 pm
by sweetac01

David,

Thanks for your response. I added that, but am still getting the same error. What should I try next?


Re: Newbie help: No such file or directory found

Posted: Tue Jun 13, 2023 7:44 pm
by DavidGH

What should I try next?

That's hard to say.
I suggest you paste here the relevant bits of your Project Settings General, Compiler and Linker tabs.

You could also try adding, to your Environment > Additional environment variables field
LD_LIBRARY_PATH=/Users/alexissweet/Workspaces/Workspaces1/build-Debug/lib

Alternatively you could create a new Project, but this time putting everything in /Users/alexissweet/Workspaces/Workspaces1 (or wherever the new project actually is). Make sure when you create that project, the you set the top field, PATH:, correctly.