Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Getting #include {iostream} to work

Getting #include {iostream} to work

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpquestion
10 Posts 7 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    JaeBeam
    wrote on last edited by
    #1

    I am having issues writing a C++ .dll. When using MSVC++ 2003 the following line; #include <iostream> gives me a few errors OraclePingC++ 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) and OraclePingC++ 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) When I comment out the #include line, the errors go away. I've tried to play with the linker settings with my properties, but I'm not making progres..

    D J L PJ ArendsP 4 Replies Last reply
    0
    • J JaeBeam

      I am having issues writing a C++ .dll. When using MSVC++ 2003 the following line; #include <iostream> gives me a few errors OraclePingC++ 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) and OraclePingC++ 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) When I comment out the #include line, the errors go away. I've tried to play with the linker settings with my properties, but I'm not making progres..

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      JaeBeam wrote:

      When I comment out the #include line, the errors go away.

      So then what's the problem?

      "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

      "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

      R 1 Reply Last reply
      0
      • D David Crow

        JaeBeam wrote:

        When I comment out the #include line, the errors go away.

        So then what's the problem?

        "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

        "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

        R Offline
        R Offline
        Rajesh R Subramanian
        wrote on last edited by
        #3

        DavidCrow wrote:

        So then what's the problem?

        It is "not working". :-D

        It is a crappy thing, but it's life -^ Carlo Pallini

        CPalliniC 1 Reply Last reply
        0
        • J JaeBeam

          I am having issues writing a C++ .dll. When using MSVC++ 2003 the following line; #include <iostream> gives me a few errors OraclePingC++ 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) and OraclePingC++ 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) When I comment out the #include line, the errors go away. I've tried to play with the linker settings with my properties, but I'm not making progres..

          J Offline
          J Offline
          josda1000
          wrote on last edited by
          #4

          This is just supposition, but did you do this in debug mode? I see that it's trying to call malloc and free with debug mode... try in release. see what happens. but i've definitely never seen this happen before

          1 Reply Last reply
          0
          • J JaeBeam

            I am having issues writing a C++ .dll. When using MSVC++ 2003 the following line; #include <iostream> gives me a few errors OraclePingC++ 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) and OraclePingC++ 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) When I comment out the #include line, the errors go away. I've tried to play with the linker settings with my properties, but I'm not making progres..

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            In your compiler settings look for the C/C++ Code generation section and change the Runtime library to Multi-Threaded-Debug /MTd Best Wishes, -David Delaune

            J 1 Reply Last reply
            0
            • L Lost User

              In your compiler settings look for the C/C++ Code generation section and change the Runtime library to Multi-Threaded-Debug /MTd Best Wishes, -David Delaune

              J Offline
              J Offline
              JaeBeam
              wrote on last edited by
              #6

              It appears I already have my my Runtime library to Multi-Threaded-Debug (/MTd) Here is the complete command line, cut and pasted from my projects properties: /Od /AI "D:\Source Code\Cardacc v5.0.xx Customs\OracleTest\OraclePingC++\Debug" /D "WIN32" /D "_DEBUG" /D "_WINDLL" /D "_MBCS" /FD /EHsc /MTd /GS /Yu"stdafx.h" /Fp"Debug/OraclePingC++.pch" /Fo"Debug/" /Fd"Debug/vc70.pdb" /W3 /nologo /c /Zi /clr /TP /FU "c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\mscorlib.dll" /FU "c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.dll" /FU "c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Data.dll" When I try to build the dll in Release mode, I receive a ton of LNK2001 and 2019 errors.

              L 1 Reply Last reply
              0
              • J JaeBeam

                It appears I already have my my Runtime library to Multi-Threaded-Debug (/MTd) Here is the complete command line, cut and pasted from my projects properties: /Od /AI "D:\Source Code\Cardacc v5.0.xx Customs\OracleTest\OraclePingC++\Debug" /D "WIN32" /D "_DEBUG" /D "_WINDLL" /D "_MBCS" /FD /EHsc /MTd /GS /Yu"stdafx.h" /Fp"Debug/OraclePingC++.pch" /Fo"Debug/" /Fd"Debug/vc70.pdb" /W3 /nologo /c /Zi /clr /TP /FU "c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\mscorlib.dll" /FU "c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.dll" /FU "c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Data.dll" When I try to build the dll in Release mode, I receive a ton of LNK2001 and 2019 errors.

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                JaeBeam wrote:

                c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\mscorlib.dll

                Is your project suppose to be using Managed C++ because you have the /clr flag set. Best Wishes, -David Delaune

                1 Reply Last reply
                0
                • J JaeBeam

                  I am having issues writing a C++ .dll. When using MSVC++ 2003 the following line; #include <iostream> gives me a few errors OraclePingC++ 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) and OraclePingC++ 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) When I comment out the #include line, the errors go away. I've tried to play with the linker settings with my properties, but I'm not making progres..

                  PJ ArendsP Offline
                  PJ ArendsP Offline
                  PJ Arends
                  wrote on last edited by
                  #8

                  Sometime the order that you #include header files will cause stuff like this to happen because one header expects another to be included first. Try changing the order of your #includes.


                  You may be right I may be crazy -- Billy Joel -- Within you lies the power for good - Use it!

                  Within you lies the power for good; Use it!

                  1 Reply Last reply
                  0
                  • R Rajesh R Subramanian

                    DavidCrow wrote:

                    So then what's the problem?

                    It is "not working". :-D

                    It is a crappy thing, but it's life -^ Carlo Pallini

                    CPalliniC Offline
                    CPalliniC Offline
                    CPallini
                    wrote on last edited by
                    #9

                    Rajesh R Subramanian wrote:

                    It is "not working".

                    It's not working, plz send me codez, urgentz plz plz. FFY :-D

                    If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                    This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                    [My articles]

                    In testa che avete, signor di Ceprano?

                    R 1 Reply Last reply
                    0
                    • CPalliniC CPallini

                      Rajesh R Subramanian wrote:

                      It is "not working".

                      It's not working, plz send me codez, urgentz plz plz. FFY :-D

                      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                      This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                      [My articles]

                      R Offline
                      R Offline
                      Rajesh R Subramanian
                      wrote on last edited by
                      #10

                      Now I understand. The low vote is because I missed the important information. :laugh:

                      It is a crappy thing, but it's life -^ Carlo Pallini

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups