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 

error LNK2019: unresolved external symbol "__declspec(dllimport)


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> Build system [build]
View previous topic :: View next topic  
Author Message
manish8892 (manish Choudhary)
User


Joined: 07 Aug 2009
Posts: 41

PostPosted: Wed Nov 04, 2009 10:28 am    Post subject:
error LNK2019: unresolved external symbol "__declspec(dllimport)
Reply with quote

Hi,

I'm trying to build osg project. I'm having some problems during linking time :-
1>Linking...

1>AutoTransform.obj :


error LNK2019: unresolved external symbol "__declspec(dllimport) bool __cdecl osgDB::writeImageFile(class osg::Image const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class osgDB::ReaderWriter::Options const *)" (__imp_?writeImageFile@osgDB@@YA_NABVImage@osg@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PBVOptions@ReaderWriter@1@@Z) referenced in function "bool __cdecl osgDB::writeImageFile(class osg::Image const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?writeImageFile@osgDB@@YA_NABVImage@osg@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)



1>AutoTransform.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class osgDB::ReaderWriter::Options * __thiscall osgDB::Registry::getOptions(void)" (__imp_?getOptions@Registry@osgDB@@QAEPAVOptions@ReaderWriter@2@XZ) referenced in function "bool __cdecl osgDB::writeImageFile(class osg::Image const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?writeImageFile@osgDB@@YA_NABVImage@osg@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)




1>AutoTransform.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class osgDB::Registry * __cdecl osgDB::Registry::instance(bool)" (__imp_?instance@Registry@osgDB@@SAPAV12@_N@Z) referenced in function "bool __cdecl osgDB::writeImageFile(class osg::Image const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?writeImageFile@osgDB@@YA_NABVImage@osg@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)




1>AutoTransform.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class osg::Image * __cdecl osgDB::readImageFile(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class osgDB::ReaderWriter::Options const *)" (__imp_?readImageFile@osgDB@@YAPAVImage@osg@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PBVOptions@ReaderWriter@1@@Z) referenced in function "class osg::Image * __cdecl osgDB::readImageFile(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?readImageFile@osgDB@@YAPAVImage@osg@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)


1>C:\OSG\Program\AutoTransform\Debug\AutoTransform.exe : fatal error LNK1120: 4 unresolved externals
[/code/]

What is wrong?




Thank you!

Cheers,
manish
Back to top
View user's profile Send private message
Vincent.B
Forum Moderator


Joined: 05 Jan 2009
Posts: 428
Location: Toulouse, France

PostPosted: Wed Nov 04, 2009 10:30 am    Post subject:
error LNK2019: unresolved external symbol "__declspec(dllimport)
Reply with quote

Hi Manish

Did you add osgDB.lib in the linker input ?

Vincent.

manish Choudhary a écrit :
Quote:
Hi,

I'm trying to build osg project. I'm having some problems during linking time :-
1>Linking...

1>AutoTransform.obj :


error LNK2019: unresolved external symbol "__declspec(dllimport) bool __cdecl osgDB::writeImageFile(class osg::Image const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class osgDB::ReaderWriter::Options const *)" (__imp_?writeImageFile@osgDB@@YA_NABVImage@osg@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PBVOptions@ReaderWriter@1@@Z) referenced in function "bool __cdecl osgDB::writeImageFile(class osg::Image const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?writeImageFile@osgDB@@YA_NABVImage@osg@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)



1>AutoTransform.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class osgDB::ReaderWriter::Options * __thiscall osgDB::Registry::getOptions(void)" (__imp_?getOptions@Registry@osgDB@@QAEPAVOptions@ReaderWriter@2@XZ) referenced in function "bool __cdecl osgDB::writeImageFile(class osg::Image const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?writeImageFile@osgDB@@YA_NABVImage@osg@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)




1>AutoTransform.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class osgDB::Registry * __cdecl osgDB::Registry::instance(bool)" (__imp_?instance@Registry@osgDB@@SAPAV12@_N@Z) referenced in function "bool __cdecl osgDB::writeImageFile(class osg::Image const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?writeImageFile@osgDB@@YA_NABVImage@osg@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)




1>AutoTransform.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class osg::Image * __cdecl osgDB::readImageFile(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class osgDB::ReaderWriter::Options const *)" (__imp_?readImageFile@osgDB@@YAPAVImage@osg@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PBVOptions@ReaderWriter@1@@Z) referenced in function "class osg::Image * __cdecl osgDB::readImageFile(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?readImageFile@osgDB@@YAPAVImage@osg@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)


