LNK2028 and LNK2019 errors with MQSeries 6 in unmanaged c++ code in VS C++ 2005

I have 2 unmanaged C++ functions that are attempting to put and get from a websphere 6 mq local queue.    Everything in my program links ok except for the functions related to MQ.
Two examples of errors are:
error LNK2028: unresolved token (0A0003A8) "public: virtual __thiscall ImqMgr::~ImqMgr(void)" (??1ImqMgr@@$$FUAE@XZ) referenced in function "public: void __thiscall ImqMgr::`vbase destructor'(void)" (??_DImqMgr@@$$FQAEXXZ)      FEPAdapterMain.obj      
and
error LNK2019: unresolved external symbol "public: virtual __thiscall ImqErr::~ImqErr(void)" (??1ImqErr@@$$FUAE@XZ) referenced in function "public: void __thiscall ImqMgr::`vbase destructor'(void)" (??_DImqMgr@@$$FQAEXXZ)      FEPAdapterMain.obj      

I have spent two days going through every forum imaginable...and nothing seems to resolve the issue.
I have not posted to many forums..so please let me know what additional information you need to help me with this problem.  I would really appreciate the help.

fraeliz8Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

phoffricCommented:
Not familiar with websphere; but I'll take a guess. Do you have an interface with virtual destructors ImqMgr::~ImqMgr(), but in some derived class (possibly multiple levels down), maybe you did not implement a virtual destructor for that derived class?
0
fraeliz8Author Commented:
Thanks so much for answering phoffric.... here is the latest based on your comment and some others I received from other internal technical folks:

Since i have what should be all unmanaged functions: in my Visual C++ project (meaning the following wraps around both .cpp modules:)

#ifdef _MANAGED
#pragma managed(push, off)
#endif

#ifdef _MANAGED
#pragma managed(pop)
#endif

1. I have changed    /clr  (Common Language Runtime support)   to No Common Language Runtime Support
2. I have changed Runtime Library from /MT to /MDd  
3.Added what I think are virtual destructors to header file (class) and .cpp file.
(this last one seemed to have no effect. Did this after the LNK2028 had already gone away)

THe LNK 2028 errors have gone away and remain with LNK2019 (31 errors)   smilar to the following pair:
* Error 23 error LNK2019: unresolved external symbol "public: __thiscall ImqMgr::ImqMgr(void)" (??0ImqMgr@@QAE@XZ) referenced in function "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall FEPMain::GetQueue(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?GetQueue@FEPMain@@QAE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V23@0@Z)      FEPAdapterMain.obj      

* Error 26 error LNK2019: unresolved external symbol "public: virtual __thiscall ImqMgr::~ImqMgr(void)" (??1ImqMgr@@UAE@XZ) referenced in function "public: void __thiscall ImqMgr::`vbase destructor'(void)" (??_DImqMgr@@QAEXXZ)      FEPAdapterMain.obj      


**************************************************
and  the final error mentions 26 unresolved externals:
Error      32      fatal error LNK1120: 26 unresolved externals      C:\Facets\TRG_461\Applications\Meta\FEP\FEPAdapter\Debug\FEPAdapterWrapperCPP2.dll      
similar to:

This used to be  27 unresolved externals..and quite frankly I'm not sure what caused the decrease by 1 : )

0
fraeliz8Author Commented:
One more thing.  When i comment out all code related to websphere MQ... the project builds wih  out error.  I just left in the shell of the functions and commented out all code except for one declare and a return statement.
0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

phoffricCommented:
Is this correct?
LNK2019: In your FEPAdapterMain.cpp file  is FEPMain::GetQueue() method, which has a ImqMgr object defined (which invokes the ImqMgr constructor). In FEPAdapterMain.cpp is an #include statement in which the ImqMgr constructor is declared.

If correct, then where is the ImqMgr constructor defined, in source code that you compile and link in?
0
phoffricCommented:
>> LNK2019: unresolved external symbol  ImqMgr::~ImqMgr referenced in ... FEPAdapterMain.obj
>> Added ... virtual destructors to header file (class) and .cpp file
Is it true that class(es) in FEPAdapterMain is(are) derived from ImqMgr? If so, you added virtual destructor(s) in them, right? You can post your code (or snippets) if you wish.

============

Some generic advice:

In reviewing these errors online, I see that some recommendations is to start fresh. Sometimes this advice is necessary because VS gets hosed (when even clean does not work, and even after you manually clean out what clean fails to remove as I have seen this myself).

Even if VS is not hosed (as it has been for me on a few occasions), a fresh start can help.
Have you tried creating a new workspace and project with just the most basic main() program you can come up with (preferably, one right out of the manual - a MQ Hello World)? It should include only a minimal amount of code related to websphere MQ right out of the documentation. Then build upon this "working build" one step at a time adding the problematic function/method calls. This may help identify the single step that causes a good build to yield the errors you are seeing.

============

I see from your recent comment that the problem lies in dll - not my bailiwick. If you make no further progress, let me know, and I'll see if I can find some additional support for you.

============

Some additional references for: websphere MQ LNK2019 error (you may have seen these as you have already taken some of the advice).

http://www-01.ibm.com/support/docview.wss?uid=swg21109469

http://www.ibm.com/developerworks/forums/thread.jspa?threadID=108480
http://social.msdn.microsoft.com/forums/en-US/vcgeneral/thread/9dcad286-0afe-4ab0-8156-af9e0e8294e4
0
cupCommented:
Looks like the code for ImqMgr is not linked in.
0
phoffricCommented:
From the link above:    "try adding mqm.lib to the link"
Did you verify that mqm.lib is in your link?
0
fraeliz8Author Commented:
I really do appreciate all the assistance......really do.   Not sure how I provide credit...i see you guys get points for things solved etc....and you did partially help me.

Well..... went to the IBM maintenance contract....and it seems you guys were on the right path... something was not linked in...turned out to be that i needed
Added two of the below to additional dependencies in the link.... and it built.  I guess just supplying the path containing these was not enough.

imqb23vn.lib.... this is base
(imqb13vn.lib is needed whether just running the client (like our meta frames with the environment Variable, or actually on the box with the mq server.

Then one of the following.
imqs23vn.lib....  use this one for server

imqc23vn.lib....  use this one for client
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
phoffricCommented:
I think your last post which provided the complete solution should be the accepted solution since that information will provide a good source of information for the PAQ. Then assign points to other posts which also assist the question which, in your opinion, will also help the PAQ.
0
phoffricCommented:
>> and you did partially help me
I see you gave us 0 points. You are able to provide points for partial help. Do you know how to do this?
0
phoffricCommented:
Recommend splitting points since author said "you did partially help me"; and the supplied answers may be useful for the PAQ.
0
cupCommented:
I don't think I helped at all so if you are awarding any points, give them to phorffric.
0
phoffricCommented:
Recommend points for http:#33434958 and http:#33435632
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual C++.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.