On 2008-12-04 23:18, Thomasz Blaszczyk wrote:
> Hi,
> I just want to debug ex1.c in Code::Blocks IDE,
> But it fails, Please have look at my screenshot: http://omploader.org/vem1m
>
> What I did:
> I've created new folder  'ex1' and I've copied ex1.c file to this folder.
> Next I've moved all files from libclamav to this folder.
> I change only one line in ex1.c:
> #include <clamav.h>
> to
> #include "clamav.h"
>
> When I build it fails, saying:
>
> obj/Debug/ex1.o||In function `main':|
> /home/tomb/projects/aau/virus_scanner/codeblocks/ex1/ex1.c|64|undefined
> reference to `cl_retdbdir'|
> /home/tomb/projects/aau/virus_scanner/codeblocks/ex1/ex1.c|64|undefined
> reference to `cl_load'|
> /home/tomb/projects/aau/virus_scanner/codeblocks/ex1/ex1.c|65|undefined
> reference to `cl_strerror'|
> /home/tomb/projects/aau/virus_scanner/codeblocks/ex1/ex1.c|73|undefined
> reference to `cl_build'|
> /home/tomb/projects/aau/virus_scanner/codeblocks/ex1/ex1.c|74|undefined
> reference to `cl_strerror'|
> /home/tomb/projects/aau/virus_scanner/codeblocks/ex1/ex1.c|75|undefined
> reference to `cl_free'|
> /home/tomb/projects/aau/virus_scanner/codeblocks/ex1/ex1.c|93|undefined
> reference to `cl_scandesc'|
> /home/tomb/projects/aau/virus_scanner/codeblocks/ex1/ex1.c|99|undefined
> reference to `cl_strerror'|
> /home/tomb/projects/aau/virus_scanner/codeblocks/ex1/ex1.c|100|undefined
> reference to `cl_free'|
> /home/tomb/projects/aau/virus_scanner/codeblocks/ex1/ex1.c|112|undefined
> reference to `cl_free'|
>   

The usual way to do is to link your program with clamav, by using -lclamav.

Since you already moved the files, you should actually add those to your
project.

> ||=== Build finished: 10 errors, 0 warnings ===|
>
>
> What am I missing. I have expected that steps I did will succeed.  Can
> anyone help?  .I am new to linux compilers.

I'd suggest you to read about how linking works on Linux, how to build
your code, how to profile your code, etc. before
doing performance measurements.

>  I would like to measure
> performance for BM and AC algorithms.

You can use clamscan for that.

You can use oprofile to locate "hotspots" in the code, but be careful in
how you interpret them (read oprofile docs, basically if you do
asm-level profiling
the profile counts will be off by a few instructions due to pipelining).

Also read about how you should do performance measurements, there are
some things to watch out for:
 - disk caching effects (repeat the measurements at least 3 or more
times, or to be sure flush the disk cache each time (as root do 'sync;
echo 3 >/proc/sys/vm/drop_caches; sync')
- make sure no other app is running that uses CPU
- turn off cron (they tend to fire at wrong time)
- turn off CPU frequency scaling
- set CPU governor to max performance


Best regards,
--Edwin
_______________________________________________
http://lurker.clamav.net/list/clamav-devel.html
Please submit your patches to our Bugzilla: http://bugs.clamav.net

Reply via email to