Author Topic: Using C::B with VS 2005 under Vista  (Read 7635 times)

foahchon

  • Guest
Using C::B with VS 2005 under Vista
« on: March 10, 2007, 09:36:37 pm »
Hi, I'm running under Windows Vista, and after I read some users were having trouble using GCC under Vista, I decided to download the VS 2005 Express compiler and give that a shot instead. After I downloaded VS 2005 Express, I downloaded and installed C::B, and configured it so that it used VS 2005 as the default compiler. I used the wizard to create a basic console application as a test, and this is what I got in my build log:

Code
-------------- Build: Debug in Blah ---------------
Linking console executable: .\Blah.exe
LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
libcpmtd.lib(cout.obj) : error LNK2019: unresolved external symbol __CrtDbgReportW referenced in function "public: char const & __thiscall std::_String_const_iterator<char,struct std::char_traits<char>,class std::allocator<char> >::operator*(void)const " (??D?$_String_const_iterator@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEABDXZ)
libcpmtd.lib(stdthrow.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW
libcpmtd.lib(xdebug.obj) : error LNK2019: unresolved external symbol __malloc_dbg referenced in function "void * __cdecl operator new(unsigned int,struct std::_DebugHeapTag_t const &,char *,int)" (??2@YAPAXIABU_DebugHeapTag_t@std@@PADH@Z)
libcpmtd.lib(xdebug.obj) : error LNK2019: unresolved external symbol __free_dbg referenced in function "void __cdecl operator delete(void *,struct std::_DebugHeapTag_t const &,char *,int)" (??3@YAXPAXABU_DebugHeapTag_t@std@@PADH@Z)
libcpmtd.lib(_tolower.obj) : error LNK2019: unresolved external symbol __calloc_dbg referenced in function __Getctype
.\Blah.exe : fatal error LNK1120: 4 unresolved externals
Process terminated with status 1120 (0 minutes, 0 seconds)
6 errors, 1 warnings

I tried the compiler's suggestion, and added "/NODEFAULTLIB:LIBCMT" to the linker's options, which produced this in the build log:

Code
-------------- Build: Debug in Blah ---------------
Linking console executable: .\Blah.exe
libcpmtd.lib(xmutex.obj) : error LNK2001: unresolved external symbol __CxxThrowException@8
libcpmtd.lib(ios.obj) : error LNK2001: unresolved external symbol __CxxThrowException@8
libcpmtd.lib(locale0.obj) : error LNK2001: unresolved external symbol __CxxThrowException@8
libcpmtd.lib(iosptrs.obj) : error LNK2001: unresolved external symbol __CxxThrowException@8
main.obj : error LNK2019: unresolved external symbol __CxxThrowException@8 referenced in function "public: char * __cdecl std::_DebugHeapAllocator<char>::allocate(unsigned int,void const *)" (?allocate@?$_DebugHeapAllocator@D@std@@QAAPADIPBX@Z)
libcpmtd.lib(cout.obj) : error LNK2001: unresolved external symbol __CxxThrowException@8
libcpmtd.lib(xdebug.obj) : error LNK2001: unresolved external symbol __CxxThrowException@8
libcpmtd.lib(string.obj) : error LNK2001: unresolved external symbol __CxxThrowException@8

...and on and on and on...there about fifty errors it lists, but says there are more.

Any suggestions? Thanks.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7606
    • My Best Post
Re: Using C::B with VS 2005 under Vista
« Reply #1 on: March 10, 2007, 11:04:08 pm »
Are you using VS 2005 with the latest SP?

MS normally releases patches to get everything working on the newest OS.

Edit: http://go.microsoft.com/?linkid=6366078

Tim S 
« Last Edit: March 10, 2007, 11:07:45 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: Using C::B with VS 2005 under Vista
« Reply #2 on: March 11, 2007, 12:55:46 am »
I used the wizard to create a basic console application as a test, and this is what I got in my build log:
...
I tried the compiler's suggestion, and added "/NODEFAULTLIB:LIBCMT" to the linker's options, which produced this in the build log:...
Any suggestions? Thanks.
The compiler's suggestion is not a good one in this case. The correct fix is to open your project's Build options and, for the debug target, select the "Multi-threaded Debug Runtime Library [/MTd]" option near the bottom of the Compiler Flags list, and rebuild.

It would probably be a good idea for one of the devs with Visual C++ 2005 installed to go through and update all the wizards to make sure they work appropriately.
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

foahchon

  • Guest
Re: Using C::B with VS 2005 under Vista
« Reply #3 on: March 11, 2007, 04:15:50 am »
That did the trick. Thanks.

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Using C::B with VS 2005 under Vista
« Reply #4 on: March 11, 2007, 04:57:07 am »
It would probably be a good idea for one of the devs with Visual C++ 2005 installed to go through and update all the wizards to make sure they work appropriately.

Console wizard has got problems with VC05. I had fixed this issue but wanted to make the wizard more interactive (regarding selection of runtime libraries) and I didn't commit that one. ;)

Anyway I'll put it today so that with next nightly this problem gets fixed.

Regards,

Biplab
Be a part of the solution, not a part of the problem.

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Using C::B with VS 2005 under Vista
« Reply #5 on: March 11, 2007, 07:00:25 am »
MSVC 8 support has been improved for Console wizard and other improvements have been made to wizard. It's in revision 3683. :)
Be a part of the solution, not a part of the problem.