简体   繁体   English

无法在 JGrasp 中编译 C++

[英]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 上用 C++ 编译一个简单的 Hello World 程序,但出现以下错误

 ----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.我想 jGrasp 由于缺少 -lfreeglut 而无法编译程序。 But I am unable to find any mention of it on the internet.但我无法在互联网上找到任何提及。

Compiler cant find -lfreeglut, its could be cause two reasons:编译器找不到-lfreeglut,可能有两个原因:

  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它不在libs路径上,然后你必须将它安装在libs路径上,或者告诉C++编译器这个lib在哪里,你可以像-L /pathToLib一样

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM