鱼C论坛

 找回密码
 立即注册
查看: 1074|回复: 5

关于windows平台下的g++编译错误

[复制链接]
发表于 2022-3-25 12:36:03 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
本人在使用g++编译vscode下的 OpenGL程序 出现了以下错误 希望指点一下我自己也试着用visual studio 自带的开发者命令提示符打开vscode 可是还是出现下面的问题
这是 tasks.json 中的命令行
(源代码在最后)
// 这里选的是 args 的部分 使用的是 g++ 编译器
:\Users\ADMINI~1.PC-\AppData\Local\Temp\cck9WU2t.o:main.cpp:(.text+0x110a2): undefined reference to `gladLoadGLLoader'
C:\Users\ADMINI~1.PC-\AppData\Local\Temp\cck9WU2t.o:main.cpp:(.text+0x110df): undefined reference to `glad_glViewport'
C:\Users\ADMINI~1.PC-\AppData\Local\Temp\cck9WU2t.o:main.cpp:(.text+0x1113a): undefined reference to `glad_glClearColor'
C:\Users\ADMINI~1.PC-\AppData\Local\Temp\cck9WU2t.o:main.cpp:(.text+0x11167): undefined reference to `glad_glClear'
C:\Users\ADMINI~1.PC-\AppData\Local\Temp\cck9WU2t.o:main.cpp:(.text+0x111a3): undefined reference to `glad_glViewport'
//这上面的都是 glad 库里面的函数 我还没有将 glad 库包含进来
//下面的都是 glfw 莫名奇妙的错误 我自己感觉好像有一些是 windows.h 里面的函数
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(init.c.obj):init.c:(.text+0xb9): undefined reference to `__mingw_free'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(init.c.obj):init.c:(.text+0xda): undefined reference to `__mingw_free'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(init.c.obj):init.c:(.text+0x11c): undefined reference to `__mingw_free'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(input.c.obj):input.c:(.text+0xe46): undefined reference to `__mingw_free'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(input.c.obj):input.c:(.text+0xe51): undefined reference to `__mingw_free'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(input.c.obj):input.c:(.text+0xe5c): more undefined references to `__mingw_free' follow
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(input.c.obj):input.c:(.text+0x220c): undefined reference to `__mingw_realloc'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(input.c.obj):input.c:(.text+0x1606): undefined reference to `__mingw_free'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(monitor.c.obj):monitor.c:(.text+0xc2): undefined reference to `__mingw_free'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(monitor.c.obj):monitor.c:(.text+0xd0): undefined reference to `__mingw_free'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(monitor.c.obj):monitor.c:(.text+0xde): undefined reference to `__mingw_free'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(monitor.c.obj):monitor.c:(.text+0x114): undefined reference to `__mingw_free'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(monitor.c.obj):monitor.c:(.text+0x122): more undefined references to `__mingw_free' follow
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(monitor.c.obj):monitor.c:(.text+0x2bd): undefined reference to `__mingw_realloc'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(monitor.c.obj):monitor.c:(.text+0x392): undefined reference to `__mingw_free'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(monitor.c.obj):monitor.c:(.text+0x3a0): undefined reference to `__mingw_free'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(monitor.c.obj):monitor.c:(.text+0x3ae): undefined reference to `__mingw_free'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(monitor.c.obj):monitor.c:(.text+0x3e4): undefined reference to `__mingw_free'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(monitor.c.obj):monitor.c:(.text+0x3f2): undefined reference to `__mingw_free'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(monitor.c.obj):monitor.c:(.text+0x400): more undefined references to `__mingw_free' follow
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0x113): undefined reference to `CreateDCW@16'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0x16b): undefined reference to `GetDeviceCaps@8'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0x1c6): undefined reference to `GetDeviceCaps@8'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0x1fa): undefined reference to `DeleteDC@4'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0x21f): undefined reference to `__mingw_free'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0x35c): undefined reference to `GetDeviceCaps@8'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0x373): undefined reference to `GetDeviceCaps@8'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0x623): undefined reference to `__mingw_free'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0x98d): undefined reference to `GetDeviceCaps@8'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0x9a4): undefined reference to `GetDeviceCaps@8'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0xb1d): undefined reference to `GetDeviceCaps@8'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0xb34): undefined reference to `GetDeviceCaps@8'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0xdd6): undefined reference to `__mingw_realloc'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0xf78): undefined reference to `CreateDCW@16'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0xf8d): undefined reference to `GetDeviceGammaRamp@8'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0xf98): undefined reference to `DeleteDC@4'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0x10fd): undefined reference to `CreateDCW@16'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0x110e): undefined reference to `SetDeviceGammaRamp@8'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0x1119): undefined reference to `DeleteDC@4'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(win32_window.c.obj):win32_window.c:(.text+0x25f): undefined reference to `CreateDIBSection@24'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(win32_window.c.obj):win32_window.c:(.text+0x2ac): undefined reference to `CreateBitmap@20'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(win32_window.c.obj):win32_window.c:(.text+0x34a): undefined reference to `DeleteObject@4'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(win32_window.c.obj):win32_window.c:(.text+0x355): undefined reference to `DeleteObject@4'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(win32_window.c.obj):win32_window.c:(.text+0x3fa): undefined reference to `DeleteObject@4'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(win32_window.c.obj):win32_window.c:(.text+0x4c3): undefined reference to `CreateRectRgn@16'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(win32_window.c.obj):win32_window.c:(.text+0x502): undefined reference to `DeleteObject@4'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(win32_window.c.obj):win32_window.c:(.text+0xe51): undefined reference to `__mingw_free'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(win32_window.c.obj):win32_window.c:(.text+0xe89): undefined reference to `__mingw_free'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(win32_window.c.obj):win32_window.c:(.text+0xe9b): undefined reference to `__mingw_free'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(win32_window.c.obj):win32_window.c:(.text+0x1f88): undefined reference to `__mingw_free'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(win32_window.c.obj):win32_window.c:(.text+0x2383): undefined reference to `__mingw_free'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(win32_window.c.obj):win32_window.c:(.text+0x4c1c): more undefined references to `__mingw_free' follow
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(wgl_context.c.obj):wgl_context.c:(.text+0x14a): undefined reference to `SwapBuffers@4'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(wgl_context.c.obj):wgl_context.c:(.text+0x424): undefined reference to `ChoosePixelFormat@8'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(wgl_context.c.obj):wgl_context.c:(.text+0x437): undefined reference to `SetPixelFormat@12'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(wgl_context.c.obj):wgl_context.c:(.text+0xc30): undefined reference to `DescribePixelFormat@16'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(wgl_context.c.obj):wgl_context.c:(.text+0xdf4): undefined reference to `__mingw_free'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(wgl_context.c.obj):wgl_context.c:(.text+0xe25): undefined reference to `DescribePixelFormat@16'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(wgl_context.c.obj):wgl_context.c:(.text+0xe4f): undefined reference to `SetPixelFormat@12'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(wgl_context.c.obj):wgl_context.c:(.text+0x147c): undefined reference to `DescribePixelFormat@16'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(wgl_context.c.obj):wgl_context.c:(.text+0x153e): undefined reference to `__mingw_free'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(wgl_context.c.obj):wgl_context.c:(.text+0x1594): undefined reference to `__mingw_free'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(egl_context.c.obj):egl_context.c:(.text+0xb9e): undefined reference to `__mingw_free'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(egl_context.c.obj):egl_context.c:(.text+0xba6): undefined reference to `__mingw_free'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(egl_context.c.obj):egl_context.c:(.text+0x11f8): undefined reference to `__mingw_free'
C:\Users\Administrator.PC-20191006TRUC\source\repos\OpenGL\.vscode\OpenGL\glfw-3.3.5.bin.WIN32\lib-mingw\libglfw3.a(egl_context.c.obj):egl_context.c:(.text+0x1204): more undefined references to `__mingw_free' follow
collect2.exe: error: ld returned 1 exit status
这里是源代码 没有渲染什么图像 仅仅只是创建了个OpenGL的窗口
#include <glad\glad.h>
#include <GLFW\glfw3.h>
#include <iostream>
#include <Shader\Shader.h>
#include <glm\glm.hpp>  //OpenGL的数学库
#include <glm\gtc\type_ptr.hpp>
#include <glm\gtc\matrix_transform.hpp>
#define STB_IMAGE_IMPLEMENTATION
#include <stb\stb_image.h> //图片解析库

