[Dcmlib] new to gdcm-cmake problems with test example

Ashish Singh mrasingh at gmail.com
Fri Aug 31 21:29:28 CEST 2007


Hi,

I just installed GDCM library on my windows XP Pro X64 workstation and
compiled it with CMAKE and later built the generated solution using VS 2005
Pro. All this went fine without any errors. However I am not sure what my
cmakelists.txt file should look like to test a simple example. I created a
cmakelists.txt file which looks like-
--------
PROJECT(gdcmex1)

FIND_PACKAGE(GDCM)
IF(GDCM_FOUND)
    INCLUDE(${GDCM_USE_FILE})
ENDIF(GDCM_FOUND)

ADD_EXECUTABLE(gdcmex1 myex1.cpp)

# I am not sure about the following line, what other libraries do I need to
specify here?
TARGET_LINK_LIBRARIES(gdcmex1)
----------

My test example code looks like-
----------------------
/* myex1.cpp*/
#include "gdcmFile.h"
#include "gdcmFileHelper.h"
#include <iostream>

using namespace std;

int main(int argc, char *argv[])
{
    int i=0;
    cout<<i<<endl;
    std::string fileName;

    gdcm::File *e1;
    e1=gdcm::File::New();

    return 0;
}
--------------------
Visual Studio 2005 Pro gives me the following errors on this simple example.


-------
1>myex1.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) public: static class gdcm::File * __cdecl
gdcm::File::New(void)" (__imp_?New at File@gdcm@@SAPAV12 at XZ) referenced in
function _main
1>Debug\gdcmex1.exe : fatal error LNK1120: 1 unresolved externals
-------

Can anyone please guide me as to what I am missing here and how to fix it?

Thanks in advance,
Ashish
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.creatis.insa-lyon.fr/pipermail/dcmlib/attachments/20070831/6787e94f/attachment.html>


More information about the Dcmlib mailing list