raltok
raltok

Reputation: 11

error: collect2: error: ld returned 1 exit status CS106B Stanford Qt Creator

I am new to C++ and I have just started the CS106B course of Stanford with their online resources.

I am currently using Ubuntu and when I try to build the sample-project in Qt Creator I get the following issue

error: collect2: error: ld returned 1 exit status

On my compile output I get the following:

/usr/bin/x86_64-linux-gnu-ld: cannot find -lGL
Makefile:426: recipe for target 'sample-project' failed
collect2: error: ld returned 1 exit status
make: *** [sample-project] Error 1
14:29:38: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project sample-project (kit: Desktop Qt 5.11.1 GCC 64bit)
When executing step "Make"

Any help is super appreciated

Upvotes: 1

Views: 293

Answers (1)

Arman Novikov
Arman Novikov

Reputation: 46

I've challenged the same problem. Try this:

  • open terminal
  • input cmd: sudo apt-get install build-essential libgl1-mesa-dev
  • press 'y'

This solved my problem.

Best regards.

Upvotes: 1

Related Questions