void framebuffer_size_callback(GLFWwindow* window, int width, int height);
void processInput(GLFWwindow* window);


int main()
{
    glfwInit();
    glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
    glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
    glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);

    GLFWwindow* window = glfwCreateWindow(800, 600, "Hello, OpenGL", NULL, NULL);
    if (window == NULL)
    {
        std::cout << "Failed to create GLFW window" << std::endl;
        glfwTerminate();
        return -1;
    }
    glfwMakeContextCurrent(window);

    if (!gladLoadGLLoader((GLADloadproc)glfwGetProcAddress))
    {
        std::cout << "Failed to initialize GLAD" << std::endl;
        return -1;
    }

    glViewport(0, 0, 800, 600);
    glfwSetFramebufferSizeCallback(window, framebuffer_size_callback);

    while (!glfwWindowShouldClose(window))
    {
        processInput(window);

        

        glClearColor(0.2f, 0.3f, 0.3f, 1.0f);

        glClear(GL_COLOR_BUFFER_BIT);
        
        
        glfwSwapBuffers(window);
        glfwPollEvents();
    }
    glfwTerminate();
        return 0;
}

void framebuffer_size_callback(GLFWwindow* window, int width, int height)
{
    glViewport(0, 0, width, height);
}

void processInput(GLFWwindow* window)
{
    if (glfwGetKey(window, GLFW_KEY_ESCAPE) == GLFW_PRESS)
    {
        glfwSetWindowShouldClose(window, true);
    }
}