1>C:\OSG\Program\AutoTransform\Debug\AutoTransform.exe : fatal error LNK1120: 4 unresolved externals
[/code/]

What is wrong?




Thank you!

Cheers,
manish

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









__________ Information from ESET NOD32 Antivirus, version of virus signature database 4571 (20091104) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com




------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
myrina
Newbie


Joined: 02 Feb 2011
Posts: 15

PostPosted: Thu Apr 14, 2011 2:29 pm    Post subject:
Reply with quote

Hi, I am also getting a similar error for another lib, although I have added it at the linker input, when I build I get:

libboost_system-vc90-mt.lib(error_code.obj) : error LNK2019: unresolved external symbol __imp___invalid_parameter_noinfo referenced in function "public: virtual class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall `anonymous namespace'::system_error_category::message(int)const " (?message@system_error_category@?A0xa386b881@@UBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@H@Z)

I found somewhere that this can be solved if we remove the msvcrt.lib from the Ignore Specific Library in Linker Input. I did that, but then although it builds, and I just get a warning:
warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library

But my project throws an exception:
Unhandled exception at 0x7c812afb in Template.exe: Microsoft C++ exception: std::bad_alloc at memory location 0x0012f32c..

And breaks at the file malloc.c at the command:
return HeapAlloc(_crtheap, 0, size ? size : 1);

I also found somewhere else to check the C/C++ -> Code Generation ->Runtime Library to be set Multi-threaded Debug DLL (/MDd) for Debug Mode and the equivalent for Release, and checked both my project, and the OSG installation project I used, and they are both set the same as this, so it's not that...

Does anyone have any other idea of how I could solve this error LNK2019: unresolved external symbol ?

Thank you!

Anastasia
Back to top
View user's profile Send private message
Chris 'Xenon' Hanson
Guest





PostPosted: Thu Apr 14, 2011 2:46 pm    Post subject:
error LNK2019: unresolved external symbol "__declspec(dllimport)
Reply with quote

On 4/14/2011 8:29 AM, Anastasia Papas wrote:
Quote:
Hi, I am also getting a similar error for another lib, although I have added it at the linker input, when I build I get:
Unhandled exception at 0x7c812afb in Template.exe: Microsoft C++ exception: std::bad_alloc at memory location 0x0012f32c..

This almost 100% means you're mixing code compiled as debug with release code.

Go back and re-check all of your inputs, if you're using any pre-compiled libraries. If
you're compiling everything from scratch, check your debug/release settings of _everything_.

--
Chris 'Xenon' Hanson, omo sanza lettere. http://www.alphapixel.com/
Digital Imaging. OpenGL. Scene Graphs. GIS. GPS. Training. Consulting. Contracting.
"There is no Truth. There is only Perception. To Perceive is to Exist." - Xen


------------------
Post generated by Mail2Forum
Back to top
myrina
Newbie


Joined: 02 Feb 2011
Posts: 15

PostPosted: Thu Apr 14, 2011 4:39 pm    Post subject:
Reply with quote

WOW! Silly me :-/ I am such a newbie Very Happy

I was using all of the libs in both modes (e.g. osg.lib and osgd.lib) I guess I shouldn't have had!!

I removed the ones without -d in the ending, and now everything links, compiles and RUNS!! Well until next bug comes across Wink

Thank you so much!!!
Back to top
View user's profile Send private message
PlotPath
Newbie


Joined: 14 Jun 2011
Posts: 7

PostPosted: Fri Jun 17, 2011 5:23 pm    Post subject:
Reply with quote

Myrina,

It is kind of funny how in all of these lines of code we can get lost by one simple symbol. The reason I am replying is because I dealt with the exact same thing between osg and osgd, while not in the exact same scenario because I was porting everything through VMWare. Have you had any issues since moving forward this information would be really helpful for me as I try to secure one of these IT jobs I have seen listed as of late.
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 osgconv "noTriStripPolygons"... KariR General 2 Tue Sep 12, 2017 1:50 pm View latest post
No new posts Compile error with Visual Studio 2017 draccagni General 2 Sat Aug 19, 2017 1:52 pm View latest post
No new posts How to change "field of view&quo... gambr General 3 Mon Aug 07, 2017 1:37 pm View latest post
No new posts EXTERNAL: Forum Cary, Karl A. General 1 Wed Jul 12, 2017 3:28 pm View latest post
No new posts PHPBB ERROR: A Closer Look, and Why Steal General 0 Mon Jul 10, 2017 11:03 am 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