<font size="2"><font face="verdana,sans-serif">I guess you are not using CMake? If not, it is really cumbersome to find the missing library, if that is the problem.<br></font></font><br><div class="gmail_quote">On Wed, Sep 14, 2011 at 00:26, David Brayford <span dir="ltr">&lt;<a href="mailto:dbrayford@gmail.com">dbrayford@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi,<br>
<br>
I am getting the following linker errors when trying to build an<br>
external project using itk libraries. I know I am missing one or more<br>
libraries from the linker, but don&#39;t know which ones.<br>
<br>
2&gt;itkgdcm.lib(gdcmJpeg2000.obj) : error LNK2019: unresolved external<br>
symbol _opj_image_destroy referenced in function &quot;bool __cdecl<br>
gdcm::gdcm_read_JPEG2000_file(void *,char *,unsigned int)&quot;<br>
(?gdcm_read_JPEG2000_file@gdcm@@YA_NPAXPADI@Z)<br>
2&gt;itkgdcm.lib(gdcmJpeg2000.obj) : error LNK2019: unresolved external<br>
symbol _opj_cio_close referenced in function &quot;bool __cdecl<br>
gdcm::gdcm_read_JPEG2000_file(void *,char *,unsigned int)&quot;<br>
(?gdcm_read_JPEG2000_file@gdcm@@YA_NPAXPADI@Z)<br>
2&gt;itkgdcm.lib(gdcmJpeg2000.obj) : error LNK2019: unresolved external<br>
symbol _opj_destroy_decompress referenced in function &quot;bool __cdecl<br>
gdcm::gdcm_read_JPEG2000_file(void *,char *,unsigned int)&quot;<br>
(?gdcm_read_JPEG2000_file@gdcm@@YA_NPAXPADI@Z)<br>
2&gt;itkgdcm.lib(gdcmJpeg2000.obj) : error LNK2019: unresolved external<br>
symbol _opj_decode referenced in function &quot;bool __cdecl<br>
gdcm::gdcm_read_JPEG2000_file(void *,char *,unsigned int)&quot;<br>
(?gdcm_read_JPEG2000_file@gdcm@@YA_NPAXPADI@Z)<br>
2&gt;itkgdcm.lib(gdcmJpeg2000.obj) : error LNK2019: unresolved external<br>
symbol _opj_cio_open referenced in function &quot;bool __cdecl<br>
gdcm::gdcm_read_JPEG2000_file(void *,char *,unsigned int)&quot;<br>
(?gdcm_read_JPEG2000_file@gdcm@@YA_NPAXPADI@Z)<br>
2&gt;itkgdcm.lib(gdcmJpeg2000.obj) : error LNK2019: unresolved external<br>
symbol _opj_setup_decoder referenced in function &quot;bool __cdecl<br>
gdcm::gdcm_read_JPEG2000_file(void *,char *,unsigned int)&quot;<br>
(?gdcm_read_JPEG2000_file@gdcm@@YA_NPAXPADI@Z)<br>
2&gt;itkgdcm.lib(gdcmJpeg2000.obj) : error LNK2019: unresolved external<br>
symbol _opj_set_event_mgr referenced in function &quot;bool __cdecl<br>
gdcm::gdcm_read_JPEG2000_file(void *,char *,unsigned int)&quot;<br>
(?gdcm_read_JPEG2000_file@gdcm@@YA_NPAXPADI@Z)<br>
2&gt;itkgdcm.lib(gdcmJpeg2000.obj) : error LNK2019: unresolved external<br>
symbol _opj_create_decompress referenced in function &quot;bool __cdecl<br>
gdcm::gdcm_read_JPEG2000_file(void *,char *,unsigned int)&quot;<br>
(?gdcm_read_JPEG2000_file@gdcm@@YA_NPAXPADI@Z)<br>
2&gt;itkgdcm.lib(gdcmJpeg2000.obj) : error LNK2019: unresolved external<br>
symbol _opj_set_default_decoder_parameters referenced in function<br>
&quot;bool __cdecl gdcm::gdcm_read_JPEG2000_file(void *,char *,unsigned<br>
int)&quot; (?gdcm_read_JPEG2000_file@gdcm@@YA_NPAXPADI@Z)<br>
2&gt;itkgdcm.lib(gdcmJpeg2000.obj) : error LNK2019: unresolved external<br>
symbol _opj_image_create referenced in function &quot;struct opj_image *<br>
__cdecl gdcm::rawtoimage(char *,struct opj_cparameters<br>
*,int,int,int,int,int,int,int)&quot;<br>
(?rawtoimage@gdcm@@YAPAUopj_image@@PADPAUopj_cparameters@@HHHHHHH@Z)<br>
2&gt;itkgdcm.lib(gdcmJpeg2000.obj) : error LNK2019: unresolved external<br>
symbol _opj_destroy_compress referenced in function &quot;bool __cdecl<br>
gdcm::gdcm_write_JPEG2000_file(class std::basic_ostream&lt;char,struct<br>
std::char_traits&lt;char&gt; &gt; *,char *,unsigned<br>
int,int,int,int,int,int,int,int,unsigned int &amp;)&quot;<br>
(?gdcm_write_JPEG2000_file@gdcm@@YA_NPAV?$basic_ostream@DU?$char_traits@D@std@@@std@@PADIHHHHHHHAAI@Z)<br>
2&gt;itkgdcm.lib(gdcmJpeg2000.obj) : error LNK2019: unresolved external<br>
symbol _cio_tell referenced in function &quot;bool __cdecl<br>
gdcm::gdcm_write_JPEG2000_file(class std::basic_ostream&lt;char,struct<br>
std::char_traits&lt;char&gt; &gt; *,char *,unsigned<br>
int,int,int,int,int,int,int,int,unsigned int &amp;)&quot;<br>
(?gdcm_write_JPEG2000_file@gdcm@@YA_NPAV?$basic_ostream@DU?$char_traits@D@std@@@std@@PADIHHHHHHHAAI@Z)<br>
2&gt;itkgdcm.lib(gdcmJpeg2000.obj) : error LNK2019: unresolved external<br>
symbol _opj_encode referenced in function &quot;bool __cdecl<br>
gdcm::gdcm_write_JPEG2000_file(class std::basic_ostream&lt;char,struct<br>
std::char_traits&lt;char&gt; &gt; *,char *,unsigned<br>
int,int,int,int,int,int,int,int,unsigned int &amp;)&quot;<br>
(?gdcm_write_JPEG2000_file@gdcm@@YA_NPAV?$basic_ostream@DU?$char_traits@D@std@@@std@@PADIHHHHHHHAAI@Z)<br>
2&gt;itkgdcm.lib(gdcmJpeg2000.obj) : error LNK2019: unresolved external<br>
symbol _opj_setup_encoder referenced in function &quot;bool __cdecl<br>
gdcm::gdcm_write_JPEG2000_file(class std::basic_ostream&lt;char,struct<br>
std::char_traits&lt;char&gt; &gt; *,char *,unsigned<br>
int,int,int,int,int,int,int,int,unsigned int &amp;)&quot;<br>
(?gdcm_write_JPEG2000_file@gdcm@@YA_NPAV?$basic_ostream@DU?$char_traits@D@std@@@std@@PADIHHHHHHHAAI@Z)<br>
2&gt;itkgdcm.lib(gdcmJpeg2000.obj) : error LNK2019: unresolved external<br>
symbol _opj_create_compress referenced in function &quot;bool __cdecl<br>
gdcm::gdcm_write_JPEG2000_file(class std::basic_ostream&lt;char,struct<br>
std::char_traits&lt;char&gt; &gt; *,char *,unsigned<br>
int,int,int,int,int,int,int,int,unsigned int &amp;)&quot;<br>
(?gdcm_write_JPEG2000_file@gdcm@@YA_NPAV?$basic_ostream@DU?$char_traits@D@std@@@std@@PADIHHHHHHHAAI@Z)<br>
2&gt;itkgdcm.lib(gdcmJpeg2000.obj) : error LNK2019: unresolved external<br>
symbol _opj_set_default_encoder_parameters referenced in function<br>
&quot;bool __cdecl gdcm::gdcm_write_JPEG2000_file(class<br>
std::basic_ostream&lt;char,struct std::char_traits&lt;char&gt; &gt; *,char<br>
*,unsigned int,int,int,int,int,int,int,int,unsigned int &amp;)&quot;<br>
(?gdcm_write_JPEG2000_file@gdcm@@YA_NPAV?$basic_ostream@DU?$char_traits@D@std@@@std@@PADIHHHHHHHAAI@Z)<br>
<br>
Here are the libraries I am linking to:<br>
<br>
wsock32.lib;rpcrt4.lib;Snmpapi.lib;itkv3p_netlib.lib;itkNetlibSlatec.lib;ITKznz.lib;itkvnl_inst.lib;itkvnl_algo.lib;ITKMetaIO.lib;itkzlib.lib;itktiff.lib;ITKniftiio.lib;itkjpeg16.lib;itkjpeg12.lib;itkjpeg8.lib;ITKDICOMParser.lib;itkvnl.lib;itkvcl.lib;itksys.lib;itkpng.lib;ITKNrrdIO.lib;ITKIO.lib;ITKCommon.lib;ITKBasicFilters.lib;ITKAlgorithms.lib;itkgdcm.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;comdlg32.lib;advapi32.lib;vtkCommon.lib;vtkIO.lib;vtkImaging.lib;vtkRendering.lib;vtkVolumeRendering.lib;vtkGraphics.lib;vtkFiltering.lib;vtkGenericFiltering.lib;vtkHybrid.lib;..\..\bin\Debug\vtkvscSpineRegistration.lib;..\..\bin\Debug\vtkvscIO.lib;vtkexoIIc.lib;vtkverdict.lib;vtkftgl.lib;vtkfreetype.lib;opengl32.lib;vtkDICOMParser.lib;vtkNetCDF_cxx.lib;vtkNetCDF.lib;vtkmetaio.lib;comctl32.lib;vtksqlite.lib;vtkpng.lib;vtktiff.lib;vtkzlib.lib;vtkjpeg.lib;vtkexpat.lib;vfw32.lib;..\..\bin\Debug\vtkvscCommon.lib;vtksys.lib;ws2_32.lib;..<br>


 \..\bin\Debug\vtkvscDicomToolkit.lib;netapi32.lib;%(AdditionalDependencies)<br>
<br>
<br>
<br>
David<br>
_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
</blockquote></div><br>