GLFW Can't compile example netbeans mingw w64 - c++

I used the precompiled version of GLFW for windows. I use netbeans and i can't resolve this error.
"/E/Develop/Util/msys/bin/make.exe" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make.exe[1]: Entering directory `/e/Develop/Project/Netbeans/C++/CppApplication_1'
"/E/Develop/Util/msys/bin/make.exe" -f nbproject/Makefile-Debug.mk dist/Debug/MinGW-w64_x64_-posix-seh-Windows/cppapplication_1.exe
make.exe[2]: Entering directory `/e/Develop/Project/Netbeans/C++/CppApplication_1'
mkdir -p build/Debug/MinGW-w64_x64_-posix-seh-Windows
rm -f "build/Debug/MinGW-w64_x64_-posix-seh-Windows/main.o.d"
g++ -c -g -I/E/Develop/Library/C++/GLFW\ 3.0.4/include -MMD -MP -MF "build/Debug/MinGW-w64_x64_-posix-seh-Windows/main.o.d" -o build/Debug/MinGW-w64_x64_-posix-seh-Windows/main.o main.cpp
mkdir -p dist/Debug/MinGW-w64_x64_-posix-seh-Windows
g++ -o dist/Debug/MinGW-w64_x64_-posix-seh-Windows/cppapplication_1 build/Debug/MinGW-w64_x64_-posix-seh-Windows/main.o -L../../../../Library/C++/GLFW\ 3.0.4/lib-mingw -L../../../../Compiler/C++/MinGW-w64\(x64\)-posix-seh/x86_64-w64-mingw32/lib -lglfw3 -lglfw3dll
e:/Develop/Compiler/C++/MinGW-w64(x64)-posix-seh/bin/../lib/gcc/x86_64-w64-mingw32/4.9.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lglfw3dll
collect2.exe: error: ld returned 1 exit status
make.exe[2]: *** [dist/Debug/MinGW-w64_x64_-posix-seh-Windows/cppapplication_1.exe] Error 1
make.exe[2]: Leaving directory `/e/Develop/Project/Netbeans/C++/CppApplication_1'
make.exe[1]: *** [.build-conf] Error 2
make.exe[1]: Leaving directory `/e/Develop/Project/Netbeans/C++/CppApplication_1' make.exe": *** [.build-impl] Error 2
i add the directory and linked the Libraries like this
this is the code
how can i fix this?

The GLFW has two versions of libraries - static and dynamic (DLL). If you want to link with the static library, then you won't have to include the glfw3dll (which is a DLL link library) into the list of libraries. Please see the Building programs that use GLFW for more info. They also mention other libraries you need to link to.

Related

Setting up Netbeans with GMP, how to specify compile options?

I'm trying to use GMP in Netbeans on Windows. The build fails giving the output:
cd 'C:\Users\dev1\Documents\NetBeansProjects\Simple 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 `/c/Users/dev1/Documents/NetBeansProjects/Simple Test'
"/C/MinGW/msys/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk dist/Debug/MinGW-Windows/simple_test.exe
make.exe[2]: Entering directory `/c/Users/dev1/Documents/NetBeansProjects/Simple Test'
mkdir -p dist/Debug/MinGW-Windows
g++ -o dist/Debug/MinGW-Windows/simple_test build/Debug/MinGW-Windows/main.o
build/Debug/MinGW-Windows/main.o: In function `ZN17__gmp_binary_plus4evalEP12__mpz_structPKS0_m':
c:/mingw/include/gmpxx.h:196: undefined reference to `__gmpz_add_ui'
build/Debug/MinGW-Windows/main.o: In function
c:/mingw/include/gmpxx.h:1497: undefined reference to `__gmpz_init'
//...same thing
collect2.exe: error: ld returned 1 exit status
make.exe[2]: *** [dist/Debug/MinGW-Windows/simple_test.exe] Error 1
make.exe[2]: Leaving directory `/c/Users/dev1/Documents/NetBeansProjects/Simple Test'
make.exe[1]: *** [.build-conf] Error 2
make.exe[1]: Leaving directory `/c/Users/dev1/Documents/NetBeansProjects/Simple Test'
make.exe": *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 2s)
Here are the settings I changed in Netbeans and guess where the error lies
How can I get GMP to work so I can use it in my source code?
It's definitely a setting on Netbeans as I can compile it from the command line with g++ test.cpp -o test.exe -lgmpxx -lgmp
Got this answer from mathGl / MinGW undefined reference Netbeans IDE
right click on project and go to properties
in the left pane select linker
click the "..." beside libraries
click "add option"
select "other option" and type in -lgmpxx -lgmp
click ok
Should now see...

