Author Topic: Console / iostream - problem  (Read 4562 times)

VersusOm

  • Guest
Console / iostream - problem
« on: September 30, 2006, 04:43:02 pm »
hi,
I want to write a DX application... (vc++ compilator, platform SDK, directX SDK - fine)
And its works but for debbuging porposes I need console.
I do this and encounter a problem...
#include <iostream>  // or #include <iostream.h>
using namespace std;
//-- some where in DX project --

cout<<"OK"<<endl; // just I add this some linker errors apear

I thought that my program has to start console itself. To do if I have modefied the code to:

HINSTANCE hInst;
int main()//INT WINAPI WinMain(HINSTANCE hInst, HINSTANCE, LPSTR, INT)
{
// program

Whatever I do this appear:
//------------------
Linking console executable: Debug\try1.exe
libcpd.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)
libcpd.lib(_tolower.obj) : error LNK2001: unresolved external symbol __malloc_dbg
libcpd.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)
Debug\try1.exe : fatal error LNK1120: 2 unresolved externals
Process terminated with status 1120 (0 minutes, 1 seconds)
//-------------------

and many warnings:
//----------------
-------------- Build: Debug in try1 ---------------
main.cpp
D:\Program Files\Microsoft Visual C++ Toolkit 2003\include\ostream(574) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
D:\Program Files\Microsoft Visual C++ Toolkit 2003\include\istream(828) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
D:\Program Files\Microsoft Visual C++ Toolkit 2003\include\istream(1064) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
D:\Program Files\Microsoft Visual C++ Toolkit 2003\include\ostream(479) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
        D:\Program Files\Microsoft Visual C++ Toolkit 2003\include\ostream(471) : while compiling class-template member function 'std::basic_ostream<_Elem,_Traits>::_Myt &std::basic_ostream<_Elem,_Traits>::put(_Elem)'
        with
        [
            _Elem=wchar_t,
            _Traits=std::char_traits<wchar_t>
        ]
        D:\Program Files\Microsoft Visual C++ Toolkit 2003\include\ostream(561) : see reference to class template instantiation 'std::basic_ostream<_Elem,_Traits>' being compiled
        with
        [
            _Elem=wchar_t,
            _Traits=std::char_traits<wchar_t>
        ]
//--------------
what does it means ?

In whole I like Code::Bloks but if there is a possibility to write a DX programs with console OutPut, it would be GREAT!