PDA

View Full Version : Qt add library



nqn
28th May 2010, 20:50
Hi, I want to add library dicom

My teacher gave me a tutorial:

1) Download boost
2) Extract to e.g. \osm\boost_1_42_0 (i use d:\osm\...)

Qt Console (in \osm\boost_1_42_0):
3) bootstrap.bat
4) bjam --toolset=gcc
5) wait

6) download dicomlib, socket i utility from http://code.google.com/p/dicomlib
7) Extract. Make tree:
\osm\dicomlib
\osm\socket
\osm\utility
8) (in \osm\dicomlib):
g++ -c *.cpp -I.. -I../boost_1_42_0
g++ -shared *.o ./boost_1_42_0/bin.v2/threads/../../...threads.a -o dicom.dll

During compilation may be errors. You probably have to change
in FileMetaInformation.cpp comment TiffHeader.h

and add:
#include <algorithm>
#include <string.h>

you wil see...

9) link to dicomlib.dll

In *.pro add
INCLUDEPATH += d:\osm
LIBS += -Ld:\osm\dicomlib -ldicom

in source

#include <dicomlib/dicomlib.hpp>


everythink was good to 8 point.
i also done 9 point
but when i buil program:

mingw32-make: Leaving directory `E:/uzytki/polibuda/Sem 8/OSM/testsqllite'
mingw32-make: Entering directory `E:/uzytki/polibuda/Sem 8/OSM/testsqllite'
D:/Qt/2010.02.1/mingw/bin/mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory `E:/uzytki/polibuda/Sem 8/OSM/testsqllite'
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -Wl,-subsystem,console -mthreads -Wl -o debug/testsqllite.exe debug/main.o -L'd:/Qt/2010.02.1/qt/lib' -Ld:\osm\dicomlib -ldicom -lQtSqld4 -lQtCored4
mingw32-make[1]: Leaving directory `E:/uzytki/polibuda/Sem 8/OSM/testsqllite'
mingw32-make: Leaving directory `E:/uzytki/polibuda/Sem 8/OSM/testsqllite'
d:/qt/2010.02.1/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: cannot find -ldicom
collect2: ld returned 1 exit status
mingw32-make[1]: *** [debug/testsqllite.exe] Error 1
mingw32-make: *** [debug] Error 2

My teacher send also same .dll file but i dont know what to do with this

squidge
28th May 2010, 21:27
so dicom.lib is in /osm/dicomlib/ ?

nqn
29th May 2010, 10:21
No there is only dicomlib.dll i copy that file there
maybe i do sth wrong in point 8?

camol
31st March 2011, 14:59
Can anyone help me? I have a big problem I need to get this work on UBUNTU, I've succesfully compiled the library, in program everything works well with linking and compiling with it, however when the program comes to do this:

1) dicom::DataSet dset;
2) dicom::Read(file.toStdString(), dset);

I get this output error-information:
terminate called after throwing an instance of 'dicom::exception'
what(): Syntax not recognised.

In debug the whole stops at the line nr 2, I have no idea why, please help