Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

code compilation failing on make #5

Open
pradeepkarnam opened this issue Feb 24, 2023 · 6 comments
Open

code compilation failing on make #5

pradeepkarnam opened this issue Feb 24, 2023 · 6 comments

Comments

@pradeepkarnam
Copy link

Hello,

Build compilation terminating with below error,

cd /home/user/Desktop/Devops/Apache_exporter/mod_prometheus_status-0.3.0/cmd/mod_prometheus_status
TERM='dumb' CGO_LDFLAGS='"-g" "-O2"' /usr/lib/golang/pkg/tool/linux_amd64/cgo -objdir $WORK/b001/ -importpath command-line-arguments -exportheader=$WORK/b001/_cgo_install.h -- -I $WORK/b001/ -g -O2 -I/usr/include/httpd -I/usr/include/apache2 -I/usr/include/apr-1 -I/usr/include/apr-1.0 ./module.go

command-line-arguments

cmd/mod_prometheus_status/module.go:10:19: fatal error: httpd.h: No such file or directory
#include <httpd.h>
^
compilation terminated.
make: *** [mod_prometheus_status_go.so] Error 2

@pradeepkarnam pradeepkarnam changed the title Build failing on executing make code compilation failing on make Feb 24, 2023
@sni
Copy link
Contributor

sni commented Feb 24, 2023

Seems like you are missing the apache header files. On debian/ubuntu this is the apache2-dev package.

@pradeepkarnam
Copy link
Author

Hello @sni ,

I am trying to install on Centos7 and I have installed apache2.4.37 in /opt directory. apache service is up and running

@sni
Copy link
Contributor

sni commented Mar 1, 2023

You could try to set the C_INCLUDE_PATH then.

@pm0u
Copy link

pm0u commented Mar 13, 2024

Having this issue as well on MacOS in a docker environment. I had read that XCode can solve the issue in this environment but have not had luck, I think this suggestion would not actually work in this context. We are installing the apache2-dev package in a previous step in our docker file.

@sni
Copy link
Contributor

sni commented Mar 13, 2024

never tried to build this on a mac yet tbh... Are you building the module for a apache on a mac?

@pm0u
Copy link

pm0u commented Mar 13, 2024

never tried to build this on a mac yet tbh... Are you building the module for a apache on a mac?

The docker image is a linux environment and the host machine is an M2 mac, sorry that was confusing. This was not working at all with homebrew installs (brew install docker, brew install docker-compose). I switched to the official docker desktop app and the error completely went away, not really sure why. It seemed like there must have been some intermingling of environments (or maybe I missed some docker setup steps).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants