0

I'm trying to use microhttpd libraries in order to generate html sites from c++ code. I'm using netbeans on windows and compiling with cygwin. I have downloaded microhttpd latest version from ftp://ftp.gnu.org/gnu/libmicrohttpd/, and have been able to run the examples.

My problem is when I try to build the code created by myself (for example hellobrowser, following this tutorial: http://www.gnu.org/software/libmicrohttpd/tutorial.html#Hello-browser-example).
I try to re-use makefile.am, deleting the names of the example codes and adding hellobrowser (I think this is done ok). After that, I try to run automake on the top of my project so that it updates makefile.in, either from cygwin terminal or netBeans terminal, but I get the following error:

/cygdrive/c/users/toni/NB/hellobrowser$ automake
    Can't locate Automake/Struct.pm in @INC (@INC contains: /mingw/share/automake-1.11 /usr/lib/perl5/5.10/i686-cygwin /usr/lib/perl5/5.10 /usr/lib/perl5/site_perl/5.10/i686-cygwin /usr/lib/perl5/site_perl/5.10 /usr/lib/perl5/vendor_perl/5.10/i686-cygwin /usr/lib/perl5/vendor_perl/5.10 /usr/lib/perl5/vendor_perl/5.10 /usr/lib/perl5/site_perl/5.8 /usr/lib/perl5/vendor_perl/5.8 .) at /cygdrive/c/Develop/MinGW/bin/automake-1.11 line 47.
    BEGIN failed--compilation aborted at /cygdrive/c/Develop/MinGW/bin/automake-1.11 line 47.

But when looking inside of automake folder, I CAN find Struct.pm:

/cygdrive/c/develop/MinGW/share/automake-1.11/automake$ ls
    ChannelDefs.pm  Configure_ac.pm    Item.pm      Rule.pm     Variable.pm
    Channels.pm     DisjConditions.pm  ItemDef.pm   RuleDef.pm  Version.pm
    Condition.pm    FileUtils.pm       Location.pm  Struct.pm   Wrap.pm
    Config.pm       General.pm         Options.pm   VarDef.pm   XFile.pm

if automake worked, I would run configure (that worked OK with the examples), and build the project with the generated makefileS.

I would really appreciate if someone could point out what I am doing wrong. Thank you very much!

Note: I have makefiles in 3 levels of my project, ./, ./src and ./src/examples, but I only consider the ones located at ./src/examples, as the code is inside that path.

Makefile.am:

        SUBDIRS  = .

    if USE_PRIVATE_PLIBC_H
     PLIBC_INCLUDE = -I$(top_srcdir)/src/include/plibc
    endif

    AM_CPPFLAGS = \
      $(PLIBC_INCLUDE) \
      -I$(top_srcdir)/src/include \
      @LIBGCRYPT_CFLAGS@

    if USE_COVERAGE
      AM_CFLAGS = --coverage
    endif

    # example programs
    noinst_PROGRAMS = \
    hellobrowser 

    hellobrowser_SOURCES = \
     hellobrowser.c 
    hellobrowser_LDADD = \
     $(top_builddir)/src/daemon/libmicrohttpd.la 
toni
  • 713
  • 3
  • 7
  • 17

1 Answers1

0

As the error message shows, @INC does not contain /cygdrive/c/develop/MinGW/share/automake-1.11/automake, which is where your Struct.pm lies.

It does contain /mingw/share/automake-1.11, which is a completely different folder. There may be an automake way of fixing this, but I'm not familiar with that. If all your tools are cygwin based (in which case why on earth do you have MinGW installed?), then you could make /mingw/share/automake-1.11 a symbolic link to the proper folder.

$ mkdir -p /mingw/share/
$ ln -s /cygdrive/c/develop/MinGW/share/automake-1.11/automake /mingw/share/automake-1.11

...and to confirm that (as far as cygwin programs are confirmed) this worked:

$ ls /mingw/share/automake-1.11/
bobbogo
  • 14,989
  • 3
  • 48
  • 57
  • it also didn't work for me. anyway, I'm looking for easier ways to achieve my goal (using python CGI scripts). mixing cygwin, mingw, netbeans, libmicrohttpd in a windows enviroment wasn't the best idea. thanks anyway! – toni Mar 05 '13 at 11:27
  • I regularly use cygwin make/sh/perl to build VisualC++/mingw projects. It works well and is easy to install. You do need to know well the mangling of the Windows namespace that cygwin imposes though. (I use the same toolchain on Linux, so the mangling is a good thing™ in my case.) – bobbogo Mar 05 '13 at 13:05