OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

Compile on Release error: LNK2001 OpenThreads::Atomic::operator++


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> Build system [build]
View previous topic :: View next topic  
Author Message
Fawkes
Newbie


Joined: 14 Apr 2015
Posts: 16

PostPosted: Wed Jun 24, 2015 10:24 pm    Post subject:
Compile on Release error: LNK2001 OpenThreads::Atomic::operator++
Reply with quote

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_??EAtomic@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
Back to top
View user's profile Send private message
scrawl
Appreciator


Joined: 14 Dec 2014
Posts: 170

PostPosted: Thu Jun 25, 2015 12:30 am    Post subject:
Reply with quote

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
Back to top
View user's profile Send private message
Fawkes
Newbie


Joined: 14 Apr 2015
Posts: 16

PostPosted: Thu Jun 25, 2015 7:24 am    Post subject:
Reply with quote

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?

When I look in my OSG folder where VS has built the lib "OpenThreads.dll" and the debug version "OpenThreadsd.lib" is there.

it looks like the problem came up some time ago: http://forum.openscenegraph.org/viewtopic.php?t=1746&view=next

I`m using Qt Creator and I´m not sure if I understand what I can do to stop that error. Linking OpenThreads.lib to my project does not help.
...


Thanks for helping me...

Cheers,
Christian
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> Build system [build] All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts Please test OpenSceneGraph master in ... robertosfield General 0 Thu Mar 23, 2017 11:23 am View latest post
No new posts Error building terrain with shapefile... robertosfield VirtualPlanetBuilder [vpb] 0 Mon Feb 06, 2017 9:11 am View latest post
No new posts Error building terrain with shapefile... vinothrajendran4 VirtualPlanetBuilder [vpb] 0 Mon Feb 06, 2017 6:24 am View latest post
No new posts WG: Fix for DICOM plugin (DCMTK) : co... robertosfield Submission 0 Wed Dec 21, 2016 4:03 pm View latest post
No new posts OpenThreads Pthread.cpp fails to comp... crubel@compro.net Submission 3 Tue Nov 29, 2016 9:26 pm View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP