CarbonWolf / aff4

Automatically exported from code.google.com/p/aff4
GNU General Public License v3.0
0 stars 0 forks source link

aff4image - manual compilation issue missing definitions #4

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I'm just playing around with aff4 a bit and tried to compile aff4imager.c 
manually.

gcc -c -o aff4imager.o aff4imager.c

It seems to be missing the following definitions.

int AFF4_DEBUG_LEVEL = 0;

#define CALL(x, method, ... )                   \
  (x)->method((x), ## __VA_ARGS__)

gcc -c -o common.o common.c

it seems to be missing BUFF_SIZE 
which seems to be (also) defined in the public header file ?

Please add a name prefix like AFF4_BUFF_SIZE to prevent naming conflicts.

Original issue reported on code.google.com by joachim.metz@gmail.com on 18 Aug 2010 at 4:02

GoogleCodeExporter commented 8 years ago
Working on manually linking now.

On my Fedora Core 13 installation talloc_free seems to be a macro defined in 
talloc.h
The macros translates to _talloc_free()

If talloc.h is not included in aff4imager.c it results in a linker error 
missing the talloc_free() function

Original comment by joachim.metz@gmail.com on 18 Aug 2010 at 4:52

GoogleCodeExporter commented 8 years ago
Not all functions seem to be exported into a shared library:

aff4imager.o: In function `open_urn':
aff4imager.c:(.text+0x17): undefined reference to `new_RDFURN'
aff4imager.c:(.text+0x75): undefined reference to `ClearError'
aff4imager.o: In function `aff4_make_map':
aff4imager.c:(.text+0x13c): undefined reference to `rdfvalue_from_urn'
aff4imager.c:(.text+0x14c): undefined reference to `new_XSDInteger'
aff4imager.c:(.text+0x15c): undefined reference to `new_XSDInteger'
aff4imager.c:(.text+0x1b1): undefined reference to `PrintError'
aff4imager.c:(.text+0x1bb): undefined reference to `print_volume_drivers'
aff4imager.o: In function `aff4_image':
aff4imager.c:(.text+0x4e1): undefined reference to `new_XSDInteger'
aff4imager.c:(.text+0x4f9): undefined reference to `new_RDFURN'
aff4imager.c:(.text+0x515): undefined reference to `rdfvalue_from_urn'
aff4imager.c:(.text+0x5dc): undefined reference to `PrintError'
aff4imager.c:(.text+0x5e6): undefined reference to `print_volume_drivers'
aff4imager.c:(.text+0x74a): undefined reference to `new_XSDInteger'
aff4imager.c:(.text+0xb92): undefined reference to `PrintError'
aff4imager.o: In function `main':
aff4imager.c:(.text+0xcd2): undefined reference to `parse_int'
aff4imager.c:(.text+0xd08): undefined reference to `parse_int'
aff4imager.c:(.text+0xf9f): undefined reference to `PrintError'
collect2: ld returned 1 exit status

Command used:
LDPATH=/usr/local/lib/ gcc -o aff4imager -laff4 -ltalloc aff4imager.o common.o

Looking at the public include header I'm unsure what the status of these 
functions is
'FIXME - remove these'. So I'm leaving aff4imager for what it is.

Original comment by joachim.metz@gmail.com on 18 Aug 2010 at 5:02

GoogleCodeExporter commented 8 years ago
This directory contains the C applications for imaging etc. These are way out 
of date hence we dont build them any more. We still need to sync them up to the 
latest APIs.

The C api is pretty much the same as the python API so the only value we have 
is as a demonstration. Python is ultimately more powerful (e.g. we can easily 
have a GUI).

I will leave this bug on a low priority because I'm hoping to fix these soon as 
a demonstration of the C apis.

Original comment by scude...@gmail.com on 19 Aug 2010 at 10:00