代码之家  ›  专栏  ›  技术社区  ›  Trytio

libnoise不想编译:找不到-lnoise

  •  0
  • Trytio  · 技术社区  · 8 年前

    我正在尝试使用 Libnoise 图书馆和我一直收到这个错误:

    F:\PortableApps\Documents\Adventure³>g++ Compiled/*.o -o Adventure3 -L./Libs -static -lglew32 -lglfw3dll -lopengl32 -lfreetype -lnoise -static-libgcc-static-libstdc++ Resources/icon.res
    f:/portableapps/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe: cannot find -lnoise
    collect2.exe: error: ld returned 1 exit status
    

    我有 libnoise.lib 在我的 Libs 文件夹。我试过了 -llibnoise 相反,我得到:

    F:\PortableApps\Documents\Adventure³>g++ Compiled/*.o -o Adventure3  -L./Libs -static -lglew32 -lglfw3dll -lopengl32 -lfreetype -llibnoise -static-libgcc -static-libstdc++ Resources/icon.res
    Compiled/Generator.o:Generator.cpp:(.text+0x3d): undefined reference to `noise::module::Perlin::GetValue(double, double, double) const'
    Compiled/Generator.o:Generator.cpp:(.text+0x8a): undefined reference to `noise::module::Perlin::Perlin()'
    Compiled/Generator.o:Generator.cpp:(.text$_ZN5noise6module6PerlinD1Ev[__ZN5noise6module6PerlinD1Ev]+0xa): undefined reference to `vtable for noise::module::Perlin'
    Compiled/Generator.o:Generator.cpp:(.text$_ZN5noise6module6PerlinD1Ev[__ZN5noise6module6PerlinD1Ev]+0x19): undefined reference to `noise::module::Module::~Module()'
    collect2.exe: error: ld returned 1 exit status
    

    我不知道如何手动编译源代码,它总是返回给我一个 WinMain@16 错误,无论我尝试什么 make .

    现在,我真的不知道该怎么办…

    有人有解决办法吗?

    1 回复  |  直到 8 年前
        1
  •  1
  •   Swift - Friday Pie    8 年前

    -l gcc选项假定库的名称以 lib 如此 -lnoise 将链接libnoise。

    通常.lib是一个n导入库或静态库。与导入库相关的问题如下所述: How do import libraries work and why doesn't MinGW need them?

    关于libnoise: Netbeans C++ using MinGW and the libnoise library