# onesdk\_initialize linkage error in Open SDK for C

**URL:** <https://community.dynatrace.com/t/onesdk-initialize-linkage-error-in-open-sdk-for-c/18621>\
**Category:** Open Q&A\
**Tags:** oneagent-sdk\
**Created:** [November 29, 2018, 2:13am UTC](https://community.dynatrace.com/t/onesdk-initialize-linkage-error-in-open-sdk-for-c/18621 "2018-11-29T02:13:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hiroshi\_aoki](https://avatars.discourse-cdn.com/v4/letter/h/258eb7/32.png) [@hiroshi\_aoki](https://community.dynatrace.com/u/hiroshi_aoki)\
**Post date:** [November 29, 2018, 2:13am UTC](https://community.dynatrace.com/t/onesdk-initialize-linkage-error-in-open-sdk-for-c/18621/1 "2018-11-29T02:13:43Z")

</div>

When I compile and linkage my test program with Open SDK for C, I encounter linkage error of onesdk\_xxx() and I don’t have any ideas why the error happens. Is there any advice to address the rror.

 ![18987-%E7%84%A1%E9%A1%8C.jpg](https://global.discourse-cdn.com/dynatrace/original/3X/3/3/339cf3408e73a47f0e308800afb1b54120652265.jpeg)

---

<div class="post-metadata">

**Author:** ![christian\_neumu](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/christian_neumu/32/41778_2.png) [@christian\_neumu](https://community.dynatrace.com/u/christian_neumu)\
**Post date:** [December 3, 2018, 10:27am UTC](https://community.dynatrace.com/t/onesdk-initialize-linkage-error-in-open-sdk-for-c/18621/2 "2018-12-03T10:27:56Z")

</div>

Hello,

There could be two reasons for this error: First, even if you use 64 Bit Windows, the compiler could default to 32 bit. You can try if linking succeeds when using the windows-x86\_32 library directory.

Second, the reason could be that you use gcc on Windows, which we do not really support.

EDIT: Also, do not link both onesdk\_shared and onesdk\_static but only one of them (preferably only onesdk\_static).

---

<div class="post-metadata">

**Author:** ![ryo\_itamoto](https://avatars.discourse-cdn.com/v4/letter/r/f1d935/32.png) [@ryo\_itamoto](https://community.dynatrace.com/u/ryo_itamoto)\
**Post date:** [December 4, 2018, 8:57am UTC](https://community.dynatrace.com/t/onesdk-initialize-linkage-error-in-open-sdk-for-c/18621/3 "2018-12-04T08:57:14Z")

</div>

[@Christian N.](https://answers.dynatrace.com/users/22952/view.html)

Hello Christian,

\>Second, the reason could be that you use gcc on Windows, which we do not really support.

Is this mean Open SDK for C windows library compiled by C++(g++)?

---

<div class="post-metadata">

**Author:** ![christian\_neumu](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/christian_neumu/32/41778_2.png) [@christian\_neumu](https://community.dynatrace.com/u/christian_neumu)\
**Post date:** [December 4, 2018, 9:21am UTC](https://community.dynatrace.com/t/onesdk-initialize-linkage-error-in-open-sdk-for-c/18621/4 "2018-12-04T09:21:39Z")

</div>

Hello,

First, this is not called Open SDK but OneAgent SDK for C/C++ (sorry for being nitpicky, but we have to be careful here to avoid confusion with similarly named APIs). (EDIT: I see now that this was already in the title, I just noticed it now)

And no, the SDK binaries provided are not compiled with g++. For Windows, they are compiled with the Microsoft Visual Studio C/C++ Compiler (“MSVC”) in C mode. For Linux, they are indeed compiled with gcc. These are also the only combinations the SDK is tested with. Using the SDK with gcc on Windows (with the correct 32 or 64 bit library) may happen to work but is not supported.

---

<div class="post-metadata">

**Author:** ![ryo\_itamoto](https://avatars.discourse-cdn.com/v4/letter/r/f1d935/32.png) [@ryo\_itamoto](https://community.dynatrace.com/u/ryo_itamoto)\
**Post date:** [December 6, 2018, 2:39am UTC](https://community.dynatrace.com/t/onesdk-initialize-linkage-error-in-open-sdk-for-c/18621/5 "2018-12-06T02:39:28Z")

</div>

Hello,

I have understood about what compiler is used.

Thank you for the information.
