Hi

Sorry for this query, if it sounds too elementary. I didnot fully understand why loading a jpeg image for example require linking with jpeg, tiff, png, z, ws2_32 libraries? On top of this..in the build of VXL that I have, I seem to be requiring to link to dcmtk as well (for dicom images).

Can anyone please explain this requirements?

I am also getting the following error after linking with dcmtk
dcmtk.lib(dcuid.obj) : error LNK2019: unresolved external symbol _Netbios@4 referenced in function "unsigned char * __cdecl getMACAddress(unsigned char * const)" (?getMACAddress@@YAPAEQAE@Z)

Any suggestions?

Thanks a lot
William


 

Message: 1
Date: Fri, 30 Dec 2005 10:10:04 +0100
From: Quique Fernandez < quique.fs@gmail.com>
To: "Miguel A. Figueroa-Villanueva" <miguelf@msu.edu>
Subject: Re: [Vxl-users] Linker errors with Dev C++
Cc: vxl-users@lists.sourceforge.net

------=_Part_10884_19055968.1135933804833
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

>
>
> These errors are most probably due to compiling with different
> libraries, given that the symbols it complains about are in fact part of
> vil, vcl. I have vxl built with MinGW and with VS.net, both in a windows
> XP machine. So, this shouldn't be a problem for you.


I've finally changed to linux, because I'm not sure that visual had built
the vxl libraries correctly, and when windows fails, usually linux have
success...

I've just compiled the file successfully using the libraries you told me

However, it appears that vil, vcl are not enough. In other words after
> you use the same compiler for both (i.e., VXL and your code) you will
> likely encounter other undefined symbols due to other libraries (e.g.,
> jpeg, tiff, etc).
>
> I copied the code you have there and compiled it with mingw successfully:
>
> g++ -c -I"/path/to/vcl" -I"/path/to/core" test.cxx
>
> Then I linked to the mingw vxl libs:
>
> g++ test.o -L"/path/to/vxl_mingw/lib" -lvil -lvcl
>
> but this gives me errors such as:
>
>
> ../vxl_mingw/lib/libvil.a(vil_stream_url.obj)(.text+0xa8a):vil_stream_url=
.cxx:
> undefined reference to `WSAStartup@8'
>
> ../vxl_mingw/lib/libvil.a(vil_stream_url.obj)(.text+0xab3):vil_stream_url=
.cxx:
> undefined reference to `socket@12'
>
> ../vxl_mingw/lib/libvil.a(vil_stream_url.obj)(.text+0xadc):vil_stream_url=
.cxx:
> undefined reference to `WSAGetL
>
> I had to link with all the following to successfully create the
> executable:
>
> g++ test.o -L"/path/to/vxl_mingw/lib" -lvil -lvcl -ljpeg -ltiff -lpng
> -lz -lws2_32




It gave me the same errors until I wrote the aditional libraries.



My suggestion is that you build both VXL and your code, not only with
> the same compiler, but also with cmake. This way cmake will determine
> that it needs all the other libraries (i.e., jpeg, tiff, png, z, ws2_32)
> when you add the vil library. Of course, you can do this manually as I
> did above, but if you start handling a lot of code it is easier to let
> CMake take care of the dependencies...


I'm very interested in the compilation with CMake, because I don't know the
library very well yet, and I don't know the dependencies between libraries.
How can I compile using cmake, so that it takes care of the dependencies?

Thank you a lot. I was beginning to hate the library before being able to
load an image. xD