Bug 4382 - undefined reference to `curl_easy_init' while compiling with --enable-tests option
Summary: undefined reference to `curl_easy_init' while compiling with --enable-tests o...
Status: REOPENED
Alias: None
Product: Claws Mail (GTK 2)
Classification: Unclassified
Component: Plugins/RSSyl (show other bugs)
Version: 3.17.7
Hardware: PC Linux
: P3 trivial
Assignee: users
URL:
Depends on:
Blocks:
 
Reported: 2020-09-13 23:16 UTC by Numan Demirdöğen
Modified: 2020-09-14 14:19 UTC (History)
0 users

See Also:


Attachments
Output og configure (22.35 KB, text/plain)
2020-09-14 10:55 UTC, Numan Demirdöğen
no flags Details
ldadd fix for tests (1.51 KB, patch)
2020-09-14 13:24 UTC, rezso
no flags Details | Diff

Description Numan Demirdöğen 2020-09-13 23:16:51 UTC
Hi,

If Claws Mail is compiled against latest git branch with ./configure --enable-tests, these errors are produced:

/usr/bin/ld: ../.libs/libfeed.a(libfeed_la-feed.o): in function `feed_update':
/home/numan/Belgeler/depolar/claws/src/plugins/rssyl/libfeed/feed.c:261: undefined reference to `curl_easy_init'
/usr/bin/ld: /home/numan/Belgeler/depolar/claws/src/plugins/rssyl/libfeed/feed.c:268: undefined reference to `XML_ParserCreate'
/usr/bin/ld: /home/numan/Belgeler/depolar/claws/src/plugins/rssyl/libfeed/feed.c:284: undefined reference to `curl_easy_setopt'
/usr/bin/ld: /home/numan/Belgeler/depolar/claws/src/plugins/rssyl/libfeed/feed.c:351: undefined reference to `XML_ParserFree'

and similar ones.

System:
LC_ALL=C uname -a
Linux kubuntu 5.4.0-47-generic #51-Ubuntu SMP Fri Sep 4 19:50:52 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

LC_ALL=C lsb_release -a
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.1 LTS
Release:        20.04
Codename:       focal

LC_ALL=C gcc --version
gcc (Ubuntu 9.3.0-10ubuntu2) 9.3.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Steps to produce:
1. git clone https://git.claws-mail.org/readonly/claws.git 
2. cd claws && ./autogen.sh
3. cd po
4. make claws-mail.pot
5. msgmerge --update tr.po claws-mail.pot
6. Update translations and cd to parent directory
7. ./configure --enable-tests
Comment 1 Paul 2020-09-14 10:45:29 UTC
what is the output of configure?
Comment 2 Numan Demirdöğen 2020-09-14 10:55:59 UTC
Created attachment 2087 [details]
Output og configure

Paul,

I attached the output of configure command. Should I also add output of ./configure --enable-tests?
Comment 3 Paul 2020-09-14 11:16:04 UTC
It doesn't look like it has anything to do with --enable-tests.

It's related to curl and expat, dependencies of the rssyl plugin.

The configure output says they are found, but those errors disagree.

It seems your system has a problem.
Comment 4 Numan Demirdöğen 2020-09-14 11:59:11 UTC
But only when I use --enable-tests option the compilation ends with an error. Well, it is not an important error and I do not use --enable-tests option when I compile Claws Mail. I just wanted to test all the options to see Claws Mail works without any flaws. 

When I was searching a solution, I encountered lots of commends mentioning that this kind of problem arises from using linker before source files. Anyway, thanks and sorry for taking your time.
Comment 5 Ricardo Mones 2020-09-14 12:57:53 UTC
> It doesn't look like it has anything to do with --enable-tests.

It builds fine without the flag and fails with it, so... :-)

> It's related to curl and expat, dependencies of the rssyl plugin.
> 
> The configure output says they are found, but those errors disagree.
>
> It seems your system has a problem.

It's also reproducible here (Debian testing), and while it can be also my system has a problem, I think it's because the dependencies on the rssyl/test/Makefile.am are not fully correct, though my poor attempts to fix it have failed miserably so far.

Reopening just in case some enlightened mind can provide some help with this.

Thanks in advance!
Comment 6 rezso 2020-09-14 13:24:21 UTC
Created attachment 2088 [details]
ldadd fix for tests
Comment 7 rezso 2020-09-14 13:27:15 UTC
I tried to compile 3.17.6 release with --enable-tests

4 required header files are missing from the tarball:

src/common/tests/mock_prefs_common_get_flush_metadata.h
src/common/tests/mock_prefs_common_get_use_shred.h
src/plugins/rssyl/libfeed/tests/mock_procheader_date_parse.h
src/tests/mock_debug_print.h

After adding these headers form git source, I can compile the release with the attached patch.
Comment 8 Paul 2020-09-14 14:19:31 UTC
well, I cannot reproduce that problem here, so I leave it to those that can.
(But I have to wonder, do we even need these tests?)

Note You need to log in before you can comment on or make changes to this bug.