Jarosław Miszczak jarekadam at gmail.com
Thu Apr 5 11:22:25 CEST 2007

Hi Roman,

On 4/5/07, Ronan Sandford <ronansandford at yahoo.fr> wrote:
> Also I tried to compile your example in the API documentation but I receive
> this error:
> g++ -o bin/main obj/main.o -Iinc -Llib  -lquantum
> obj/main.o: In function `main':
> main.cpp:(.text+0x4b): undefined reference to `quantum_new_qureg(unsigned
> long long, int)'
> main.cpp:(.text+0x7f): undefined reference to `quantum_hadamard(int,
> quantum_reg_struct*)'
> main.cpp:(.text+0x92): undefined reference to `quantum_bmeasure(int,
> quantum_reg_struct*)'
> collect2: ld returned 1 exit status
> make: *** [main] Error 1
>  I used the deb package (for ubuntu)

Use 'gcc' instead of 'g++'; gcc ex1.c -lquantum sould be OK.
You do not nedd to add -L options.

> Because it didn't work I tried the source version (after uninstalling the
> deb package) but I got this error on compilation:
> /bin/sh ./libtool --mode=link gcc -rpath /usr/local/lib -version-info 5:1:2
> -o libquantum.la complex.lo\
>         measure.lo matrix.lo gates.lo oaddn.lo omuln.lo expn.lo qft.lo\
>         classic.lo qureg.lo decoherence.lo qec.lo version.lo objcode.lo\
>         density.lo -lm
> libtool: link: `complex.lomeasure.lo' is not a valid libtool object
> make: *** [libquantum.la] Erreur 1

That's a bug in original Makefile.in and in Makefile generated by the
./configure script. You can fix it by adding an extra space before
backslash '\' in Makefile in some lines or by using attached patch.
But you don't need this if you will use C instead of C++ compiler.

Best regards
Jarek Miszczak
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libquantum-0.2.4-1.patch
Type: text/x-patch
Size: 3319 bytes
Desc: not available
Url : http://lists.enyo.de/pipermail/libquantum-users/attachments/20070405/9e8c2837/attachment.bin 

More information about the libquantum-users mailing list