|
|
 |
| Author |
Message |
JohnRobbins

|
Posted: Visual C++ Express Edition, libcimtd.lib not found |
Top |
I have managed to compile an earlier WTL based program built under VC6 to compile with Express but I have got the following linker errors.
LIBCMTD.lib(stdexcpt.obj) : error LNK2005: "public: __thiscall std::bad_cast::bad_cast(char const *)" ( 0bad_cast@std@@QAE@PBD@Z) already defined in TestConfig.obj
LIBCMTD.lib(stdexcpt.obj) : error LNK2005: "public: __thiscall std::bad_cast::bad_cast(class std::bad_cast const &)" ( 0bad_cast@std@@QAE@ABV01@@Z) already defined in TestConfig.obj
LIBCMTD.lib(stdexcpt.obj) : error LNK2005: "public: virtual __thiscall std::bad_cast::~bad_cast(void)" ( 1bad_cast@std@@UAE@XZ) already defined in TestConfig.obj
LINK : fatal error LNK1104: cannot open file 'libcimtd.lib'
The application is multithreaded and I would like to be able to run it in debug mode. The code uses the new iostream library.
On the property pages, the runtime library is defined as "Multi-threaded Debug (/MTd)"
Should the Express installation have included libcimtd.lib And I am not sure why the linker is invoking libcmtd.lib.
Any help would be appreciated
John Robbins.
Visual Studio Express Editions8
|
| |
|
| |
 |
Jonathan Caves - MSFT

|
Posted: Visual C++ Express Edition, libcimtd.lib not found |
Top |
libcmtd.lib is the static multithreaded debug C runtime library.
libcmitd.lib is the static multithreaded debug C++ old iostreams (iostream.h as opposed to iostream) library - this does library not exist in Visual C++ 8.0. I suspect that there might be a #pragma comment somewhere in your code that is causing the linker to pull in this library - either that or you are linking against an old static library that has a dependency on this file.
|
| |
|
| |
 |
JohnRobbins

|
Posted: Visual C++ Express Edition, libcimtd.lib not found |
Top |
Thanks for your response.
To try and simplify the problem I used the WTL wizard to generate a simple dialog box and then used the Cancel button code to try and invoke a fstream object thus
at the top of maindlg.h I added
#include <fstream>
using namespace std;
I modified OnCancel as follows
LRESULT OnCancel(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
// CloseDialog(wID);
ifstream ifs;
// ifs.open("C:\\Documents and Settings\\John\\My Documents\\Visual Studio 2005\\Projects\\CompilerSettings.txt");
return 0;
The result included the following linker errors
fstream_test.cpp
Linking...
fstream_test.obj : error LNK2019: unresolved external symbol "void __cdecl std::_Xlen(void)" ( _Xlen@std@@YAXXZ) 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> >::append(unsigned int,char)" ( append@ $basic_string@DU $char_traits@D@std@@V $allocator@D@2@@std@@QAEAAV12@ID@Z)
fstream_test.obj : error LNK2019: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ) 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)
fstream_test.obj : error LNK2001: unresolved external symbol "private: static class std::locale::_Locimp * std::locale::_Locimp::_Global" ( _Global@_Locimp@locale@std@@0PAV123@A)
fstream_test.obj : error LNK2001: unresolved external symbol "__int64 const std::_Fpz" ( _Fpz@std@@3_JB)
fstream_test.obj : error LNK2019: unresolved external symbol "protected: void __thiscall std::ios_base::_Addstd(void)" ( _Addstd@ios_base@std@@IAEXXZ) referenced in function "protected: void __thiscall std::basic_ios<char,struct std::char_traits<char> >::init(class std::basic_streambuf<char,struct std::char_traits<char> > *,bool)" ( init@ $basic_ios@DU $char_traits@D@std@@@std@@IAEXPAV $basic_streambuf@DU $char_traits@D@std@@@2@_N@Z)
Debug\fstream_test.exe : fatal error LNK1120: 5 unresolved externals
|
| |
|
| |
 |
nobugz

|
Posted: Visual C++ Express Edition, libcimtd.lib not found |
Top |
For some reason, your project is not linking msvcprtd.lib, the standard DLL import library for the STL classes. Project + properties, Linker, Input, click the Additional Dependencies box, then the '...' button and ensure the "Inherit from parent" checkbox is turned on.
To get the previous problem resolved, put "libcmtd.lib libcimtd.lib" in the Ignore Specific Library box.
|
| |
|
| |
 |
JohnRobbins

|
Posted: Visual C++ Express Edition, libcimtd.lib not found |
Top |
Hi,
Thanks for your response. The "Inherit from parent" was already turned on and I have put your suggested entries into the Ignore Specific Library but all to no avail - I still get the same error messages.
I tried adding #include <iostream> before the #include <ifstream> but that generated even more messages.
I did make a small console app to write to a file and it of course worked fine.
Any more suggestions before I give up I would really like to try and get the stream classes working in this type of application, though.
Thanks
John.
|
| |
|
| |
 |
nobugz

|
Posted: Visual C++ Express Edition, libcimtd.lib not found |
Top |
If you email me the project, I'll take a whack at it. |Monkeytail| = @
|
| |
|
| |
 |
nobugz

|
Posted: Visual C++ Express Edition, libcimtd.lib not found |
Top |
Got your project. I'm sorry to say that I got a clean compile. I had to download WTL, got it from here. I unzipped the archive into vc\wtl and added the vc\wtl\include path to my include folders.
Urm, now that I'm thinking about it, you need ATL to compile WTL.
VC-Express doesn't come with ATL. Sorry, I needed that whack
myself...
|
| |
|
| |
 |
JohnRobbins

|
Posted: Visual C++ Express Edition, libcimtd.lib not found |
Top |
Thanks for taking a look at the code.
The version I sent you had the lines in OnCancel that used fstream commented out as at the time I was even having a problem with the #include line at the top of the file.
Could you please if you have time uncomment the line - maybe make the referenced file something relevant to your system and see if the executable works.
I had included a path in the Addition Include Directories to include "C:\Program Files\Microsoft Platform SDK\Include\atl"
Thanks so much for your help
John Robbins
|
| |
|
| |
 |
nobugz

|
Posted: Visual C++ Express Edition, libcimtd.lib not found |
Top |
Removed
the comments, still no problem. The version of ATL that comes
with the Platform SDK is suitable for 64-bit Windows only. I'm
afraid you'll have to move up to the retail version of VS2005 to do any
WTL programming...
|
| |
|
| |
 |
JohnRobbins

|
Posted: Visual C++ Express Edition, libcimtd.lib not found |
Top |
Thanks for the quick response.
When you compiled and ran the application OK was that with Express or with one of the other IDEs
I started to use Express mainly because there was an article on CodeProject that had got Express working with WTL after changing a couple of lines of code concerning windows thunking. I don't think however the author had used any streams functions though.
The only reason I have been persevering with WTL is that I have quite a large data acquisition application with a lot of graphics that I would hate to have to do all over again.
But maybe I have to.
John.
|
| |
|
| |
 |
nobugz

|
Posted: Visual C++ Express Edition, libcimtd.lib not found |
Top |
I
used VS2005 Professional. I couldn't run the app, some strange
problem with the manifest and it can't find the CRT DLL. I didn't
look into it too much...
|
| |
|
| |
 |
| |
|