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

Cannot compile from master: sqlite3.h: no such file or directory #1354

Closed
HatBeardMe opened this issue Jan 20, 2018 · 15 comments
Closed

Cannot compile from master: sqlite3.h: no such file or directory #1354

HatBeardMe opened this issue Jan 20, 2018 · 15 comments

Comments

@HatBeardMe
Copy link

Having issues installing ossec server on new amazon ubuntu 16.04 instance.
Tried installing via released tar (2.9.3) and it installed, but did not register a listener on 1514.
So, finding an old related issue #1061 and PR #1259 (merged), tried installing via cloning master (after cleanup of older install attempts).
Getting the following error:

In file included from analysisd/analysisd.c:44:0:
analysisd/syscheck-sqlite.h:1:21: fatal error: sqlite3.h: No such file or directory
compilation terminated.
Makefile:1135: recipe for target 'analysisd/analysisd-live.o' failed
make: *** [analysisd/analysisd-live.o] Error 1

 Error 0x5.
 Building error. Unable to finish the installation.

It appears that it is looking to include sqlite3.h in src/analysisd/syscheck-sqlite.h however that file is not included when cloning master branch.

as an aside, I have cloned a couple of tags and branches, they seem to build fine, but I still have issues with 1514 not listening.

@ddpbsd
Copy link
Member

ddpbsd commented Jan 20, 2018

Not sure about your 1514 issue, you didn't provide any details. But master now requires sqlite. Maybe I'll ifdef it so people don't have to install sqlite, but I'd rather not at this point.

@testerrrrrr
Copy link

I am facing same issue.

@testerrrrrr
Copy link

5- Installing the system

  • Running the Makefile
    cd external/lua/ && make posix
    make[1]: Entering directory '/home/stg03/ossec-hids/src/external/lua-5.2.3'
    cd src && make posix
    make[2]: Entering directory '/home/stg03/ossec-hids/src/external/lua-5.2.3/src'
    make all SYSCFLAGS="-DLUA_USE_POSIX"
    make[3]: Entering directory '/home/stg03/ossec-hids/src/external/lua-5.2.3/src'
    make[3]: Nothing to be done for 'all'.
    make[3]: Leaving directory '/home/stg03/ossec-hids/src/external/lua-5.2.3/src'
    make[2]: Leaving directory '/home/stg03/ossec-hids/src/external/lua-5.2.3/src'
    make[1]: Leaving directory '/home/stg03/ossec-hids/src/external/lua-5.2.3'
    CC analysisd/analysisd-live.o
    In file included from analysisd/analysisd.c:44:0:
    analysisd/syscheck-sqlite.h:1:21: fatal error: sqlite3.h: No such file or directory
    compilation terminated.
    Makefile:1135: recipe for target 'analysisd/analysisd-live.o' failed
    make: *** [analysisd/analysisd-live.o] Error 1

Error 0x5.
Building error. Unable to finish the installation.

root@ubuntu:/home/stg03/ossec-hids#

@ddpbsd
Copy link
Member

ddpbsd commented Feb 12, 2018

@testerrrrrr Did you install the sqlite package?

Pull request #1364 makes this unnecessary, as the feature will be optional.

@testerrrrrr
Copy link

Yes, I have installed sqlite package, still getting the error, I have downloaded the latest one from master branch.

@ddpbsd
Copy link
Member

ddpbsd commented Feb 12, 2018

@testerrrrrr Which distro are you using?

@testerrrrrr
Copy link

Distributor ID: Ubuntu
Description: Ubuntu 16.04.3 LTS
Release: 16.04
Codename: xenial

@ddpbsd
Copy link
Member

ddpbsd commented Feb 12, 2018

Ok, I'll try to test it out.

@testerrrrrr
Copy link

Thank you,

@nbuuck
Copy link
Contributor

nbuuck commented Feb 12, 2018

Perhaps the associated lib package is required when compiling? https://packages.ubuntu.com/xenial/libsqlite3-dev

I only mention this because the comments on this issue could be interpreted as you having installed sqlite but not the development package needed for linking to sqlite3.h.

@testerrrrrr
Copy link

@nbuuck Yes, It worked !!

Thanks a lot, I just installed libsqlite3-dev and it worked like a charm.

Thanks again.

@ddpbsd
Copy link
Member

ddpbsd commented Feb 12, 2018

It looks like Ubuntu needs libsqlite3-dev
EDIT: oh darnit, late again :-D

@testerrrrrr
Copy link

Correct.

@ddpbsd
Copy link
Member

ddpbsd commented Feb 12, 2018

I've added these packages to the documention (ossec/ossec-docs#237) pull request.

@ddpbsd ddpbsd closed this as completed Feb 12, 2018
@alansmid
Copy link

@nbuuck Thank you!

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

5 participants