# Compile error on Netbean IDE

**URL:** <https://discuss.zetetic.net/t/compile-error-on-netbean-ide/2834>\
**Category:** SQLCipher\
**Created:** [May 8, 2018, 2:51am UTC](https://discuss.zetetic.net/t/compile-error-on-netbean-ide/2834 "2018-05-08T02:51:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![heriono](https://avatars.discourse-cdn.com/v4/letter/h/f9ae1b/32.png) [@heriono](https://discuss.zetetic.net/u/heriono)\
**Post date:** [May 8, 2018, 2:51am UTC](https://discuss.zetetic.net/t/compile-error-on-netbean-ide/2834/1 "2018-05-08T02:51:52Z")

</div>

i got error when i compile

undefined reference to `sqlite3\_key’

#ifndef SQLITE\_HAS\_CODEC  
#define SQLITE\_HAS\_CODEC 1  
#endif  
#ifndef SQLITE\_TEMP\_STORE  
#define SQLITE\_TEMP\_STORE 2  
#endif

#include \<sqlite3.h\>

using namespace std;

int main(int argc, char\*\* argv) {  
return 0;  
}

void test\_db(void){  
//INIT DATABSE  
int response\_code;  
//open database  
sqlite3 \* db;  
response\_code = sqlite3\_open(“TestDB.db”, &db);  
response\_code = sqlite3\_key(db, “123”, 3);  
if (response\_code != SQLITE\_OK) {  
fprintf(stderr, “Can’t open database: %s\n”, sqlite3\_errcode(db));  
return;  
}  
//close SQLite3 and deallocation  
sqlite3\_close(db);  
}

---

<div class="post-metadata">

**Author:** ![developernotes](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.zetetic.net/developernotes/32/1309_2.png) [@developernotes](https://discuss.zetetic.net/u/developernotes)\
**Post date:** [May 8, 2018, 1:13pm UTC](https://discuss.zetetic.net/t/compile-error-on-netbean-ide/2834/2 "2018-05-08T13:13:54Z")

</div>

Hi @heriono

Please make sure you include `-DSQLITE_HAS_CODEC` when you compile your application. Also, please see the [introduction](https://www.zetetic.net/sqlcipher/introduction/) from more information.

---

<div class="post-metadata">

**Author:** ![heriono](https://avatars.discourse-cdn.com/v4/letter/h/f9ae1b/32.png) [@heriono](https://discuss.zetetic.net/u/heriono)\
**Post date:** [May 9, 2018, 2:23am UTC](https://discuss.zetetic.net/t/compile-error-on-netbean-ide/2834/3 "2018-05-09T02:23:00Z")

</div>

i was added the cflags but still error. I see -lcrypto parameter, what mean?

this one -lcrypto from openssl?

---

<div class="post-metadata">

**Author:** ![heriono](https://avatars.discourse-cdn.com/v4/letter/h/f9ae1b/32.png) [@heriono](https://discuss.zetetic.net/u/heriono)\
**Post date:** [May 9, 2018, 6:22am UTC](https://discuss.zetetic.net/t/compile-error-on-netbean-ide/2834/4 "2018-05-09T06:22:40Z")

</div>

Successfully.  
Finally i did to compile my netbean project with sqlcipher, my missing is

“The Sqlcipher libs do not installed to global but /usr/local, so netbean can’t read existing libs while compiling”  
i fixed with reinstalling sqlcipher with command

./configure --enable-tempstore=yes CFLAGS="-DSQLITE\_HAS\_CODEC" LDFLAGS="-lcrypto" **–prefix=/usr/**  
make  
make install

i added prefix. Now, i start journey with sqlcipher. Thank’s guy.

---

<div class="post-metadata">

**Author:** ![developernotes](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.zetetic.net/developernotes/32/1309_2.png) [@developernotes](https://discuss.zetetic.net/u/developernotes)\
**Post date:** [May 9, 2018, 12:59pm UTC](https://discuss.zetetic.net/t/compile-error-on-netbean-ide/2834/5 "2018-05-09T12:59:55Z")

</div>

Hello @heriono,

> [@heriono](#):
>
> i was added the cflags but still error. I see -lcrypto parameter, what mean?

That is for linking against the OpenSSL libcrypto library.

> [@heriono](#):
>
> i added prefix. Now, i start journey with sqlcipher. Thank’s guy.

Excellent, we are happy to hear you were able to compile the library!
