# Facing issue with FDB API version

**URL:** <https://forums.foundationdb.org/t/facing-issue-with-fdb-api-version/1301>\
**Category:** Using FoundationDB\
**Created:** [April 11, 2019, 10:53am UTC](https://forums.foundationdb.org/t/facing-issue-with-fdb-api-version/1301 "2019-04-11T10:53:04Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sakthivelpvs](https://avatars.discourse-cdn.com/v4/letter/s/9dc877/32.png) [@sakthivelpvs](https://forums.foundationdb.org/u/sakthivelpvs)\
**Post date:** [April 11, 2019, 10:53am UTC](https://forums.foundationdb.org/t/facing-issue-with-fdb-api-version/1301/1 "2019-04-11T10:53:04Z")

</div>

Hi,  
I have created a C client and configured FDB API version as 20. It is working fine.

I have cross verified the actual version of FDB library and it is 610. I have confirmed this version by calling the FDB API **fdb\_get\_max\_api\_version()** and it returns 610. Passed current FDB API version to **fdb\_select\_api\_version()**.

> fdb\_select\_api\_version(fdb\_get\_max\_api\_version());

Got run time error “**Error (2202): API version not valid**”

Why I’m not able to set current FDB API version in client ?

---

<div class="post-metadata">

**Author:** ![ryanworl](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/ryanworl/32/440_2.png) [@ryanworl](https://forums.foundationdb.org/u/ryanworl)\
**Post date:** [April 11, 2019, 11:22am UTC](https://forums.foundationdb.org/t/facing-issue-with-fdb-api-version/1301/2 "2019-04-11T11:22:53Z")

</div>

The currently released API version is 600. Unless you’ve compiled from source and you’re testing the 6.1 series, you should use 600. If that doesn’t work that would be a different issue to post about 😀

---

<div class="post-metadata">

**Author:** ![ajbeamon](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/ajbeamon/32/13_2.png) [@ajbeamon](https://forums.foundationdb.org/u/ajbeamon)\
**Post date:** [April 11, 2019, 1:44pm UTC](https://forums.foundationdb.org/t/facing-issue-with-fdb-api-version/1301/3 "2019-04-11T13:44:08Z")

</div>

Another thing you can check is that your application isn’t defining a smaller version like so:

```
#define FDB_API_VERSION 600

```

Instead, this header version must be at least as large as the version you choose when calling `fdb_select_api_version`.

---

<div class="post-metadata">

**Author:** ![sakthivelpvs](https://avatars.discourse-cdn.com/v4/letter/s/9dc877/32.png) [@sakthivelpvs](https://forums.foundationdb.org/u/sakthivelpvs)\
**Post date:** [April 12, 2019, 5:48am UTC](https://forums.foundationdb.org/t/facing-issue-with-fdb-api-version/1301/4 "2019-04-12T05:48:35Z")

</div>

@ryanworl,  
I have set the FDB API version as 600 but facing some compilation issues. I have tried to solve it but it doesn’t. Error says “fdb\_future\_is\_error()” function taking 0 arguments but taking 1 argument. I have compiled removing the argument, still facing same issue.  
It’s working fine when I set the API version as 20.

How to solve this issues with latest API version ?

```
fdb_client.c: In function ‘waitAndCheckError’:
fdb_client.c:22:34: error: macro "This_FoundationDB_API_function_is_removed_at_this_FDB_API_VERSION" passed 1 arguments, but takes just 0
     if(fdb_future_is_error(future))
                                  ^
In file included from fdb_client.c:7:0:
../foundationdb/bindings/c/foundationdb/fdb_c.h:53:30: error: ‘This_FoundationDB_API_function_is_removed_at_this_FDB_API_VERSION’ undeclared (first use in this function)
 #define FDB_REMOVED_FUNCTION This_FoundationDB_API_function_is_removed_at_this_FDB_API_VERSION(0)
                              ^
../foundationdb/bindings/c/foundationdb/fdb_c.h:292:36: note: in expansion of macro ‘FDB_REMOVED_FUNCTION’
     #define fdb_future_is_error(x) FDB_REMOVED_FUNCTION
                                    ^
fdb_client.c:22:8: note: in expansion of macro ‘fdb_future_is_error’
     if(fdb_future_is_error(future))
        ^
../foundationdb/bindings/c/foundationdb/fdb_c.h:53:30: note: each undeclared identifier is reported only once for each function it appears in
 #define FDB_REMOVED_FUNCTION This_FoundationDB_API_function_is_removed_at_this_FDB_API_VERSION(0)
                              ^
../foundationdb/bindings/c/foundationdb/fdb_c.h:292:36: note: in expansion of macro ‘FDB_REMOVED_FUNCTION’
     #define fdb_future_is_error(x) FDB_REMOVED_FUNCTION
                                    ^
fdb_client.c:22:8: note: in expansion of macro ‘fdb_future_is_error’
     if(fdb_future_is_error(future))
        ^
fdb_client.c: In function ‘createData’:
fdb_client.c:72:44: error: macro "This_FoundationDB_API_function_is_removed_at_this_FDB_API_VERSION" passed 1 arguments, but takes just 0
         if(fdb_future_is_error(commitFuture)) {
                                            ^
In file included from fdb_client.c:7:0:
../foundationdb/bindings/c/foundationdb/fdb_c.h:53:30: error: ‘This_FoundationDB_API_function_is_removed_at_this_FDB_API_VERSION’ undeclared (first use in this function)
 #define FDB_REMOVED_FUNCTION This_FoundationDB_API_function_is_removed_at_this_FDB_API_VERSION(0)
                              ^
../foundationdb/bindings/c/foundationdb/fdb_c.h:292:36: note: in expansion of macro ‘FDB_REMOVED_FUNCTION’
     #define fdb_future_is_error(x) FDB_REMOVED_FUNCTION
                                    ^
fdb_client.c:72:12: note: in expansion of macro ‘fdb_future_is_error’
         if(fdb_future_is_error(commitFuture)) {

```

Thanks in advance

---

<div class="post-metadata">

**Author:** ![ajbeamon](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/ajbeamon/32/13_2.png) [@ajbeamon](https://forums.foundationdb.org/u/ajbeamon)\
**Post date:** [April 12, 2019, 1:35pm UTC](https://forums.foundationdb.org/t/facing-issue-with-fdb-api-version/1301/5 "2019-04-12T13:35:48Z")

</div>

`fdb_future_is_error` is a function that was removed from the API quite a while ago in version 23. You won’t be able to use it with any modern version, but you can use `fdb_future_get_error` or just any of the future get methods to determine the error state of a future.

In general, it shouldn’t be assumed that a program written for one API version will work correctly in another unmodified. Sometimes there will be changes to the available methods or their signatures, and other times there could be changes to behavior that may not result in compile-time failures. To see what has changed in a version with respect to the API, you can consult the [release notes](https://apple.github.io/foundationdb/release-notes.html).

Lastly, when writing a new program from scratch, it is recommended that you use the latest API version unless you have a specific need to do otherwise. That way you can use the newest features without having to go through multiple versions worth of changes.

---

<div class="post-metadata">

**Author:** ![sakthivelpvs](https://avatars.discourse-cdn.com/v4/letter/s/9dc877/32.png) [@sakthivelpvs](https://forums.foundationdb.org/u/sakthivelpvs)\
**Post date:** [April 16, 2019, 6:53am UTC](https://forums.foundationdb.org/t/facing-issue-with-fdb-api-version/1301/6 "2019-04-16T06:53:11Z")

</div>

Thanks @ajbeamon for your continuous support.

Going to write a new client using latest API calls.
