Can't compile examples on ubuntu 18.04


#1

Hi there.

Not new to programming but starting my oF journey through my degree at uni.
But I’ve hit a a roadblock.
After following the install instructions for linux, when I go to try and compile one of the example projects (have tried multiple) I get a very infuriating and nondescript error (pasted below).
I have tried with multiple gcc/g++ versions 4,5,6 and 7 (7.3, being the one currently included with ubuntu) each with the corresponding download versions, each installing the dependencies freshly each time and now on two entirely different machines!
Out of desperation I also tried the master and patched branch on Github.
Same Error.
I also get this error when compiling the ProjectGenerator.
What am I doing wrong? Tis strange because it seems others have successfully compiled on 18.04.

ERROR:

HOST_OS=Linux
checking pkg-config libraries:   cairo zlib gstreamer-app-1.0 gstreamer-1.0 gstreamer-video-1.0 gstreamer-base-1.0 libudev freetype2 fontconfig sndfile openal libcurl glfw3 rtaudio libpulse-simple alsa gl glu glew gtk+-3.0 libmpg123 
with PKG_CONFIG_LIBDIR=
Compiling OF library for Release
make[1]: Entering directory '/home/bevis/.local/bin/oF/libs/openFrameworksCompiled/project'
HOST_OS=Linux
checking pkg-config libraries:   cairo zlib gstreamer-app-1.0 gstreamer-1.0 gstreamer-video-1.0 gstreamer-base-1.0 libudev freetype2 fontconfig sndfile openal libcurl glfw3 rtaudio libpulse-simple alsa gl glu glew gtk+-3.0 libmpg123 
with PKG_CONFIG_LIBDIR=
HOST_OS=Linux
checking pkg-config libraries:   cairo zlib gstreamer-app-1.0 gstreamer-1.0 gstreamer-video-1.0 gstreamer-base-1.0 libudev freetype2 fontconfig sndfile openal libcurl glfw3 rtaudio libpulse-simple alsa gl glu glew gtk+-3.0 libmpg123 
with PKG_CONFIG_LIBDIR=
HOST_OS=Linux
checking pkg-config libraries:   cairo zlib gstreamer-app-1.0 gstreamer-1.0 gstreamer-video-1.0 gstreamer-base-1.0 libudev freetype2 fontconfig sndfile openal libcurl glfw3 rtaudio libpulse-simple alsa gl glu glew gtk+-3.0 libmpg123 
with PKG_CONFIG_LIBDIR=
Done!
make[1]: Leaving directory '/home/bevis/.local/bin/oF/libs/openFrameworksCompiled/project'


Compiling polygonExample for Release
make[1]: Entering directory '/home/bevis/.local/bin/oF/examples/graphics/polygonExample'
HOST_OS=Linux
checking pkg-config libraries:   cairo zlib gstreamer-app-1.0 gstreamer-1.0 gstreamer-video-1.0 gstreamer-base-1.0 libudev freetype2 fontconfig sndfile openal libcurl glfw3 rtaudio libpulse-simple alsa gl glu glew gtk+-3.0 libmpg123 
with PKG_CONFIG_LIBDIR=
Linking bin/polygonExample for linux64
g++ -o bin/polygonExample    /home/bevis/.local/bin/oF/libs/openFrameworksCompiled/lib/linux64/libopenFrameworks.a   -Wl,-rpath=./libs:./bin/libs -Wl,--as-needed -Wl,--gc-sections -fuse-ld=gold    -lz -lgstapp-1.0 -lgstvideo-1.0 -lgstbase-1.0 -lgstreamer-1.0 -ludev -lfontconfig -lfreetype -lsndfile -lopenal -lcurl -lglfw -lrtaudio -lpulse-simple -lpulse -lasound -lGLEW -lGLU -lGL -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lmpg123 -lglut -lX11 -lXrandr -lXxf86vm -lXi -lXcursor -ldl -lpthread -lfreeimage -lboost_filesystem -lboost_system -lpugixml -luriparser -lXinerama
/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/Scrt1.o:function _start: error: undefined reference to 'main'
collect2: error: ld returned 1 exit status
/home/bevis/.local/bin/oF/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:403: recipe for target 'bin/polygonExample' failed
make[1]: *** [bin/polygonExample] Error 1
make[1]: Leaving directory '/home/bevis/.local/bin/oF/examples/graphics/polygonExample'
/home/bevis/.local/bin/oF/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:124: recipe for target 'Release' failed
make: *** [Release] Error 2

#2

Did you run the install_dependencies script? I am on Ubuntu 18.04 and it works


#3

I know this will not help but I am using ubuntu 18.04 right now and it works. I just finished running an example a minute ago… I suggest to double check the installation instructions.

ciao
Davide


#4

Works for me too on 18.04 and GCC 7.3, installed just two days ago. I followed the instructions at


but skipped the “Get the Project Generator” part because I use QtCreator instead (which has its own scripts to generate projects) and also skipped the Compile all examples part.