静态链接到Raylib的错误

我从github上的raylib版本页面(对于amd64 Linux为2.6.0)下载了预编译的raylib二进制文件。然后,我复制了基本的窗口演示:

    InitWindow(screenWidth, screenHeight, "raylib [core] example - basic window");

    SetTargetFPS(60);               // Set our game to run at 60 frames-per-second
    //--------------------------------------------------------------------------------------

    // Main game loop
    while (!WindowShouldClose())    // Detect window close button or ESC key
    {
        // Update
        //----------------------------------------------------------------------------------
        // TODO: Update your variables here
        //----------------------------------------------------------------------------------

        // Draw
        //----------------------------------------------------------------------------------
        BeginDrawing();

            ClearBackground(RAYWHITE);

            DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY);

        EndDrawing();
        //----------------------------------------------------------------------------------
    }

    // De-Initialization
    //--------------------------------------------------------------------------------------
    CloseWindow();        // Close window and OpenGL context
    //--------------------------------------------------------------------------------------

    return 0;
}

I then compiled it with g++ test.cpp -L. -I include -lraylib -lGL -lm -lpthread -ldl -lrt -lX11

我得到错误:

g++ test.cpp -L. -I include -lraylib -lGL -lm -lpthread -ldl -lrt -lX11 /usr/bin/ld: ./libraylib.a(core.c.o): relocation R_X86_64_32 against .bss' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ./libraylib.a(text.c.o): relocation R_X86_64_32 against.rodata' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ./libraylib.a(textures.c.o): relocation R_X86_64_32 against .data' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ./libraylib.a(utils.c.o): relocation R_X86_64_32S against .rodata' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: final link failed: Nonrepresentable section on output collect2: error: ld returned 1 exit status