K S M
K S M

Reputation: 21

Unable to compile of C++ in JGrasp

I am trying to compile a simple Hello World program in C++ on jGrasp but I am getting the following error

 ----jGRASP exec: g++ -g -o jGHello.exe jGHello.cpp -lglu32 -lfreeglut -lopengl32
c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: cannot find -lfreeglut
collect2.exe: error: ld returned 1 exit status

 ----jGRASP wedge2: exit code for process is 1.
 ----jGRASP: operation complete.

I suppose that jGrasp is unable to compile the program due to -lfreeglut being missing. But I am unable to find any mention of it on the internet.

Upvotes: 0

Views: 272

Answers (1)

Luis Bote
Luis Bote

Reputation: 169

Compiler cant find -lfreeglut, its could be cause two reasons:

  1. It doesnt exits (look if its already install)

  2. Its not on libs path, then u ve to install it on libs path, or tell C++ compiler where is this lib, u can do it like -L /pathToLib

Ej: g++ -g -o jGHello.exe jGHello.cpp -lglu32 -lfreeglut -lopengl32 -L /pathToLib

Upvotes: 1

Related Questions