2

I'm not used to working with C or C++ and I'm trying to let the compiler where to find references losses.

I have a configuration file called configure which creates the makefile.

Then to create the makefile I run:

CFLAGS=-I/usr/include/libxml2 ./configure  --enable-murder

As I run this line but given two references in CFLAGS?.

To be clear mais, compiling want to point to the references:

  • /usr/include/libxml2
  • /usr/include/libical

in CFLAGS.

This is because I can not edit the makefile and I want to fix the following errors:

http_caldav.o: In function `is_valid_timerange':
http_caldav.c:(.text+0x3c86): undefined reference to `icaltime_is_valid_time'
http_caldav.c:(.text+0x3cd8): undefined reference to `icaltime_is_valid_time'
http_caldav.c:(.text+0x3d2a): undefined reference to `icaltime_is_date'
http_caldav.c:(.text+0x3d7c): undefined reference to `icaltime_is_date'
http_caldav.c:(.text+0x3dce): undefined reference to `icaltime_is_utc'
http_caldav.c:(.text+0x3e23): undefined reference to `icaltime_is_utc'
http_caldav.o: In function `parse_comp_filter':
http_caldav.c:(.text+0x3e7d): undefined reference to `xmlStrcmp'
http_caldav.c:(.text+0x3e98): undefined reference to `xmlGetProp'
http_caldav.c:(.text+0x3eb7): undefined reference to `xmlStrcmp'
http_caldav.c:(.text+0x3f02): undefined reference to `xmlStrcmp'
http_caldav.c:(.text+0x3f19): undefined reference to `xmlStrcmp'
http_caldav.c:(.text+0x3f46): undefined reference to `xmlStrcmp'
http_caldav.c:(.text+0x3f71): undefined reference to `xmlStrcmp'
http_caldav.o:http_caldav.c:(.text+0x3f9c): more undefined references to `xmlStrcmp' follow
http_caldav.o: In function `parse_comp_filter':
http_caldav.c:(.text+0x4077): undefined reference to `xmlFree'
http_caldav.c:(.text+0x40cc): undefined reference to `xmlStrcmp'
http_caldav.c:(.text+0x40d9): undefined reference to `icaltimezone_get_utc_timezone'
http_caldav.c:(.text+0x410f): undefined reference to `xmlGetProp'
http_caldav.c:(.text+0x412d): undefined reference to `icaltime_from_string'
http_caldav.c:(.text+0x4171): undefined reference to `xmlFree'
http_caldav.c:(.text+0x41a0): undefined reference to `icaltime_from_timet_with_zone'
http_caldav.c:(.text+0x41f2): undefined reference to `xmlGetProp'
http_caldav.c:(.text+0x4210): undefined reference to `icaltime_from_string'
http_caldav.c:(.text+0x4254): undefined reference to `xmlFree'
http_caldav.c:(.text+0x4283): undefined reference to `icaltime_from_timet_with_zone'

config.log

gcc-4.7.real: error: unrecognized command line option '-V'
gcc-4.7.real: fatal error: no input files
compilation terminated.
configure:3214: $? = 4
configure:3203: gcc -qversion >&5
gcc-4.7.real: error: unrecognized command line option '-qversion'
gcc-4.7.real: fatal error: no input files
compilation terminated.
conftest.c:13:28: fatal error: ac_nonexistent.h: No such file or directory
conftest.c:56:26: fatal error: minix/config.h: No such file or directory
conftest.c:37:9: error: unknown type name 'not'
conftest.c:37:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'universal'
conftest.c:37:15: error: unknown type name 'universal'
gcc-4.7.real: error: unrecognized option '-R'

My OS is Debian 7.

5
  • Do you want to add two include paths with CFLAGS? Commented Jan 6, 2014 at 22:21
  • Those are link time errors. Adding more paths to CFLAGS will not help, as it's likely finding the headers. You might need to install the development packages for those libraries to get them to link.
    – ldav1s
    Commented Jan 6, 2014 at 22:23
  • Doesn't configure complain about missing stuff? Commented Jan 6, 2014 at 22:26
  • @meaning-matters, configure (if it is an autoconf configure file) will complain about missing stuff, unless it's not testing for them, in this case if it can link the libraries.
    – ldav1s
    Commented Jan 6, 2014 at 22:40
  • @ldav1s I have already installed the development packages but not how to solve these problems references. Although I still unsolved. Commented Jan 7, 2014 at 11:42

1 Answer 1

9

If you want to add two include paths, enclose them in quotes

CFLAGS="-I/usr/include/libxml2 -I/usr/include/libical" ./configure --enable-murder

To fix the linker errors, you must add the libraries with LDLIBS, e.g.

CFLAGS="..." LDLIBS="-lxml2 -lical" ./configure --enable-murder
7
  • 2
    It's typically better to add the variables as arguments to the configure script, not into the environment. So, ./configure --enable-murder CFLAGS="..." LDLIBS="..." Commented Jan 6, 2014 at 22:28
  • @ldav1s Now try this and yet I still can not fix it. Sorry but not work with C or C + + and am trying to make this work. I want to learn and fix it. Any suggestions of what else I can do?. Commented Jan 7, 2014 at 11:45
  • @ldav1s I found a config.log file. This was created to run the file configue. Now edit the question adding some errors I saw in the. Commented Jan 7, 2014 at 13:05
  • @ldav1s I think I found the solution! down at least a few mistakes. Instead of using LDLIBS use LDFLAGS. Now all references to me are being sqlite3_column_int. Commented Jan 7, 2014 at 13:12
  • 1
    @MariaJosé The config.log snippet is just configure checking a few things. If the build runs and has only sqlite3_column_int as an undefined reference, you must add -lsqlite3 to LDLIBS/LDFLAGS. And make sure SQLite is installed, of course. Commented Jan 7, 2014 at 13:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.