Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Linux Netbeans Compiling Problems  (Read 8145 times)

0 Members and 1 Guest are viewing this topic.

Tuntraek

  • Newbie
  • *
  • Posts: 2
    • View Profile
Linux Netbeans Compiling Problems
« on: March 13, 2020, 07:53:01 am »
I'm new to linux and C/C++ programming. I'm using ubuntu 18.04 and netbeans 11.3.
I could manage to build and run the test program via terminal using these commands:

SFML is installed in usr/include which I think is the standard path.

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


But if I try to run it in Netbeans I get these errors:

cd '/home/gui/NetBeansProjects/main.cpp'
/usr/bin/make -f Makefile CONF=Debug
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory '/home/gui/NetBeansProjects/main.cpp'
"/usr/bin/make"  -f nbproject/Makefile-Debug.mk dist/Debug/GNU-Linux/main.cpp
make[2]: Entering directory '/home/gui/NetBeansProjects/main.cpp'
mkdir -p dist/Debug/GNU-Linux
g++-7     -o dist/Debug/GNU-Linux/main.cpp build/Debug/GNU-Linux/main.o -lAudio -lGraphics -lNetwork -lSystem -lWindow
/usr/bin/ld: cannot find -lAudio
/usr/bin/ld: cannot find -lGraphics
/usr/bin/ld: cannot find -lNetwork
/usr/bin/ld: cannot find -lSystem
/usr/bin/ld: cannot find -lWindow
collect2: error: ld returned 1 exit status
nbproject/Makefile-Debug.mk:62: recipe for target 'dist/Debug/GNU-Linux/main.cpp' failed
make[2]: *** [dist/Debug/GNU-Linux/main.cpp] Error 1
make[2]: Leaving directory '/home/gui/NetBeansProjects/main.cpp'
nbproject/Makefile-Debug.mk:59: recipe for target '.build-conf' failed
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory '/home/gui/NetBeansProjects/main.cpp'
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
make: *** [.build-impl] Error 2

BUILD FAILED (exit value 2, total time: 115ms)

I dont really understand it...

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Linux Netbeans Compiling Problems
« Reply #1 on: March 13, 2020, 10:25:09 am »
Quote
-lAudio -lGraphics -lNetwork -lSystem -lWindow
That should obviously be
Quote
-lsfml-audio sfml-graphics -lsfml-network -lsfml-window -lsfml-system
Laurent Gomila - SFML developer

Tuntraek

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Linux Netbeans Compiling Problems
« Reply #2 on: March 13, 2020, 07:29:56 pm »
Yes, I notice that. How do I change that?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Linux Netbeans Compiling Problems
« Reply #3 on: March 15, 2020, 09:32:09 am »
The same way you did with "-lAudio -lGraphics -lNetwork -lSystem -lWindow", but with "-lsfml-audio sfml-graphics -lsfml-network -lsfml-window -lsfml-system" this time.
Laurent Gomila - SFML developer

 

anything