Setting up OpenGL on NetBeans in Window - c++

I'm trying to set up OpenGL in Netbeans 8.1. I have installed MinGW as C++ compiler and it works.
I want to use GLEW and GLFW libraries so I have downloaded them and I have created a include folder where I have stored all the .h files and a libs folder where I have stored the glew32.lib and glfw3.lib. I have included in NetBeans the include folder by setting
Project Properties > Build > C ++ Compiler > Include Directories
and I have included in NetBeans the bin folder by setting
Project Properties > Build > Linker > Libraries
Then in my main.cpp file I have inserted the include for GLEW and GLFW, but when I execute mi file this get me this output error
cd 'D:\Documenti\NetBeansProjects\Test'
C:\MinGW\msys\1.0\bin\make.exe -f Makefile CONF=Debug
"/C/MinGW/msys/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make.exe[1]: Entering directory `/d/Documenti/NetBeansProjects/Test'
"/C/MinGW/msys/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk dist/Debug/MinGW-Windows/test.exe
make.exe[2]: Entering directory `/d/Documenti/NetBeansProjects/Test'
mkdir -p dist/Debug/MinGW-Windows
g++ -o dist/Debug/MinGW-Windows/test build/Debug/MinGW-Windows/main.o -l glew32 -lglfw3
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find -lglew32
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find -lglfw3
collect2.exe: error: ld returned 1 exit status
make.exe[2]: *** [dist/Debug/MinGW-Windows/test.exe] Error 1
make.exe[2]: Leaving directory `/d/Documenti/NetBeansProjects/Test'
make.exe[1]: *** [.build-conf] Error 2
make.exe[1]: Leaving directory `/d/Documenti/NetBeansProjects/Test'
make.exe": *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 1s)
Does anyone know how to solve this problem?

The linker can't find your libraries because you didn't tell NetBeans a directory where they are stored. Please go to:
Project Properties -> Linker -> Additional Library Directories
and add this directory to your NetBeans project. After that you'll see the additional linker option -L<path> when you compile/link.

Related

C++ application failing to build with 'cannot find -lmysqlpp' but it appears to be there

I'm trying to build an application with Netbeans and getting the following error:
/usr/bin/ld: cannot find -lmysqlpp
I believe this exists as per the below screen shots;
and here in my includes from Netbeans;
The below is the full output from Netbeans;
cd '/media/psf/DL/DL_src/FEC_src/docugirl'
/usr/bin/make -f Makefile CONF=Debug
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory '/media/psf/DL/DL_src/FEC_src/docugirl'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk /app/bin/docugirl
make[2]: Entering directory '/media/psf/DL/DL_src/FEC_src/docugirl'
mkdir -p /app/bin
g++ -o /app/bin/docugirl build/Debug/GNU-Linux/docugirl.o -lm -lpthread /pcli/library/libcore.a /pcli/library/libsdd.a -lmysqlpp
/usr/bin/ld: cannot find -lmysqlpp
collect2: error: ld returned 1 exit status
make[2]: *** [nbproject/Makefile-Debug.mk:67: /app/bin/docugirl] Error 1
make[2]: Leaving directory '/media/psf/DL/DL_src/FEC_src/docugirl'
make[1]: *** [nbproject/Makefile-Debug.mk:59: .build-conf] Error 2
make[1]: Leaving directory '/media/psf/DL/DL_src/FEC_src/docugirl'
make: *** [nbproject/Makefile-impl.mk:40: .build-impl] Error 2
BUILD FAILED (exit value 2, total time: 472ms)
For completeness, the source exists on a remote Debian server (as has previous successfully created and built mysql type applications).
So, I'm a little confused, I thought and assumed that I had the necessary mysql stuff in order to build this, I am able to build other mysql applications with this setup. Is this mysqlpp different/additional to the /usr/include/mysql and /usr/include/mysql++?
The /usr/include/mysql links to /usr/include/mariadb
Any help would be greatly appreciated here, thanks in advance...
#HEKTO This was indeed the problem but it seemed that the current release of Debian (10.5) did not include the libmysql++-dev package, the reasons for which are as yet unknown to me and although I had copied the mysql++ header files across, the libmysqlpp.so was indeed not there. In this instance, I resorted to using a previous release, although I believe the next release will include this.
See here: https://packages.debian.org/stretch/libmysql++-dev

Xerces no library found after install

I'm trying to run Xerces on Mac. I us
./configure CFLAGS="-arch x86_64" CXXFLAGS="-arch x86_64"
./configure --prefix=/opt
sudo make (this builds the library)
sudo make install (this installs the library)
I also include the libxerces-c.dylib on linker in NetBeans
Here is the error
"/Applications/Xcode.app/Contents/Developer/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
"/Applications/Xcode.app/Contents/Developer/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/GNU-MacOSX/xerces
mkdir -p build/Debug/GNU-MacOSX/_ext/619588065
rm -f "build/Debug/GNU-MacOSX/_ext/619588065/SAXCount.o.d"
g++ -c -g -I/opt/lib/libxerces-c.dylib -MMD -MP -MF "build/Debug/GNU-MacOSX/_ext/619588065/SAXCount.o.d" -o build/Debug/GNU-MacOSX/_ext/619588065/SAXCount.o ../../Documents/xerces-c-3.1.2/samples/src/SAXCount/SAXCount.cpp
In file included from ../../Documents/xerces-c-3.1.2/samples/src/SAXCount/SAXCount.cpp:26:
../../Documents/xerces-c-3.1.2/samples/src/SAXCount/SAXCount.hpp:26:10: fatal error: 'xercesc/util/PlatformUtils.hpp' file not found
#include <xercesc/util/PlatformUtils.hpp>
^
1 error generated.
make[2]: *** [build/Debug/GNU-MacOSX/_ext/619588065/SAXCount.o] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 128ms)
Any idea how to fix this??
Thanks!
Select Project in projects window.
Right-click for pop-up menu.
Select Properties in pop-up menu.
Select C++ Compiler under Build in Categories list on the left side of dialog.
Add a directory to Include Directories. The new directory should have PlatformUtils.hpp in the xercesc/util/ subdirectory of that directory. From your options I am guessing /opt/include/
Update
To Resolve
ld: library not found for -lxerces-c
Select Linker under Build in Categories list on the left side of dialog.
Add the directory containing libxerces-c.dylib and/or libxerces-c.a which appears to be /opt/lib/ to Additional Library Directories field.

run error using MinGW with netbeans 7.3.1

I Installed MinGW and i'm using it with netbeans. However when i try to run a simple "Hello world" programm it gives me the following error:
"/C/msys/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build- conf
make.exe[1]: Entering directory `/c/Users/Notandi/Documents/NetBeansProjects/somegame'
"/C/msys/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk dist/Debug/MinGW_1- Windows/somegame.exe
make.exe[2]: Entering directory `/c/Users/Notandi/Documents/NetBeansProjects/somegame'
mkdir -p dist/Debug/MinGW_1-Windows
g++ -o dist/Debug/MinGW_1-Windows/somegame build/Debug/MinGW_1-Windows/main.o - lmingw32 -lSDL2main -lSDL2.dll
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot open output file dist/Debug/MinGW_1-Windows/somegame.exe: Permission denied
collect2.exe: error: ld returned 1 exit status
make.exe[2]: *** [dist/Debug/MinGW_1-Windows/somegame.exe] Error 1
make.exe[2]: Leaving directory `/c/Users/Notandi/Documents/NetBeansProjects/somegame'
make.exe[1]: *** [.build-conf] Error 2
make.exe[1]: Leaving directory `/c/Users/Notandi/Documents/NetBeansProjects/somegame'
make.exe": *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 3s)
I have checked if the program is running in background, but it isn't.
im using windows 64bit and using MinGW for c++.
I simply configured NetBeans to use MinGW and faced the same inconveniences, but soon simply
decided to use NetBeans with "Run as an administrator", which helped (and so even made "Run as an administrator" unnecessary in further runs). And on a next week I can reinstall MinGW + MSYS in another manner. I'm citing:
The NetBeans IDE might have issues when you try to build and run projects later if MSYS is installed under a limited user account

Netbeans C/C not compiling

I installed the NetBeans IDE 7.3.1 almost a week ago and still haven't been able to get it to compile anything.
I'm using the Cygwin's compiler for C/C++, and I get the following error message for a simple "Hello World" program:
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory `/cygdrive/c/Users/CaptFuzzyboots/Documents/NetBeansProjects/Hello World'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/Cygwin_1-Windows/hello_world.exe
make[2]: Entering directory `/cygdrive/c/Users/CaptFuzzyboots/Documents/NetBeansProjects/Hello World'
mkdir -p build/Debug/Cygwin_1-Windows
rm -f build/Debug/Cygwin_1-Windows/main.o.d
gcc -c -g -MMD -MP -MF build/Debug/Cygwin_1-Windows/main.o.d -o build/Debug/Cygwin_1-Windows/main.o main.c
make[2]: gcc: Command not found
nbproject/Makefile-Debug.mk:66: recipe for target `build/Debug/Cygwin_1-Windows/main.o' failed
make[2]: *** [build/Debug/Cygwin_1-Windows/main.o] Error 127
make[2]: Leaving directory `/cygdrive/c/Users/CaptFuzzyboots/Documents/NetBeansProjects/Hello World'
nbproject/Makefile-Debug.mk:59: recipe for target `.build-conf' failed
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory `/cygdrive/c/Users/CaptFuzzyboots/Documents/NetBeansProjects/Hello World'
nbproject/Makefile-impl.mk:39: recipe for target `.build-impl' failed
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 472ms)
EDIT
I fixed this by just making a new toolkit and adding the base directory as Cygwin -> bin.
The problem now is that I keep getting
Unable to start pty process
gcc: Command not found
You should check whether you have installed gcc (plus gdb and make)
via MinGW:
MinGW+NetBeans (just look at the screenshots, you don't have to understand Hungarian)
via Cygwin:
http://www.eecg.utoronto.ca/~aamodt/ece242/cygwin.html
You should also check whether paths are correct in NetBeans:
Tools > Options > C/C++ > Build Tools:
(At the time of creating the screenshot, I had MinGW installed in C:\Programs\MinGW, BUT if you have it installed in C:\MinGW (which is the default), this correct, too! The only important thing is that you should install MinGW in a path which doesn't contain whitespaces.)
This is what it looks like when paths are incorrect, letters are red:
Note: I have MinGW installed, but it doesn't change the fact that you should check whether YOUR paths are correct.
You should also take care the right Configuration is selected in project Properties (right click on project) > Build - The right "Tool collection" has to be selected (on which the paths above are correct):
Unable to start pty process
Related answer: Can build, but can't run C code in netbeans (but it works in command line)
So right click on the project, Properties > Run > Console Type > External Terminal (instead of e.g. "Internal Terminal"). Here is a screenshot:
Here is your problem:
gcc: Command not found
Cygwin is not a compiler, it's a unix-like environment for Windows. Gcc is the compiler. You have to install gcc with Cygwin before it will work.

Cannot Compile "Hello World" in NetBeans IDE 7.3 with MinGW C++

I'm trying to make a simple "Hello World!" program in NetBeans IDE 7.3 with MinGW as my C++ compiler.
I'm getting build failures and I'm at a loss as to understanding why.
This is my compiler setup:
Family: MinGW
Base Directory: C:\MinGW
C Compiler: C:\MinGW\bin\gcc.exe
C++ Compiler: C:\MinGW\bin\g++.exe
Assembler: C:\MinGW\bin\as.exe
Make Command: C:\MinGW\msys\1.0\bin\make.exe
Debugger Command: C:\MinGW\bin\gdb.exe
I've made sure to that my environment PATH directs to C:\MinGW\bin and C:\MinGW\msys\1.0\bin.
My code is:
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World!" << endl;
return 0;
}
After trying to build the project, I recieve this message from the NetBeans debug output:
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory `/c/NetBeansProjects/HelloWorld'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/MinGW-Windows/helloworld.exe
make[2]: Entering directory `/c/NetBeansProjects/HelloWorld'
mkdir -p build/Debug/MinGW-Windows
rm -f build/Debug/MinGW-Windows/main.o.d
g++ -c -g -MMD -MP -MF build/Debug/MinGW-Windows/main.o.d -o build/Debug/MinGW-Windows/main.o main.cpp
make[2]: g++: Command not found
make[2]: *** [build/Debug/MinGW-Windows/main.o] Error 127
make[2]: Leaving directory `/c/NetBeansProjects/HelloWorld'
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory `/c/NetBeansProjects/HelloWorld'
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 1s)
I've search various Q&A, but I seem to be doing everything correctly.
Right click on My Computer and select properties. Click Advanced System Settings.System Properties dialog box will open. click Environmental Variables. Edit PATH variable and add C:\MinGW\msys\1.0\bin
Your settings on netbeans shoud be as follows
Base Directory: C:\MinGW\bin
C Compiler: C:\MinGW\bin\gcc.exe
C++ Compiler: C:\MinGW\bin\g++.exe
Fortran Compiler: C:\MinGW\bin\gfortran.exe
Assembler: C:\MinGW\bin\as.exe
Make Command: C:\MinGW\msys\1.0\bin\make.exe
Debbuger Command: C:\MinGW\bin\gdb.exe
Add these to your Environment variables
C:\MinGW\bin and C:\MinGW\msys\1.0\bin
This can happen if you have set the settings on netbeans before/during the time of installing MINGW and setting the environment PATH.
Just restart netbeans
you download mysys form mingw or sourceforge.net after install it, path is C:\Mysys\1.0\bin\make.exe to give the path into make compiler in netbean ide.