1

I created a standard windows application with VS 2012 Pro. Just a main.cpp that looks like this:

#include "gdal_priv.h"
#include "cpl_conv.h"

int main(int argc, char* argv[])
{
   GDALAllRegister();

    return 0;
}

I have set my include path properly. I have gdal_i.lib in my Linker -> Input -> Additional Dependencies.

Link fails with the following message:

1>main.obj : error LNK2019: unresolved external symbol _GDALAllRegister@0 referenced in function _main

(A scad of other symbols are missing as well, but this one should be easy.)

I used dumpbin and GDALAllRegister appears in the exported symbols. It does appear as "GDALAllRegister", not as "_GDALAllRegister@0".

I tried downloading and using the dev build, and also built myself. Same results.

I just know this is something simple, but I'm totally brain-cramping here. What have I done wrong?

Thanks.

-reilly.

4

2 に答える 2

0

この種類のエラーは、EXE と LIB の間の "呼び出し規約" の不一致の典型です。

"構成プロパティ" -> C++ -> 詳細設定 -> "呼び出し規約"に__cdecl (/Gd)があることを確認します

于 2013-11-13T17:22:39.723 に答える