configuring NetBeans to work with DirectX - c++

I have NetBeans 7.2.1 with Cygwin compiler installed. I want to setup Direct X in NetBeans, so I right clicked on the project -> properties -> C++ Compiler -> Include Directories, and added the include in DirectX SDK, went to properties again -> Linker -> Additional Library Directories and added the Lib(x86) in DirectX SDK. But when I compile this shows up:
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory `/cygdrive/c/Users/Jacob/Documents/NetBeansProjects/DX_trial'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/Cygwin-Windows/dx_trial.exe
make[2]: Entering directory `/cygdrive/c/Users/Jacob/Documents/NetBeansProjects /DX_trial'
mkdir -p build/Debug/Cygwin-Windows
rm -f build/Debug/Cygwin-Windows/main.o.d
g++.exe -c -g -I/cygdrive/D/Direct\ X\ SDK/Include -MMD -MP -MF build/Debug/Cygwin- Windows/main.o.d -o build/Debug/Cygwin-Windows/main.o main.cpp
main.cpp: In function `int WinMain(HINSTANCE__*, HINSTANCE__*, CHAR*, int)':
main.cpp:60: warning: passing NULL used for non-pointer converting 1 of `HWND__* CreateWindowExA(DWORD, const CHAR*, const CHAR*, DWORD, int, int, int, int, HWND__*, HMENU__*, HINSTANCE__*, void*)'
main.cpp:191:2: warning: no newline at end of file
mkdir -p dist/Debug/Cygwin-Windows
g++.exe -o dist/Debug/Cygwin-Windows/dx_trial build/Debug/Cygwin-Windows/main.o -L/cygdrive/D/Direct\ X\ SDK/Lib/x86
build/Debug/Cygwin-Windows/main.o: In function `_Z7initD3DP6HWND__':
/cygdrive/c/Users/Jacob/Documents/NetBeansProjects/DX_trial/main.cpp:111: undefined reference to `_Direct3DCreate9#4'
collect2: ld returned 1 exit status
make[2]: *** [dist/Debug/Cygwin-Windows/dx_trial.exe] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
nbproject/Makefile-Debug.mk:62: recipe for target `dist/Debug/Cygwin-Windows /dx_trial.exe' failed
make[2]: Leaving directory `/cygdrive/c/Users/Jacob/Documents/NetBeansProjects /DX_trial'
nbproject/Makefile-Debug.mk:59: recipe for target `.build-conf' failed
make[1]: Leaving directory `/cygdrive/c/Users/Jacob/Documents/NetBeansProjects /DX_trial'
nbproject/Makefile-impl.mk:39: recipe for target `.build-impl' failed
BUILD FAILED (exit value 2, total time: 2s)
Is there a problem in the configuration? ,because the code I copied and pasted from a tutorial and it worked on another compiler. Any help at all would be appreciated.

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

Undefined reference to sf::

I wanted to make gui apps in c++ and found SFML to be a good choice. Fortunately i am on linux so SFML(2.4) was already installed on my system.
So i started searching for some tutorials and found one that makes a simple window. But when i run the code i get an error saying undefined reference to sf::(function i am using). Here's the code
#include <SFML/Graphics.hpp>
int main(void)
{
sf::RenderWindow window(sf::VideoMode(640,480),"SFML working");
return 0;
}
And here's the error log.
cd '/home/jasper/NetBeansProjects/SFML'
/usr/bin/make -f Makefile CONF=Debug
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory '/home/jasper/NetBeansProjects/SFML'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/GNU-Linux/sfml
make[2]: Entering directory '/home/jasper/NetBeansProjects/SFML'
mkdir -p dist/Debug/GNU-Linux
g++ -o dist/Debug/GNU-Linux/sfml build/Debug/GNU-Linux/main.o
build/Debug/GNU-Linux/main.o: In function `main':
/home/jasper/NetBeansProjects/SFML/main.cpp:6: undefined reference to `sf::String::String(char const*, std::locale const&)'
/home/jasper/NetBeansProjects/SFML/main.cpp:6: undefined reference to `sf::VideoMode::VideoMode(unsigned int, unsigned int, unsigned int)'
/home/jasper/NetBeansProjects/SFML/main.cpp:6: undefined reference to `sf::RenderWindow::RenderWindow(sf::VideoMode, sf::String const&, unsigned int, sf::ContextSettings const&)'
/home/jasper/NetBeansProjects/SFML/main.cpp:6: undefined reference to `sf::RenderWindow::~RenderWindow()'
collect2: error: ld returned 1 exit status
nbproject/Makefile-Debug.mk:62: recipe for target 'dist/Debug/GNU-Linux/sfml' failed
make[2]: *** [dist/Debug/GNU-Linux/sfml] Error 1
make[2]: Leaving directory '/home/jasper/NetBeansProjects/SFML'
nbproject/Makefile-Debug.mk:59: recipe for target '.build-conf' failed
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory '/home/jasper/NetBeansProjects/SFML'
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 172ms)
I've tried searching for solution on google but couldn't find any effective one. So i thought some expert opinion would be good. Help please. Thanks
You forgot to link with SFML libraries. Those are at least:
sfml-graphics
sfml-window
sfml-system
As the documentation explains, on Linux it can be done like this:
g++ myapp.o -o myapp -lsfml-graphics -lsfml-window -lsfml-system
Or if using an IDE, specify them as Additional Dependencies in Linker settings.

NetBeans building failure | make Error 1

I get the following errors while building my project (game with C++/SFML):
cd '/home/osboxes/NetBeansProjects/Prueba'
/usr/bin/make -f Makefile CONF=Debug
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory '/home/osboxes/NetBeansProjects/Prueba'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/GNU-Linux/prueba
make[2]: Entering directory '/home/osboxes/NetBeansProjects/Prueba'
mkdir -p dist/Debug/GNU-Linux
g++ -o dist/Debug/GNU-Linux/prueba build/Debug/GNU-Linux/AABBCollidable.o build/Debug/GNU-Linux/AABBCollisionDetector.o build/Debug/GNU-Linux/AnimatedSprite.o build/Debug/GNU-Linux/Animation.o build/Debug/GNU-Linux/ConvexCollidable.o build/Debug/GNU-Linux/ConvexCollisionDetector.o build/Debug/GNU-Linux/ConvexShape.o build/Debug/GNU-Linux/Director.o build/Debug/GNU-Linux/Entry.o build/Debug/GNU-Linux/Event.o build/Debug/GNU-Linux/EventManager.o build/Debug/GNU-Linux/FileLogger.o build/Debug/GNU-Linux/GuiElement.o build/Debug/GNU-Linux/GuiSystem.o build/Debug/GNU-Linux/Label.o build/Debug/GNU-Linux/LabelButton.o build/Debug/GNU-Linux/ResourceManager.o build/Debug/GNU-Linux/State.o -L/usr/lib/x86_64-linux-gnu -lsfml-window -lsfml-system -lsfml-graphics -lsfml-audio
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o: In function `_start':
collect2: error: ld returned 1 exit status
nbproject/Makefile-Debug.mk:79: recipe for target 'dist/Debug/GNU-Linux/prueba' failed
make[2]: *** [dist/Debug/GNU-Linux/prueba] Error 1
make[2]: Leaving directory '/home/osboxes/NetBeansProjects/Prueba'
nbproject/Makefile-Debug.mk:76: recipe for target '.build-conf' failed
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory '/home/osboxes/NetBeansProjects/Prueba'
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 2s)
I have installed NetBeans IDE 8.1 with SFML libraries. I tried to fix it by clearing cache from NetBeans and then restart IDE but still does the same errors.
My project was compiled with Standard C++ compiler (C++11 version).
Hope you could help me. Thanks by the way...

Netbeans Building Issues for C++

I'm using the MinGW complier/make/etc files but whenever I try to run my code it spits this back out to me:
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory `/c/Users/Geneva/workspace/C++ Through Game Programming'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/MinGW-Windows/c___through_game_programming.exe
make[2]: Entering directory `/c/Users/Geneva/workspace/C++ Through Game Programming'
mkdir -p dist/Debug/MinGW-Windows
g++ -o dist/Debug/MinGW-Windows/c___through_game_programming build/Debug/MinGW-Windows/diceroll.o build/Debug/MinGW-Windows/main.o
build/Debug/MinGW-Windows/main.o: In function `main':
C:\Users\Geneva\workspace\C++ Through Game Programming/main.cpp:35: multiple definition of `main'
build/Debug/MinGW-Windows/diceroll.o:C:\Users\Geneva\workspace\C++ Through Game Programming/diceroll.cpp:16: first defined here
collect2: ld returned 1 exit status
make[2]: *** [dist/Debug/MinGW-Windows/c___through_game_programming.exe] Error 1
make[2]: Leaving directory `/c/Users/Geneva/workspace/C++ Through Game Programming'
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory `/c/Users/Geneva/workspace/C++ Through Game Programming'
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 1s)
I have my environment variable PATH set right, when I installed the gbd I just extracted it to the normal C:\MinGW\bin so that I wouldn't have to do C:\MinGW\msys\1.0\bin
Can anyone help out? If I can't figure this out I'm going to go back to coding in Java
The compiler message is clear: You have defined multiple main() functions

directxtutorial.com tutorial wont compile in g++

I am hoping that there is just come compiler settings I can adjust somewhere. I try to complie the source code here: http://www.directxtutorial.com/Lesson.aspx?lessonid=9-4-1
It will compile in visual studio 2010 but when I try to compile in g++ through netbeans it gives me these errors
"/usr/bin/make" -f nbproject/Makefile-Release.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory `/cygdrive/c/Users/Stephen/Documents/Projects/C++/test'
"/usr/bin/make" -f nbproject/Makefile-Release.mk dist/Release/Cygwin-Windows/test.exe
make[2]: Entering directory `/cygdrive/c/Users/Stephen/Documents/Projects/C++/test'
mkdir -p build/Release/Cygwin-Windows
rm -f build/Release/Cygwin-Windows/main.o.d
g++.exe -c -g -MMD -MP -MF build/Release/Cygwin-Windows/main.o.d -o build/Release/Cygwin-Windows/main.o main.cpp
main.cpp: In function `int WinMain(HINSTANCE__*, HINSTANCE__*, CHAR*, int)':
main.cpp:39: error: cannot convert `const wchar_t[12]' to `const CHAR*' in assignment
main.cpp:52: warning: converting to non-pointer type `DWORD' from NULL
main.cpp:52: error: cannot convert `const wchar_t*' to `const CHAR*' for argument `2' to `HWND__* CreateWindowExA(DWORD, const CHAR*, const CHAR*, DWORD, int, int, int, int, HWND__*, HMENU__*, HINSTANCE__*, void*)'
nbproject/Makefile-Release.mk:66: recipe for target `build/Release/Cygwin-Windows/main.o' failed
make[2]: *** [build/Release/Cygwin-Windows/main.o] Error 1
make[2]: Leaving directory `/cygdrive/c/Users/Stephen/Documents/Projects/C++/test'
make[1]: *** [.build-conf] Error 2
nbproject/Makefile-Release.mk:59: recipe for target `.build-conf' failed
make: *** [.build-impl] Error 2
make[1]: Leaving directory `/cygdrive/c/Users/Stephen/Documents/Projects/C++/test'
nbproject/Makefile-impl.mk:39: recipe for target `.build-impl' failed
BUILD FAILED (exit value 2, total time: 1s)
I can easily get rid of the main.cpp: 39 and 52 errors, the rest wont go through
Use MinGW for WIN32 sources, not Cygwin.