[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Libcdio-devel] Problem with introducing a new API function
From: |
Thomas Schmitt |
Subject: |
[Libcdio-devel] Problem with introducing a new API function |
Date: |
Sun, 20 Dec 2009 20:47:47 +0100 |
Hi,
i am puzzled by the build system of libcdio:
A newly introduced function does not show up in
the library. Is there a file where i have to
declare publicly visible functions ?
In include/cdio/mmc.h i have
int mmc_get_cmd_scsi_sense ( const CdIo_t *p_cdio, unsigned char sense[18],
driver_return_code_t *driver_ret);
This is in effect as the compiler does not
complain about implicit declaration when
i use the function in my code.
The function is in lib/driver/mmc.c and in no
way declared static:
int
mmc_get_cmd_scsi_sense( const CdIo_t *p_cdio, unsigned char sense[18],
driver_return_code_t *driver_ret)
{
generic_img_private_t *gen = p_cdio->env;
if (!p_cdio) return DRIVER_OP_UNINIT;
memcpy(sense, gen->scsi_mmc_sense, 18);
*driver_ret = gen->scsi_mmc_driver_ret;
return -1 * !gen->scsi_mmc_sense_valid;
}
But the linker cannot find it if i try to use
the new function in
example/mmc1.c
Building of libcdio fails with
libcdio-0.82.ts/example/mmc1.c:
70: undefined reference to `mmc_get_cmd_scsi_sense'
Same if i try to use it by libburn:
libburn/.libs/libburn.so: undefined reference to `mmc_get_cmd_scsi_sense'
No link error if i call the function from within
lib/driver/mmc.c or from lib/driver/device.c .
A test print in mmc_run_cmd() gets into effect
after i perform make install. So my code indeed
gets installed. No doubt.
This feels like i'm stepping on my own feet.
But what am i doing wrong ?
Have a nice day :)
Thomas
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Libcdio-devel] Problem with introducing a new API function,
Thomas Schmitt <=