Closed tulipmotionpicture closed 3 years ago
Have you installed the secp256k1-vrf as per the instructions?
I have not tested it on Windows for a long time. Try to modify these 2 lines on the makefile:
https://github.com/aergoio/aergolite/blob/master/makefile#L24-L25
To be like this:
CFLAGS = -I../libuv/include -I../binn/src -I../secp256k1-vrf/include -DUSE_UV_CALLBACK
LFLAGS = -L../libuv/.libs -L../binn -L../secp256k1-vrf/.libs
The please inform if it works
yes i am sure i did install secp256k1-vrf.
i changed the code as per u instruct but it not fixed
Me@DESKTOP-7T4T8B4 MINGW64 ~/aergolite
gcc -I../libuv/include -I../binn/src -I../secp256k1-vrf/include -DUSE_UV_CALLBACK -DSQLITE_HAS_CODEC -DSQLITE_USE_URI=1 -DSQLITE_ENABLE_JSON1 -DSQLITE_THREADSAFE=1 -DHAVE_USLEEP -DHAVE_STDINT_H -DHAVE_INTTYPES_H -DSQLITE_ENABLE_COLUMN_METADATA -c core/sqlite3.c -o sqlite3.o
In file included from core/sqlite3.c:224043:
core/single_instance.c:56:12: error: conflicting types for ‘LockFile’
56 | static int LockFile(int fd, enum LockOperation lock) {
| ^~~~
In file included from /usr/include/w32api/winbase.h:18,
from /usr/include/w32api/windows.h:70,
from core/sqlite3.c:26169:
/usr/include/w32api/fileapi.h:91:29: note: previous declaration of ‘LockFile’ was here
91 | WINBASEAPI WINBOOL WINAPI LockFile (HANDLE hFile, DWORD dwFileOffsetLow, DWORD dwFileOffsetHigh, DWORD nNumberOfBytesToLockLow, DWORD nNumberOfBytesToLockHigh);
| ^~~~
In file included from core/sqlite3.c:224043:
core/single_instance.c: In function ‘LockFile’:
core/single_instance.c:59:10: warning: implicit declaration of function ‘flock’; did you mean ‘clock’? [-Wimplicit-function-declaration]
59 | return flock(fd, lock == LOCK ? LOCK_EX | LOCK_NB : LOCK_UN);
| ^~~~~
| clock
core/single_instance.c:59:35: error: ‘LOCK_EX’ undeclared (first use in this function); did you mean ‘LOCK’?
59 | return flock(fd, lock == LOCK ? LOCK_EX | LOCK_NB : LOCK_UN);
| ^~~
| LOCK
core/single_instance.c:59:35: note: each undeclared identifier is reported only once for each function it appears in
core/single_instance.c:59:45: error: ‘LOCK_NB’ undeclared (first use in this function); did you mean ‘LOCK’?
59 | return flock(fd, lock == LOCK ? LOCK_EX | LOCK_NB : LOCK_UN);
| ^~~
| LOCK
core/single_instance.c:59:55: error: ‘LOCK_UN’ undeclared (first use in this function); did you mean ‘LOCK’?
59 | return flock(fd, lock == LOCK ? LOCK_EX | LOCK_NB : LOCK_UN);
| ^~~
| LOCK
core/single_instance.c: In function ‘check_single_instance’:
core/single_instance.c:152:12: warning: implicit declaration of function ‘open’; did you mean ‘popen’? [-Wimplicit-function-declaration]
152 | fdLock = open(file_name, O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR);
| ^~~~
| popen
core/single_instance.c:152:28: error: ‘O_WRONLY’ undeclared (first use in this function)
152 | fdLock = open(file_name, O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR);
| ^~~~
core/single_instance.c:152:39: error: ‘O_CREAT’ undeclared (first use in this function); did you mean ‘OF_CREATE’?
152 | fdLock = open(file_name, O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR);
| ^~~
| OF_CREATE
core/single_instance.c:152:48: error: ‘S_IRUSR’ undeclared (first use in this function)
152 | fdLock = open(file_name, O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR);
| ^~~
core/single_instance.c:152:58: error: ‘S_IWUSR’ undeclared (first use in this function)
152 | fdLock = open(file_name, O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR);
| ^~~
core/single_instance.c:158:5: warning: implicit declaration of function ‘close’; did you mean ‘pclose’? [-Wimplicit-function-declaration]
158 | close(fdLock);
| ^~~~~
| pclose
core/sqlite3.c: In function ‘do_log_rotation’:
core/sqlite3.c:230963:7: warning: implicit declaration of function ‘unlink’ [-Wimplicit-function-declaration]
230963 | unlink(this_node->worker_pager->zWalNew);
| ^~
core/sqlite3.c: In function ‘aergolite_store_and_empty_local_db’:
core/sqlite3.c:231287:7: warning: implicit declaration of function ‘mkdir’ [-Wimplicit-function-declaration]
231287 | if (mkdir(folder_path, 0755) != 0) {
| ^~~~~
make: *** [makefile:158: sqlite3.o] Error 1
Are you compiling it on Windows?
It is strange because it appears that your compiler is not setting the _WIN32
preprocessor directive.
If you are using bash, run this:
gcc -dM -E - < /dev/null | grep WIN32
If using Windows console, run this:
echo | gcc -dM -E - | find /i "win"
Also, when pasting the results use code formatting, as I am doing above.
You can try to define it via command line, adding -D_WIN32
in one of those lines you edited in the makefile:
CFLAGS = -I../libuv/include -I../binn/src -I../secp256k1-vrf/include -D_WIN32 -DUSE_UV_CALLBACK
LFLAGS = -L../libuv/.libs -L../binn -L../secp256k1-vrf/.libs
can any one let me know why i encountering the error ----
Me@DESKTOP-7T4T8B4 MINGW64 ~/aergolite
make
gcc -I../libuv/include -I../binn/src -DUSE_UV_CALLBACK -DSQLITE_HAS_CODEC -DSQLITE_USE_URI=1 -DSQLITE_ENABLE_JSON1 -DSQLITE_THREADSAFE=1 -DHAVE_USLEEP -DHAVE_STDINT_H -DHAVE_INTTYPES_H -DSQLITE_ENABLE_COLUMN_METADATA -c core/sqlite3.c -o sqlite3.o In file included from core/sqlite3.c:48379: core/aergolite.h:2:10: fatal error: secp256k1-vrf.h: No such file or directory 2 | #include "secp256k1-vrf.h" | ^
~~~~ compilation terminated. make: *** [makefile:158: sqlite3.o] Error 1