Hi, I’m new to couchbase, and trying to build a simple query tool using C SDK. I’m using community couchbase server version 5.1.1 on my laptop (windows 10), Windows version of C SDK, and Visual Studio 2019.
I included couchbase header and lib/bin(do see libcouchbase.dll in the bin directory) paths in Visual Studio. With that I was able to use header file. But getting the following link time error:
1>------ Rebuild All started: Project: couchbase-query, Configuration: Debug Win32 ------
1>couchbase-query.cpp
1>couchbase-query.obj : error LNK2019: unresolved external symbol __imp__lcb_create referenced in function _main
1>C:\Users\sbtee\source\repos\ConsoleApplication1\Debug\couchbase-query.exe : fatal error LNK1120: 1 unresolved externals
1>Done building project "ConsoleApplication2.vcxproj" -- FAILED.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
============ Here is my code ============
#include <iostream>
#include <libcouchbase/couchbase.h>
int main()
{
lcb_error_t err;
lcb_t instance;
struct lcb_create_st create_options = { 0 };
lcb_CMDSTORE scmd = { 0 };
lcb_CMDGET gcmd = { 0 };
create_options.version = 3;
create_options.v.v3.connstr = "http://127.0.0.1:8091";
create_options.v.v3.username = "Administrator";
create_options.v.v3.passwd = ".....";
err = lcb_create(&instance, &create_options);
}
Thanks