Skip to content

Debug mode undefined reference to symbol exit #1

@tdhooper

Description

@tdhooper

Firstly thank you so much for putting this out, it's super easy to use and I managed to compile my 4k graphics entry without any trouble. The file size ends up about 500 bytes bigger than the Crinkler processed Windows exe, but your Makefile workflow is so much nicer then trying to use Visual Studio's gui!

Anyway, here's the issue, I've never used C before so probably a newcomer mistake. When running make gtk-opengl with the #define DEBUG enabled, I get the following:

gcc -o gtk-opengl.elf gtk-opengl.c `pkg-config --cflags gtk+-3.0` -lGL -lgtk-3 -lgdk-3 -lgobject-2.0 -no-pie -fno-plt -Os -std=gnu11 -nostartfiles -nostdlib
gtk-opengl.c: In function ‘on_realize’:
gtk-opengl.c:62:23: warning: passing argument 3 of ‘glShaderSource’ from incompatible pointer type [-Wincompatible-pointer-types]
  glShaderSource(v, 1, &vshader, NULL);
                       ^
In file included from /usr/include/GL/gl.h:2055:0,
                 from gtk-opengl.c:11:
/usr/include/GL/glext.h:777:21: note: expected ‘const GLchar * const* {aka const char * const*}’ but argument is of type ‘char **’
 GLAPI void APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length);
                     ^~~~~~~~~~~~~~
gtk-opengl.c: In function ‘_start’:
gtk-opengl.c:134:2: warning: ‘gdk_cursor_new’ is deprecated [-Wdeprecated-declarations]
  GdkCursor* Cursor = gdk_cursor_new(GDK_BLANK_CURSOR);
  ^~~~~~~~~
In file included from /usr/include/gtk-3.0/gdk/gdk.h:34:0,
                 from /usr/include/gtk-3.0/gtk/gtk.h:30,
                 from gtk-opengl.c:9:
/usr/include/gtk-3.0/gdk/gdkcursor.h:228:12: note: declared here
 GdkCursor* gdk_cursor_new   (GdkCursorType    cursor_type);
            ^~~~~~~~~~~~~~
/usr/bin/ld: /tmp/cchKw7fs.o: undefined reference to symbol 'exit@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libc.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Makefile:17: recipe for target 'gtk-opengl.elf' failed
make: *** [gtk-opengl.elf] Error 1

A bunch of warnings then this undefined reference to symbol 'exit@@GLIBC_2.2.5', which is strange because isn't that part of the standard library?

The reason I want to use DEBUG, is because sometimes I make shader errors and I have no easy way of finding them otherwise.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions