C Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesC Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 4th, 2013, 11:44 PM
jakotheshadows's Avatar
jakotheshadows jakotheshadows is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2009
Posts: 149 jakotheshadows User rank is Sergeant Major (2000 - 5000 Reputation Level)jakotheshadows User rank is Sergeant Major (2000 - 5000 Reputation Level)jakotheshadows User rank is Sergeant Major (2000 - 5000 Reputation Level)jakotheshadows User rank is Sergeant Major (2000 - 5000 Reputation Level)jakotheshadows User rank is Sergeant Major (2000 - 5000 Reputation Level)jakotheshadows User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Days 12 h 1 m 16 sec
Reputation Power: 35
ThreadMentor

I'm trying to get a head start on the rest of my concurrent computing course by getting familiar with ThreadMentor, available here , but I'm having some trouble getting it to work. My professor is one of the authors, but he has a habit of ignoring or deflecting both my emails and questions in class.

What I'm working with at home:
Windows 7 Professional 64-bit
Visual Studio 2010

I've followed the directions in item #7 here

However, when I try to build the "Smoker's Problem" project available here

I get the following linker errors:

Quote:
Error 1 error LNK2019: unresolved external symbol "public: static void __cdecl std::_String_base::_Xran(void)" (?_Xran@_String_base@std@@SAXXZ) referenced in function "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::erase(unsigned int,unsigned int)" (?erase@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@II@Z) C:\Users\Anthony\Documents\Visual Studio 2010\Projects\threadMentorTest\threadMentorTest\ThreadClass.lib(ThreadClass.obj) threadMentorTest

Error 2 error LNK2001: unresolved external symbol "public: static void __cdecl std::_String_base::_Xran(void)" (?_Xran@_String_base@std@@SAXXZ) C:\Users\Anthony\Documents\Visual Studio 2010\Projects\threadMentorTest\threadMentorTest\ThreadClass.lib(mtuStrstream.obj) threadMentorTest

Error 3 error LNK2001: unresolved external symbol "public: static void __cdecl std::_String_base::_Xran(void)" (?_Xran@_String_base@std@@SAXXZ) C:\Users\Anthony\Documents\Visual Studio 2010\Projects\threadMentorTest\threadMentorTest\ThreadClass.lib(ThreadIdMapTable.obj) threadMentorTest

Error 4 error LNK2001: unresolved external symbol "public: static void __cdecl std::_String_base::_Xran(void)" (?_Xran@_String_base@std@@SAXXZ) C:\Users\Anthony\Documents\Visual Studio 2010\Projects\threadMentorTest\threadMentorTest\ThreadClass.lib(ThreadClassException.obj) threadMentorTest

Error 5 error LNK2019: unresolved external symbol "public: static void __cdecl std::_String_base::_Xlen(void)" (?_Xlen@_String_base@std@@SAXXZ) referenced in function "protected: bool __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::_Grow(unsigned int,bool)" (?_Grow@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IAE_NI_N@Z) C:\Users\Anthony\Documents\Visual Studio 2010\Projects\threadMentorTest\threadMentorTest\ThreadClass.lib(ThreadClass.obj) threadMentorTest

Error 6 error LNK2001: unresolved external symbol "public: static void __cdecl std::_String_base::_Xlen(void)" (?_Xlen@_String_base@std@@SAXXZ) C:\Users\Anthony\Documents\Visual Studio 2010\Projects\threadMentorTest\threadMentorTest\ThreadClass.lib(mtuStrstream.obj) threadMentorTest

Error 7 error LNK2001: unresolved external symbol "public: static void __cdecl std::_String_base::_Xlen(void)" (?_Xlen@_String_base@std@@SAXXZ) C:\Users\Anthony\Documents\Visual Studio 2010\Projects\threadMentorTest\threadMentorTest\ThreadClass.lib(ThreadIdMapTable.obj) threadMentorTest

Error 8 error LNK2001: unresolved external symbol "public: static void __cdecl std::_String_base::_Xlen(void)" (?_Xlen@_String_base@std@@SAXXZ) C:\Users\Anthony\Documents\Visual Studio 2010\Projects\threadMentorTest\threadMentorTest\ThreadClass.lib(ThreadClassException.obj) threadMentorTest

Error 9 error LNK2019: unresolved external symbol "private: static void __cdecl std::locale::facet::facet_Register(class std::locale::facet *)" (?facet_Register@facet@locale@std@@CAXPAV123@@Z) referenced in function "public: void __thiscall std::locale::facet::_Register(void)" (?_Register@facet@locale@std@@QAEXXZ) C:\Users\Anthony\Documents\Visual Studio 2010\Projects\threadMentorTest\threadMentorTest\ThreadClass.lib(mtuStrstream.obj) threadMentorTest

Error 10 error LNK2001: unresolved external symbol "long const std::_BADOFF" (?_BADOFF@std@@3JB) C:\Users\Anthony\Documents\Visual Studio 2010\Projects\threadMentorTest\threadMentorTest\ThreadClass.lib(mtuStrstream.obj) threadMentorTest

Error 11 error LNK1120: 4 unresolved externals C:\Users\Anthony\Documents\Visual Studio 2010\Projects\threadMentorTest\Debug\threadMentorTest.exe threadMentorTest


I did manage to catch up with him after class today and explained my problem. He seems to think that it is because I'm using a 64-bit OS, or at least that was my interpretation of what he said. He also has an unfortunate habit of misinterpreting things that I say, and completely missing the point, so is ThreadMentor just not compatible with my environment or is there some extra steps I need to take?

I'm thinking there might be something else I need to do, or do differently, since his directions are for Visual Studio 2005, and I'm using Visual Studio 2010. I appreciate any confirmation of my professor's statements, or tips on how to get this to work on my home machine.

Reply With Quote
  #2  
Old March 5th, 2013, 03:41 PM
BobS0327 BobS0327 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2012
Posts: 118 BobS0327 User rank is Sergeant Major (2000 - 5000 Reputation Level)BobS0327 User rank is Sergeant Major (2000 - 5000 Reputation Level)BobS0327 User rank is Sergeant Major (2000 - 5000 Reputation Level)BobS0327 User rank is Sergeant Major (2000 - 5000 Reputation Level)BobS0327 User rank is Sergeant Major (2000 - 5000 Reputation Level)BobS0327 User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Days 18 h 48 m 29 sec
Reputation Power: 44
It looks like it may be a linker issue. Do you have ThreadClass.lib on your machine? If so, can VS 2010 find it?

Quote:
Category: Linker / Input
Option: Additional Dependencies
Value: ThreadClass.lib

Reply With Quote
  #3  
Old March 5th, 2013, 06:13 PM
jakotheshadows's Avatar
jakotheshadows jakotheshadows is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2009
Posts: 149 jakotheshadows User rank is Sergeant Major (2000 - 5000 Reputation Level)jakotheshadows User rank is Sergeant Major (2000 - 5000 Reputation Level)jakotheshadows User rank is Sergeant Major (2000 - 5000 Reputation Level)jakotheshadows User rank is Sergeant Major (2000 - 5000 Reputation Level)jakotheshadows User rank is Sergeant Major (2000 - 5000 Reputation Level)jakotheshadows User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Days 12 h 1 m 16 sec
Reputation Power: 35
Yes, I did download ThreadClass.lib and followed the instructions I said I followed. Yes, I made sure the paths I input in those directions were correct. As to whether or not Visual Studio can find ThreadClass.lib, I don't know but I do know it is on my machine and that I gave the paths correctly in the directions.

Have you tried and successfully built one of the ThreadMentor tutorial projects in a similar environment, or are you just guessing at the problem?

Reply With Quote
  #4  
Old March 5th, 2013, 08:22 PM
jakotheshadows's Avatar
jakotheshadows jakotheshadows is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2009
Posts: 149 jakotheshadows User rank is Sergeant Major (2000 - 5000 Reputation Level)jakotheshadows User rank is Sergeant Major (2000 - 5000 Reputation Level)jakotheshadows User rank is Sergeant Major (2000 - 5000 Reputation Level)jakotheshadows User rank is Sergeant Major (2000 - 5000 Reputation Level)jakotheshadows User rank is Sergeant Major (2000 - 5000 Reputation Level)jakotheshadows User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Days 12 h 1 m 16 sec
Reputation Power: 35
















Is what I have done. If anyone sees anything I did wrong according to the directions, please let me know. If you can think of anything ELSE I might need to do, that would be great.
Attached Images
File Type: png Linker-Input.png (51.9 KB, 47 views)
File Type: png path.png (25.7 KB, 47 views)
File Type: png threadclass-lib.png (26.9 KB, 46 views)

Reply With Quote
  #5  
Old March 5th, 2013, 08:24 PM
BobS0327 BobS0327 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2012
Posts: 118 BobS0327 User rank is Sergeant Major (2000 - 5000 Reputation Level)BobS0327 User rank is Sergeant Major (2000 - 5000 Reputation Level)BobS0327 User rank is Sergeant Major (2000 - 5000 Reputation Level)BobS0327 User rank is Sergeant Major (2000 - 5000 Reputation Level)BobS0327 User rank is Sergeant Major (2000 - 5000 Reputation Level)BobS0327 User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Days 18 h 48 m 29 sec
Reputation Power: 44
Quote:
Have you tried and successfully built one of the ThreadMentor tutorial projects in a similar environment, or are you just guessing at the problem?


Initially, I just took an educated guess.

Quote:
so is ThreadMentor just not compatible with my environment or is there some extra steps I need to take?


But later, I tried to compile the example and received the same messages. So, I used DumpBin to look at the details of the ThreadClass.lib. They are as follows:

Executing Dumpbin Threadclass.lib /Headers produces the following output:
Code:
Microsoft (R) COFF/PE Dumper Version 10.00.40219.01
Copyright (C) Microsoft Corporation.  All rights reserved.


Dump of file Threadclass.lib

File Type: LIBRARY

FILE HEADER VALUES
             14C machine (x86)
             37E number of sections
        4512CE17 time date stamp Thu Sep 21 13:38:31 2006
           38C11 file pointer to symbol table
             A94 number of symbols
               0 size of optional header
               0 characteristics


The machine parm indicates that it is a 32 bit lib file. The Application Binary Interface (ABI) of a 32 bit and a 64 bit lib file are totally incompatible making it impossible to use a 32 bit lib in a 64 bit environment.
Comments on this post
jakotheshadows agrees: Thanks. Now I know.

Reply With Quote
  #6  
Old March 5th, 2013, 08:30 PM
jakotheshadows's Avatar
jakotheshadows jakotheshadows is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2009
Posts: 149 jakotheshadows User rank is Sergeant Major (2000 - 5000 Reputation Level)jakotheshadows User rank is Sergeant Major (2000 - 5000 Reputation Level)jakotheshadows User rank is Sergeant Major (2000 - 5000 Reputation Level)jakotheshadows User rank is Sergeant Major (2000 - 5000 Reputation Level)jakotheshadows User rank is Sergeant Major (2000 - 5000 Reputation Level)jakotheshadows User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Days 12 h 1 m 16 sec
Reputation Power: 35
I guess the lab machines at school must use a 32-bit Linux, probably because nobody has made a 64-bit version of this particular library that CS majors must use for this required course.

But if that were the case how was I able to do stuff with x86-64 assembler on the lab machines last semester, wouldn't I need to use a 64-bit Linux to do such a thing? Or is Linux somehow different?

Or maybe it doesn't actually work on the lab machines either

Last edited by jakotheshadows : March 5th, 2013 at 08:39 PM.

Reply With Quote
  #7  
Old March 5th, 2013, 11:25 PM
salem's Avatar
salem salem is offline
Contributed User
Click here for more information
 
Join Date: Jun 2005
Posts: 3,831 salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)  Folding Points: 153 Folding Title: Novice Folder
Time spent in forums: 2 Months 3 Weeks 2 Days 13 h 49 m 45 sec
Reputation Power: 1774
Hidden somewhere away under the control of the tutor, there will be a ThreadClass.cpp file used to generate a ThreadClass.lib

Being source code, it would be possible to generate
ThreadClass.lib for x86, 32-bit code for Windows
ThreadClass.lib for x86-64, 64-bit code for Windows
ThreadClass.lib for x86-64, 64-bit code for Linux
ThreadClass.lib for x86, 32-bit code for Linux

It really doesn't matter which architecture the lab machine is, it will have a compatible lib built for it.

The problem for you is that the one you need doesn't exist.

Whether your tutor wants to spend time making the version you want is something you need to discuss with them. But perhaps you could point out to them that you may be the first to want a 64-bit version, but you sure won't be the last.

You're fortunate enough to end up in a fairly enlightened college where different compilers are supported, and perhaps even encouraged. It's the poor souls who have now resort to running TurboC in DosBox who are really being screwed over.
__________________
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper

Reply With Quote
  #8  
Old March 6th, 2013, 08:30 AM
jakotheshadows's Avatar
jakotheshadows jakotheshadows is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2009
Posts: 149 jakotheshadows User rank is Sergeant Major (2000 - 5000 Reputation Level)jakotheshadows User rank is Sergeant Major (2000 - 5000 Reputation Level)jakotheshadows User rank is Sergeant Major (2000 - 5000 Reputation Level)jakotheshadows User rank is Sergeant Major (2000 - 5000 Reputation Level)jakotheshadows User rank is Sergeant Major (2000 - 5000 Reputation Level)jakotheshadows User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Days 12 h 1 m 16 sec
Reputation Power: 35
Quote:
Originally Posted by salem
It's the poor souls who have now resort to running TurboC in DosBox who are really being screwed over.


LOL, where do they do this, in India?

Well, different compilers aren't discouraged, but whenever we submit code it has to work on the lab machines and it has to compile with the compiler the graders will use.

It would be nice to be able to get my code "conceptually done" at home with a nice IDE and GUI debugger before going back to the good 'ol Linux command line.

Last edited by jakotheshadows : March 6th, 2013 at 08:33 AM.

Reply With Quote
  #9  
Old March 6th, 2013, 09:35 AM
clifford's Avatar
clifford clifford is offline
Contributing User
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Aug 2003
Location: UK
Posts: 4,806 clifford User rank is General 12nd Grade (Above 100000 Reputation Level)clifford User rank is General 12nd Grade (Above 100000 Reputation Level)clifford User rank is General 12nd Grade (Above 100000 Reputation Level)clifford User rank is General 12nd Grade (Above 100000 Reputation Level)clifford User rank is General 12nd Grade (Above 100000 Reputation Level)clifford User rank is General 12nd Grade (Above 100000 Reputation Level)clifford User rank is General 12nd Grade (Above 100000 Reputation Level)clifford User rank is General 12nd Grade (Above 100000 Reputation Level)clifford User rank is General 12nd Grade (Above 100000 Reputation Level)clifford User rank is General 12nd Grade (Above 100000 Reputation Level)clifford User rank is General 12nd Grade (Above 100000 Reputation Level)clifford User rank is General 12nd Grade (Above 100000 Reputation Level)clifford User rank is General 12nd Grade (Above 100000 Reputation Level)clifford User rank is General 12nd Grade (Above 100000 Reputation Level)clifford User rank is General 12nd Grade (Above 100000 Reputation Level)clifford User rank is General 12nd Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 2 Days 17 h 19 m 12 sec
Reputation Power: 1800
Quote:
Originally Posted by BobS0327
it impossible to use a 32 bit lib in a 64 bit environment.


It is not about the environment, it is about the build - you cannot link a 32 bit library to 64 bit code perhaps, but I don't believe that stops you building and executing 32 bit code in a 64 bit

Last edited by clifford : March 6th, 2013 at 09:38 AM.

Reply With Quote
  #10  
Old March 6th, 2013, 10:04 AM
jakotheshadows's Avatar
jakotheshadows jakotheshadows is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2009
Posts: 149 jakotheshadows User rank is Sergeant Major (2000 - 5000 Reputation Level)jakotheshadows User rank is Sergeant Major (2000 - 5000 Reputation Level)jakotheshadows User rank is Sergeant Major (2000 - 5000 Reputation Level)jakotheshadows User rank is Sergeant Major (2000 - 5000 Reputation Level)jakotheshadows User rank is Sergeant Major (2000 - 5000 Reputation Level)jakotheshadows User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Days 12 h 1 m 16 sec
Reputation Power: 35
Quote:
Originally Posted by clifford
It is not about the environment, it is about the build - you cannot link a 32 bit library to 64 bit code perhaps, but I don't believe that stops you building and executing 32 bit code in a 64 bit


Do you mean I might be able to build the Smoker's Problem project as 32-bit code and that would solve the problem I'm having?

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesC Programming > ThreadMentor

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap