Discussion:
[osg-users] [build] Compile on Release error: LNK2001 OpenThreads::Atomic::operator++
Christian Kunz
2015-06-24 22:24:29 UTC
Permalink
Hi everyone,

I try to build a release version of my program with Qt Creator.
In debug mode everything compiles just fine. But when I switch to Release
mode I got several of these errors:

robotnodecallback.obj:-1: error: LNK2001: unresolved external symbol ""__declspec(dllimport) public: unsigned int __cdecl OpenThreads::Atomic::operator++(void)" (__imp_??***@OpenThreads@@QEAAIXZ)".

I used VS2013 and OSG 3.2.1. Compilation of sources worked fine. Looks like everything ok with that. I had no errors.

I am not using Openthreads in my program. Neither did I checked the option USE OPENTHREADS WITH QT in cmake.

So what could be the problem?

Thanks for your help.

...


Thank you!

Cheers,
Christian

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=64184#64184
Jannik Heller
2015-06-25 00:30:29 UTC
Permalink
Hi,

AFAIK all OSG applications must link to OpenThreads. Even if you are not using it directly, you might be calling an inlined OSG function that uses OpenThreads.

Are you using CMake in your project? If you do, then ${OPENSCENEGRAPH_LIBRARIES} should include the OpenThreads library by default.

Cheers,
Jannik

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=64187#64187
Christian Kunz
2015-06-25 07:24:18 UTC
Permalink
Hi,

I´m using cmake 3.1.0 to create my Visual Studio 2013 files, then I compile it. Can you explain in little more detail what I need to change or where to add "${OPENSCENEGRAPH_LIBRARIES}". I don´t find an option to check when I clicked generate in cmake. Or do I need to add this parameter in a configuration file of cmake?
...


Thanks for helping me...

Cheers,
Christian

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=64189#64189

Loading...