opengl cannot find libraries in mingw compiler netbeans

cd 'C:\Users\Deepa\Documents\NetBeansProjects\game' 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 `/c/Users/Deepa/Documents/NetBeansProjects/game' "/C/MinGW/msys/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk dist/Debug/MinGW-Windows/game.exe
make.exe[2]: Entering directory `/c/Users/Deepa/Documents/NetBeansProjects/game'
mkdir -p build/Debug/MinGW-Windows
g++ -c -g -s -o build/Debug/MinGW-Windows/main.o main.cpp
mkdir -p dist/Debug/MinGW-Windows
g++ -o dist/Debug/MinGW-Windows/game build/Debug/MinGW-Windows/main.o -lglew32 -lglew32s -lglut32
/usr/lib/gcc/x86_64-pc-cygwin/7.3.0/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lglew32s
/usr/lib/gcc/x86_64-pc-cygwin/7.3.0/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lglut32
collect2: error: ld returned 1 exit status
make.exe[2]: *** [dist/Debug/MinGW-Windows/game.exe] Error 1
make.exe[2]: Leaving directory `/c/Users/Deepa/Documents/NetBeansProjects/game'
make.exe[1]: *** [.build-conf] Error 2
make.exe[1]: Leaving directory `/c/Users/Deepa/Documents/NetBeansProjects/game'
make.exe": *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 6s)
im using a minGW compiler but " /usr/lib/gcc/x86_64-pc-cygwin/7.3.0/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lglew32s " it seems to be in cygwin..
why is it so? and i cant build the file help please

No rule to make target `glfw3.dll'

I'm trying to build a simple vulkan example with Netbeans 8.0.2 using MinGW64 5.3.0. But for some reason, it doesn't seem to want to find the glf3.dll file even though the dependency locations and file names have been specified in the linker options.
Error message:
C:\Tools\MinGW\msys\1.0\bin\make.exe -f Makefile CONF=Debug
"/C/Tools/MinGW/msys/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make.exe[1]: Entering directory `/c/Users/gkovalechyn/Documents/NetBeansProjects/VulkanTests'
"/C/Tools/MinGW/msys/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk dist/Debug/MinGW_64-Windows/vulkantests.exe
make.exe[2]: Entering directory `/c/Users/gkovalechyn/Documents/NetBeansProjects/VulkanTests'
mkdir -p build/Debug/MinGW_64-Windows
rm -f "build/Debug/MinGW_64-Windows/main.o.d"
g++ -m64 -std=c++11 -c -g -I../../../../../Libraries/glm -I../../../../../Libraries/glfw-3.2.bin.WIN64/include -I../../../../../Tools/VulkanSDK/1.0.17.0/Include -MMD -MP -MF "build/Debug/MinGW_64-Windows/main.o.d" -o build/Debug/MinGW_64-Windows/main.o main.cpp
make.exe[2]: *** No rule to make target `glfw3.dll', needed by `dist/Debug/MinGW_64-Windows/vulkantests.exe'. Stop.
make.exe[2]: Leaving directory `/c/Users/gkovalechyn/Documents/NetBeansProjects/VulkanTests'
make.exe[1]: *** [.build-conf] Error 2
make.exe[1]: Leaving directory `/c/Users/gkovalechyn/Documents/NetBeansProjects/VulkanTests'
make.exe": *** [.build-impl] Error 2
Linker settings:
Proof that the DLL exists in that folder:
Solved it myself. I had to tell Netbeans the exact path to the libraries instead of adding them as additional dependencies.
So basically, go to the project properties, Build -> Linker -> Libraries. From there add the libraries FILES, not the library and it should work.

