Skip to content

mlx_new_window segfault, mlx_init returns 0 #40

@njaros

Description

@njaros

Hi !

My code :

int main(int ac, char **av)
{
void *mlx;
void *win;

(void)ac;
(void)av;
mlx = mlx_init();
win = mlx_new_window(mlx, 1920, 1080, "Hello world!");
mlx_loop(mlx);

}

makefile commands :
gcc -Wall -Wextra -Werror -O3 -c test.c -o test.o
gcc -o test test.o lib/libmlx_Linux.a lib/libft.a -L/usr/lib -lXext -lX11 -lm -lz

I do valgrind ./test
It returns :
==4182== Process terminating with default action of signal 11 (SIGSEGV)
==4182== Access not within mapped region at address 0x20
==4182== at 0x10CA33: mlx_new_window (in /mnt/c/Users/nicol/OneDrive/Bureau/projets/fdf/test)
==4182== by 0x10A697: main (in /mnt/c/Users/nicol/OneDrive/Bureau/projets/fdf/test)
==4182== If you believe this happened as a result of a stack
==4182== overflow in your program's main thread (unlikely but
==4182== possible), you can try to increase the size of the
==4182== main thread stack using the --main-stacksize= flag.
==4182== The main thread stack size used in this run was 8388608.

Any idea ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions