V
V
Vladimir Grabko2016-07-24 03:55:37
C++ / C#
Vladimir Grabko, 2016-07-24 03:55:37

How to set up netbeans to work with C++?

I compile something like this

g++ -c main.cpp 
g++ main.o -o sfml-app -lsfml-graphics -lsfml-window -lsfml-

but when I try to compile from ide, I get errors
cd '/home/vgrabko/NetBeansProjects/civilization'
/usr/bin/make -f Makefile CONF=Debug
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Вход в каталог `/home/vgrabko/NetBeansProjects/civilization'
"/usr/bin/make"  -f nbproject/Makefile-Debug.mk dist/Debug/GNU-Linux/civilization
make[2]: Вход в каталог `/home/vgrabko/NetBeansProjects/civilization'
mkdir -p dist/Debug/GNU-Linux
g++     -o dist/Debug/GNU-Linux/civilization build/Debug/GNU-Linux/main.o 
build/Debug/GNU-Linux/main.o: In function `main':
/home/vgrabko/NetBeansProjects/civilization/main.cpp:5: undefined reference to `sf::String::String(char const*, std::locale const&)'
/home/vgrabko/NetBeansProjects/civilization/main.cpp:5: undefined reference to `sf::VideoMode::VideoMode(unsigned int, unsigned int, unsigned int)'
/home/vgrabko/NetBeansProjects/civilization/main.cpp:5: undefined reference to `sf::RenderWindow::RenderWindow(sf::VideoMode, sf::String const&, unsigned int, sf::ContextSettings const&)'
/home/vgrabko/NetBeansProjects/civilization/main.cpp:6: undefined reference to `sf::CircleShape::CircleShape(float, unsigned int)'
/home/vgrabko/NetBeansProjects/civilization/main.cpp:7: undefined reference to `sf::Color::Green'
/home/vgrabko/NetBeansProjects/civilization/main.cpp:7: undefined reference to `sf::Shape::setFillColor(sf::Color const&)'
/home/vgrabko/NetBeansProjects/civilization/main.cpp:15: undefined reference to `sf::Window::close()'
/home/vgrabko/NetBeansProjects/civilization/main.cpp:12: undefined reference to `sf::Window::pollEvent(sf::Event&)'
/home/vgrabko/NetBeansProjects/civilization/main.cpp:18: undefined reference to `sf::Color::Color(unsigned char, unsigned char, unsigned char, unsigned char)'
/home/vgrabko/NetBeansProjects/civilization/main.cpp:18: undefined reference to `sf::RenderTarget::clear(sf::Color const&)'
/home/vgrabko/NetBeansProjects/civilization/main.cpp:19: undefined reference to `sf::RenderStates::Default'
/home/vgrabko/NetBeansProjects/civilization/main.cpp:19: undefined reference to `sf::RenderTarget::draw(sf::Drawable const&, sf::RenderStates const&)'
/home/vgrabko/NetBeansProjects/civilization/main.cpp:20: undefined reference to `sf::Window::display()'
/home/vgrabko/NetBeansProjects/civilization/main.cpp:9: undefined reference to `sf::Window::isOpen() const'
/home/vgrabko/NetBeansProjects/civilization/main.cpp:23: undefined reference to `sf::RenderWindow::~RenderWindow()'
/home/vgrabko/NetBeansProjects/civilization/main.cpp:23: undefined reference to `sf::RenderWindow::~RenderWindow()'
/home/vgrabko/NetBeansProjects/civilization/main.cpp:23: undefined reference to `sf::RenderWindow::~RenderWindow()'
build/Debug/GNU-Linux/main.o: In function `sf::CircleShape::~CircleShape()':
/usr/include/SFML/Graphics/CircleShape.hpp:41: undefined reference to `vtable for sf::CircleShape'
/usr/include/SFML/Graphics/CircleShape.hpp:41: undefined reference to `vtable for sf::CircleShape'
/usr/include/SFML/Graphics/CircleShape.hpp:41: undefined reference to `sf::Shape::~Shape()'
collect2: error: ld returned 1 exit status
make[2]: *** [dist/Debug/GNU-Linux/civilization] Ошибка 1
make[2]: Выход из каталога `/home/vgrabko/NetBeansProjects/civilization'
make[1]: *** [.build-conf] Ошибка 2
make[1]: Выход из каталога `/home/vgrabko/NetBeansProjects/civilization'
make: *** [.build-impl] Ошибка 2

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Grabko, 2016-07-24
@VGrabko

wrote a sh script for assembly and use it instead of the built-in compiler

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question