Title: NetBeans C++: Linker Can't Find External Libraries Specified in Linker Options
Tags: c++;mingw;linker-errors;netbeans-8
Question: I've been trying to learn how to use NetBeans as a C++ development environment. I installed NetBeans 8.2, installed MinGW, and compiled a simple Hello World program to make sure everything works. I then decided to try to compiler an old OpenGL project (based on this tutorial) that I had up-and-running in Visual Studio. Unfortunately, I keep getting errors saying the linker can't find the glew32 or glut32 library files:

```c:/mingw/bin/../lib/gcc/mingw32/5.3.0/../../../../mingw32/bin/ld.exe: cannot find -lglew32
c:/mingw/bin/../lib/gcc/mingw32/5.3.0/../../../../mingw32/bin/ld.exe: cannot find -lglut32
```

As best as I can tell, however, I've set all of the necessary linker options;
screen-shot here.

What am I missing here?



My project's compile command as stated in the output pane:

```g++ -o dist/Debug/MinGW32-Windows/opengl_tutorial build/Debug/MinGW32-Windows/nbproject/Main.o build/Debug/MinGW32-Windows/nbproject/ReadTGA.o -L\"C\:/C++\ Libraries/glew-1.13.0/lib/Release/Win32\" -L\"C\:/MinGW/lib\" -L\"C\:/C++\ Libraries/glut-3.7/lib\" -lglew32 -lglut32 -lglu32 -lopengl32
```



Things I've Tried


Removing spaces from external libraries' file path.
Placing .lib files in MinGW's lib folder (this gets rid of the original error and results in a slew of undefined reference errors).
Adding each library's bin folder to the Aditional Library Directories list and adding the DLLs to the Libraries list.
Switching between putting the file paths in the Aditional Library Directories list in quotes and not putting them in quotes (without quotes I get undefined reference errors).


Additional System Information


Operating System: Windows 7 Home Premium 64-bit SP1
Processor: 2GHz Intel Pentium Dual-Core




Here is another answer: Try Adding environmental variables in
Properties-&gt;Run-&gt;Environment
In my case
Name=LD_LIBRARY_PATH
Value=/usr/local/apps/Java/jdk-14/lib:/usr/local/apps/root6.22.02Install/lib/root:/Work/Soft/general_classes/lib (and some more paths which no need to be pasted here)


{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2016:00:12/22/16', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<c++><mingw><linker-errors><netbeans-8>', 'Title': "NetBeans C++: Linker Can't Find External Libraries Specified in Linker Options", 'ViewCount': 359, 'id': 41273980, 'user_AboutMe': "<p>I'm a computer game programmer by trade.  Much of my spare time is spent researching how game engines work and developing one of my own.</p>\n", 'user_AccountId': 5263958.0, 'user_DisplayName': 'Vitamin C Plus Plus', 'user_Reputation': 11.0, 'user_Views': 3.0, 'user_id': 4204592.0}}