Using gcc with Netbeans

I want to learn to use shaders and therefore created a new C++ project on Netbeans (ver. 8.0.2).
I want to include the GLFW and the GLEW Library like stated in this tutorial: http://www.learnopengl.com/#!Getting-started/Creating-a-window
I think i included the librarys successfully. (Netbeans shows no error when using #include <GL\glew.h> or #include <GLFW\glfw3.h>, so i think it finds all the files).
My System: Windows 10 x64, using GNU gcc compiler via cygwin
Now here is the problem:
When i try to run the program, there is the following output:
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory '/cygdrive/c/Users/Erik/programming/projects/FinallyShaders'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/Cygwin-Windows/finallyshaders.exe
make[2]: Entering directory '/cygdrive/c/Users/Erik/programming/projects/FinallyShaders'
mkdir -p build/Debug/Cygwin-Windows
rm -f "build/Debug/Cygwin-Windows/main.o.d"
gcc -c -g -include /cygdrive/C/Users/Erik/programming/Libraries/glew-1.13.0-win32/glew-1.13.0/include/GL -include /cygdrive/C/Users/Erik/programming/Libraries/glfw-3.1.2.bin.WIN32/glfw-3.1.2.bin.WIN32/include/GLFW -MMD -MP -MF "build/Debug/Cygwin-Windows/main.o.d" -o build/Debug/Cygwin-Windows/main.o main.c
cc1: fatal error: /cygdrive/C/Users/Erik/programming/Libraries/glew-1.13.0-win32/glew-1.13.0/include/GL: No such file or directory
compilation terminated.
nbproject/Makefile-Debug.mk:66: recipe for target 'build/Debug/Cygwin-Windows/main.o' failed
make[2]: *** [build/Debug/Cygwin-Windows/main.o] Error 1
make[2]: Leaving directory '/cygdrive/c/Users/Erik/programming/projects/FinallyShaders'
nbproject/Makefile-Debug.mk:59: recipe for target '.build-conf' failed
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory '/cygdrive/c/Users/Erik/programming/projects/FinallyShaders'
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 722ms)
It seems to fail because the gcc compiler (or more precisely the cc1 part of it) can't find the include-directory for the library. But, as stated, the path is correct. When using cd <the path that cannot be found> everything works and cygwin finds this path.
(My program does nothing but calling printf() until now, that shouldn't be the problem)
Does anybody know what this could mean and how to solve this?
Thanks for your help
Erik Brendel
Your failing compiler commandline is:
gcc -c -g \
-include /cygdrive/C/Users/Erik/programming/Libraries/glew-1.13.0-win32/glew-1.13.0/include/GL \
-include /cygdrive/C/Users/Erik/programming/Libraries/glfw-3.1.2.bin.WIN32/glfw-3.1.2.bin.WIN32/include/GLFW \
-MMD -MP -MF "build/Debug/Cygwin-Windows/main.o.d" \
-o build/Debug/Cygwin-Windows/main.o main.c
To fix the reported error:
cc1: fatal error: /cygdrive/C/Users/Erik/programming/Libraries/glew-1.13.0-win32/glew-1.13.0/include/GL: No such file or directory
it should be:
gcc -c -g \
-I/cygdrive/C/Users/Erik/programming/Libraries/glew-1.13.0-win32/glew-1.13.0/include/GL \
-I/cygdrive/C/Users/Erik/programming/Libraries/glfw-3.1.2.bin.WIN32/glfw-3.1.2.bin.WIN32/include/GLFW \
-MMD -MP -MF "build/Debug/Cygwin-Windows/main.o.d" \
-o build/Debug/Cygwin-Windows/main.o main.c
You have confused the compiler options -include and -I. See the documentation of
these options
Here is a pretty good introductory tutorial to the use of GCC
In the Netbeans project properties, the include search-directories should be
entered in Build -> C Compiler -> Include Directories, not Include Headers.
Are you configuring the proyect linker for Netbeans?? This means telling the IDE you will be using libraries that are not added by default with just the include command, for example the math.h library(remember you had to compile with -lm via command promp, it's the same thing).
This can be done by going to run-proyect configuration-customize-Linker-Libraries(you click on the button with says ...).
Then you click on add pkgconfig library or standard(for something like math.h or pthread in unix systems), and search for the library you wish to add.

netbeans mysql connector No such file or directory (MinGW)

i try to link mysql-connector 1.1.3 in Netbeans (7.3, Windows 7) with Mingw-Compiler to my c++ Project.
In the project properties i have add all mysql-connector directories (include, lib, cppcon) under "included Directorys" and under Linker "Additionell Linker Directorys". I added the boost libs to.
But in the Compiler Output say always:
fatal error: mysql_connection.h: No such file or directory
Sorry for my poor english and thanks for help...
the complete output:
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory /cygdrive/c/Users/Toni/Desktop/dev/Wiesel/new/tests/sql_test2'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/MinGW-Windows/sql_test2.exe
make[2]: Entering directory/cygdrive/c/Users/Toni/Desktop/dev/Wiesel/new/tests/sql_test2'
mkdir -p build/Debug/MinGW-Windows
rm -f build/Debug/MinGW-Windows/main.o.d
g++ -c -g -I/D/libs/mysql-connector-c++-noinstall-1.1.3-win32 -I/D/libs/mysql-connector-c++-noinstall-1.1.3-win32/include -I/D/libs/mysql-connector-c++-noinstall-1.1.3-win32/include/cppconn -I/D/libs/mysql-connector-c++-noinstall-1.1.3-win32/lib -I/D/libs/boost_1_53_0 -I/D/libs/boost_1_53_0/boost -I/D/libs/boost_1_53_0/libs -MMD -MP -MF build/Debug/MinGW-Windows/main.o.d -o build/Debug/MinGW-Windows/main.o main.cpp
main.cpp:9:30: fatal error: mysql_connection.h: No such file or directory
compilation terminated.
nbproject/Makefile-Debug.mk:66: recipe for target build/Debug/MinGW-Windows/main.o' failed
make[2]: [build/Debug/MinGW-Windows/main.o] Error 1 (ignored)
mkdir -p dist/Debug/MinGW-Windows
g++ -o dist/Debug/MinGW-Windows/sql_test2 build/Debug/MinGW-Windows/main.o -L/D/libs/boost_1_53_0/boost -L/D/libs/boost_1_53_0/libs -L/D/libs/mysql-connector-c++-noinstall-1.1.3-win32 -L/D/libs/mysql-connector-c++-noinstall-1.1.3-win32/include -L/D/libs/mysql-connector-c++-noinstall-1.1.3-win32/include/cppconn -L/D/libs/mysql-connector-c++-noinstall-1.1.3-win32/lib -lmysqlcppconn -lmysqlcppconn-static -lmysqlcppconn -static
g++.exe: error: build/Debug/MinGW-Windows/main.o: No such file or directory
nbproject/Makefile-Debug.mk:62: recipe for targetdist/Debug/MinGW-Windows/sql_test2.exe' failed
make[2]: [dist/Debug/MinGW-Windows/sql_test2.exe] Error 1 (ignored)
make[2]: Leaving directory /cygdrive/c/Users/Toni/Desktop/dev/Wiesel/new/tests/sql_test2'
make[1]: Leaving directory/cygdrive/c/Users/Toni/Desktop/dev/Wiesel/new/tests/sql_test2'
This should be what you're looking for:
A library would normally reside in its own installation directory so you would need to point NB to where that is. If you right-click the project name in the "Projects" window, you'll have a Properties option.
Select the Build/C++ compiler option to add the directory for the .h files.
Select the Build/Linker to add the directory for the dll file.
Include C++ library in Netbeans 7.0