[Dcmlib] new to gdcm-cmake problems with test example
Jean-Pierre ROUX
jean-pierre.roux at creatis.insa-lyon.fr
Fri Aug 31 22:37:34 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)
Hi, Ashish.
--> Try
TARGET_LINK_LIBRARIES(gdcmex1 GDCM_LIBRARIES)
--> Just a question :
I saw some previous posts from you, on "Insight-users" mailing list.
Do you want to use gdcm1.3 (CVS version) alone, or concurently with
gdcm1.2 (ITK version)
(The 2nd possibility doesn't go straight forward ...)
Jean-Pierre Roux
>----------
>
>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
>
>
>_______________________________________________
>Dcmlib mailing list
>Dcmlib at creatis.insa-lyon.fr
>http://www.creatis.insa-lyon.fr/mailman/listinfo/dcmlib
Jean-Pierre ROUX
CREATIS - CNRS UMR 5220, INSERM U 630
Laboratoire de Radiologie Experimentale
Hopital Cardiologique
28 Avenue du Doyen LEPINE
B.P. Lyon-Montchat
69394 Lyon Cedex 03
Tel : (+33) 04 72 35 74 12
Fax : (+33) 04 72 68 49 16
URL : http://www.creatis.univ-lyon1.fr
e-mail : jpr at creatis.univ-lyon1.fr/~jpr
More information about the Dcmlib
mailing list