#Need help with debug file

27 messages · Page 1 of 1 (latest)

hallow elm
#

When I press "Debug C/C++ file" I get this long error code:

clang: error: linker command failed with exit code 1 (use -v to see invocation)

and when having modified my code it also gives that error, does someone know how I can fix this? (Note: I use Clang since I am working on a Macbook)

fresh impBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

hallow elm
#

Need help with debug file

#

I just started using visual studio code so I have no idea how I can fix this

granite timber
#

look at the build log

#

it should contain more information

hallow elm
#

where can I find the build log?

#

sorry if these are dumb questions, I just started working with code

granite timber
#

in the output window at the bottom I assume

#

how did you configure the build?

hallow elm
#

what do you mean?

granite timber
#

you'll have had to write a tasks.json, launch.json, and c_cpp_properties.json

#

no?

hallow elm
granite timber
#

are you using clang instead of clang++?

hallow elm
granite timber
#

you'll want to use clang++ for C++, not clang

hallow elm
#

oh okay

granite timber
#

btw, if you're on mac, consider using Xcode instead of vscode

hallow elm
#

Oh okay

#

first I'll have to do a bit of updating though

#

haven't updated my macbook the last 2 years

hollow dome
#

the error you shared means the linker can't find the std library

#

I don't use mac, but probably the path to solve is to understand how mac searches for the std library on your system when compiling it with clang, I assume there will be default paths it searches for and if it can't find the std on them it throws the error

granite timber