想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

 楼主| 发表于 2022-3-25 12:37:24 | 显示全部楼层
emmm 我这边看帖子的代码有问题 这里把有问题的代码再发一遍
"args": [
                                "-I",
                                "C:\\Users\\Administrator.PC-20191006TRUC\\source\\repos\\OpenGL\\.vscode\\OpenGL\\glad_lib\\include",
                                "-I",
                "C:\\Users\\Administrator.PC-20191006TRUC\\source\\repos\\OpenGL\\.vscode\\OpenGL\\glfw-3.3.5.bin.WIN32\\include",
                "-I",
                                "C:\\Users\\Administrator.PC-20191006TRUC\\source\\repos\\OpenGL\\.vscode\\OpenGL\\OpenGLTool",
                                "${file}",
                                "${workspaceFolder}\\.vscode\\OpenGL\\glfw-3.3.5.bin.WIN32\\lib-mingw\\libglfw3.a",
                                "${workspaceFolder}\\.vscode\\OpenGL\\glfw-3.3.5.bin.WIN32\\lib-mingw\\libglfw3dll.a",
                                "-o",
                                "${fileDirname}\\${fileBasenameNoExtension}.exe"
                        ],
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2022-3-25 15:07:20 From FishC Mobile | 显示全部楼层
主要的错误都是链接错误,一般就是缺少所需的导入库文件,你检查下那些函数所在的导入库文件的路径是否都被正确设置了。
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

 楼主| 发表于 2022-3-25 18:12:18 | 显示全部楼层
zzxhh628 发表于 2022-3-25 15:07
主要的错误都是链接错误,一般就是缺少所需的导入库文件,你检查下那些函数所在的导入库文件的路径是否都被 ...

我是通过vscode的复制路径操作将其复制到tasks.json中的 一般不会错的
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

 楼主| 发表于 2022-3-25 18:27:36 | 显示全部楼层
zzxhh628 发表于 2022-3-25 15:07
主要的错误都是链接错误,一般就是缺少所需的导入库文件,你检查下那些函数所在的导入库文件的路径是否都被 ...

不过自己在加了"-mwindows"的参数后 问题就变成一个了
init.c:(.text+0x27a): undefined reference to `__ms_vsnprintf'
自己查了一下 也没有什么像样的答案
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2022-3-25 19:05:02 From FishC Mobile | 显示全部楼层
__ms_vsnprintf还是无法链接呗,原来那些无法链接的基本都是Win API,加上这个-mwindows就不会使用控制台了,可能改了个子系统,就能用了。至于__ms_vsnprintf,好像它在libglfw3.a链接库,网上有种方法说把它删了?你试试吧。
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2024-11-18 05:37

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表