Giter Club home page Giter Club logo

Comments (16)

Yamo406 avatar Yamo406 commented on June 25, 2024 1

Awesome thanks for taking the time to solve the problem and answer my questions.

from vscode-cpptools.

dheerajparashar avatar dheerajparashar commented on June 25, 2024 1

Thanks mate I will try this and let you know what happens.

from vscode-cpptools.

browntarik avatar browntarik commented on June 25, 2024

Could you please provide more information about how you are getting this error? It is likely that you have not correctly configured your task.json with the appropriate arguments.

Example:
image

from vscode-cpptools.

Yamo406 avatar Yamo406 commented on June 25, 2024

I haven't modified the tasks.json I let the extension do it automatically for me. here is a screenshot of the tasks.json
Screenshot_20240207_130246

I am not sure, maybe it has something to do with me using Linux or the path of the file is not detected.

from vscode-cpptools.

browntarik avatar browntarik commented on June 25, 2024

Can you provide the output from the error window including the command that is generated by the run and debug command?

Example:
image

from vscode-cpptools.

Yamo406 avatar Yamo406 commented on June 25, 2024

@browntarik sorry for the late reply.
image

from vscode-cpptools.

browntarik avatar browntarik commented on June 25, 2024

It looks like there is an issue because of the '&' character in your path. Could you try renaming your directory to remove it and try the executable again?

If you would like to keep the ampersand you may have to escape it in the file path, but it is generally not recommended practice to use special characters in file paths.

from vscode-cpptools.

Yamo406 avatar Yamo406 commented on June 25, 2024

@browntarik so it worked when I indeed changed the ampersand character, I have another question when I use the the GCC from the dropdown it doesn't work, that's on a different directory but the g++ works as intended, does that have to do with Linux?

Here are the errors:
Screenshot_20240212_211748
Screenshot_20240212_211801

from vscode-cpptools.

Yamo406 avatar Yamo406 commented on June 25, 2024

Here are as well the dropdown menu in case you need it:

Screenshot_20240212_212104

from vscode-cpptools.

browntarik avatar browntarik commented on June 25, 2024

Based on the error you showed me (i.e undefined reference to std::cout) I would guess that you are trying to use the gcc compiler to build a c++ project, please try using the g++ compiler instead.

from vscode-cpptools.

Yamo406 avatar Yamo406 commented on June 25, 2024

The g++ compiler works just fine.
If I understand correctly the gcc is for c projects and g++ for c++ projects?

from vscode-cpptools.

browntarik avatar browntarik commented on June 25, 2024

Yes, that is generally the case. You could use explicit linking if you have a specific reason to use gcc. To use explicit linking just add the -lstdc++ to your list of arguments though it is recommended you just use g++.

from vscode-cpptools.

browntarik avatar browntarik commented on June 25, 2024

I am glad I was able to help, I will now close this issue but it will be available for future reference.

from vscode-cpptools.

dheerajparashar avatar dheerajparashar commented on June 25, 2024

Hello there, I am facing the same error but on my Windows laptop.
image

from vscode-cpptools.

dheerajparashar avatar dheerajparashar commented on June 25, 2024

Could you please help?

from vscode-cpptools.

Yamo406 avatar Yamo406 commented on June 25, 2024

@dheerajparashar Hey there, it seems that in your case it's giving permission denied, I would have 2 solutions that I would try first.

  1. change the location of the project.
  2. change the permission of the folder.

The easiest is to change the project's location as it can be tedious to change the permission of the folder especially since it's in the C: folder and I haven't been having that much luck with permissions on Windows.

from vscode-cpptools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.