Closed andrewjohnstonn closed 1 year ago
I'll also note my cpp program is literally just:
auto client = sw::redis::Redis("tcp://host:6379")
std::cout << client.ping();
It seems that you didn't finish the install steps, but built with redis-plus-plus' source code? That should not work.
Instead, you should build redis-plus-plus with cmake, and run make install
to install headers and libs. The installation process will do some critical stuff to ensure related headers are installed correctly.
NOTE: redis-plus-plus does not return NULL pointer, it throws exception when error happens.
Regards
No make file is generated on Windows when I cmake .. in the build folder
I also get an error when I run make in the hiredis folder on Windows:
$ make Makefile:102: Extraneous text after `else' directive gcc -std=c99 -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -Wno-missing-field-initializers -g -ggdb -pedantic alloc.c alloc.c:1:0: warning: -fPIC ignored for target (all code is position independent) [enabled by default] alloc.c:40:17: error: 'strdup' undeclared here (not in a function) make: *** [alloc.o] Error 1
If you are using vs2017 or later, you can use the ’open folder’ feature to build both hiredis and redis-plus-plus with buitin cmake support.
Also you can install redis-plus-plus with vcpkg.
Sorry, but I’m not familiar with windows env. If you have problem with building hiredis on windows, you can seek help from hiredis community.
Regards
发件人: Andrew Johnston @.> 发送时间: Tuesday, May 30, 2023 8:07:22 PM 收件人: sewenew/redis-plus-plus @.> 抄送: sewenew @.>; Comment @.> 主题: Re: [sewenew/redis-plus-plus] Redis++ connection returns NULL on Windows (Issue #491)
I also get an error when I run make in the hiredis folder on Windows:
$ make Makefile:102: extraneous text after 'else' directive gcc -std=c99 -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -Wno-missing-field-initializers -g -ggdb -pedantic alloc.c process_begin: CreateProcess(NULL, gcc -std=c99 -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -Wno-missing-field-initializers -g -ggdb -pedantic alloc.c, ...) failed. make (e=2): The system cannot find the file specified. make: *** [Makefile:270: alloc.o] Error 2
― Reply to this email directly, view it on GitHubhttps://github.com/sewenew/redis-plus-plus/issues/491#issuecomment-1568319645, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACWWTAPEOQDKEQECNNFUMOLXIXPHVANCNFSM6AAAAAAYTYR5LA. You are receiving this because you commented.Message ID: @.***>
Hi,
Got it working, you were right I just had to build using Visual Studio I was building manually on VS Code.
Cheers!
I have been trying to build a Redis++ application on Windows but I am still unable to establish a connection with my Redis-server. I'm wondering if anyone has successfully built a CMake application on Windows as I have a feeling it is something in my CMake that is wrong as the provided test passes everything. I have included my CMake below.
Environment: