Embedded example won't compile with gcc in Linux?

153 views
Skip to first unread message

Chetan Bhasin

unread,
Sep 25, 2013, 9:50:28 AM9/25/13
to mongoos...@googlegroups.com
Hello!

This is the first time I am working with mongoose so don't know a lot about it.

Before I could start using mongoose as an embedded server for my project I thought it would be better if I just tried and ran and example first.

So I used hello.c, mongoose.c, and mongoose.h given on this page: https://code.google.com/p/mongoose/

but when I try to compile the code using GCC or G++ I get the following errors:

g++ -o server hello.c mongoose.c
/tmp/cc6d6YeG.o: In function `mg_start_thread':
mongoose.c:(.text+0x1432): undefined reference to `pthread_create'
/tmp/cc6d6YeG.o: In function `load_dll(mg_context*, char const*, ssl_func*)':
mongoose.c:(.text+0xbdde): undefined reference to `dlopen'
mongoose.c:(.text+0xbe42): undefined reference to `dlsym'

I don't know where I went wrong and what must be done in order to solve this problem.

OS in use: Linux Mint Rairing Ringtail

Sergey Lyubka

unread,
Sep 25, 2013, 9:54:14 AM9/25/13
to mongoose-users
gcc -o server hello.c mongoose.c -ldl -pthread


--
You received this message because you are subscribed to the Google Groups "mongoose-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongoose-user...@googlegroups.com.
To post to this group, send email to mongoos...@googlegroups.com.
Visit this group at http://groups.google.com/group/mongoose-users.
For more options, visit https://groups.google.com/groups/opt_out.

Message has been deleted

Ulrich Hertlein

unread,
Sep 27, 2013, 1:42:44 PM9/27/13
to mongoos...@googlegroups.com, mongoos...@googlegroups.com
Hi,

> On 27.09.2013, at 15:57, Chetan Bhasin <chetanb...@gmail.com> wrote:
...
> Now, however, when I tried using the same command at Arch Linux with base-devel installed it gave me a huge list of errors in mongoose.c.

You don't say! Fascinating!




Seriously, since you're not giving ANY useful information you're obviously only making small talk.

/ulrich
Reply all
Reply to author
Forward
0 new messages