It does not work(Eror:undefined reference to `InitWindow’)

Hello, I really like yours, but it bothers me that right from the beginning my text editor reports an error, undefined reference to “InitWindow”.I followed all the steps of your course, I don’t know what I did wrong.

Thank you for your help in advance.

Apologies for the late reply, seems like this thread got sent to the wrong section of the forums with missing tags.

That said, make sure you’re going to Terminal > Run Task and selecting Build Debug as your build task. This runs through our created makefile and links the raylib library to your project so the compiler knows how to handle it. G++ on its own will not know about raylib’s existence.

I followed the instructions and it still doesn’t work

The ‘w’ needs to be capitalized in InitWindow (can’t believe I didn’t catch this sooner, my initial suggestion is still necessary, though)

Thank you for the quick reply, but I have no idea what I could be doing wrong there.

The good news here is that is the output you should expect when you have a successful build/compile! We never figured out why Stephen’s output is different, though.

I found that if I run it through the exe file it works as expected but I can’t run it through vscode and I keep getting the error message about the JSON file.

I noticed you have a large number of extensions installed/enabled. Can you try disabling all of your extensions except for the C/C++ Extension? Just to help eliminate conflicts with other extensions.

Additionally, it’s possible that the launch.json file has been modified and the launch options don’t align with what we had in the template. The easiest way to deal with this is to copy the launch.json file from a fresh copy of the template project over to your current project.

Thanks a lot, it’s up and running as it should, I just had to rename it to main.cpp

Awesome, I’m glad we got you up and running!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms