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
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Errors encountered when linking Dialog based application with C code

Errors encountered when linking Dialog based application with C code

Scheduled Pinned Locked Moved C / C++ / MFC
csharpc++visual-studiodebugginghelp
7 Posts 3 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.
  • S Offline
    S Offline
    searcher08
    wrote on last edited by
    #1

    I have developed a simple dialog based GUI and was attempting to link some C-code to it in the CDialog class i.e. copying the C code into the file and updating the header files. However, when I started to compile it, the following errors were encountered. I have not done anything with the MFC header files and know that it cannot be due to the program. It might be the way I inserted the c code into the GUI application. Please advise. Thanks. c:\program files\microsoft visual studio\vc98\include\crtdbg.h(536) : error C2833: 'operator DEBUG_NEW' is not a recognized operator or type c:\program files\microsoft visual studio\vc98\include\crtdbg.h(536) : error C2059: syntax error : 'newline' c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(674) : error C2833: 'operator DEBUG_NEW' is not a recognized operator or type c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(674) : error C2059: syntax error : 'newline' c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(674) : error C2238: unexpected token(s) preceding ';' c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(675) : error C2833: 'operator DEBUG_NEW' is not a recognized operator or type c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(675) : error C2059: syntax error : 'newline' c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(675) : error C2238: unexpected token(s) preceding ';' c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(683) : error C2833: 'operator DEBUG_NEW' is not a recognized operator or type c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(683) : error C2059: syntax error : 'newline' c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(683) : error C2238: unexpected token(s) preceding ';' c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(1631) : error C2833: 'operator DEBUG_NEW' is not a recognized operator or type c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(1631) : error C2059: syntax error : 'newline' c:\program files\microsoft visual studio\vc98\mfc\include\afxtls_.h(122) : error C2059: syntax error : 'string' c:\program files\microsoft visual studio\vc98\mfc\include\afxtls_.h(123) : error C2091: function returns function c:\program files\microsoft visual studio\vc98\mfc\include\afxtls_.h(123) : error C2802: static member 'operator new' has no formal parameters c:\program files\microsoft visual studio\vc98\mfc\include\afxtls_.h(123) : error C2333: 'new' : error in function decla

    S H 3 Replies Last reply
    0
    • S searcher08

      I have developed a simple dialog based GUI and was attempting to link some C-code to it in the CDialog class i.e. copying the C code into the file and updating the header files. However, when I started to compile it, the following errors were encountered. I have not done anything with the MFC header files and know that it cannot be due to the program. It might be the way I inserted the c code into the GUI application. Please advise. Thanks. c:\program files\microsoft visual studio\vc98\include\crtdbg.h(536) : error C2833: 'operator DEBUG_NEW' is not a recognized operator or type c:\program files\microsoft visual studio\vc98\include\crtdbg.h(536) : error C2059: syntax error : 'newline' c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(674) : error C2833: 'operator DEBUG_NEW' is not a recognized operator or type c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(674) : error C2059: syntax error : 'newline' c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(674) : error C2238: unexpected token(s) preceding ';' c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(675) : error C2833: 'operator DEBUG_NEW' is not a recognized operator or type c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(675) : error C2059: syntax error : 'newline' c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(675) : error C2238: unexpected token(s) preceding ';' c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(683) : error C2833: 'operator DEBUG_NEW' is not a recognized operator or type c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(683) : error C2059: syntax error : 'newline' c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(683) : error C2238: unexpected token(s) preceding ';' c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(1631) : error C2833: 'operator DEBUG_NEW' is not a recognized operator or type c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(1631) : error C2059: syntax error : 'newline' c:\program files\microsoft visual studio\vc98\mfc\include\afxtls_.h(122) : error C2059: syntax error : 'string' c:\program files\microsoft visual studio\vc98\mfc\include\afxtls_.h(123) : error C2091: function returns function c:\program files\microsoft visual studio\vc98\mfc\include\afxtls_.h(123) : error C2802: static member 'operator new' has no formal parameters c:\program files\microsoft visual studio\vc98\mfc\include\afxtls_.h(123) : error C2333: 'new' : error in function decla

      S Offline
      S Offline
      ShilpiP
      wrote on last edited by
      #2

      plz send ur code ...what is in .cpp file and .h file ...so we encounter ur mistake

      1 Reply Last reply
      0
      • S searcher08

        I have developed a simple dialog based GUI and was attempting to link some C-code to it in the CDialog class i.e. copying the C code into the file and updating the header files. However, when I started to compile it, the following errors were encountered. I have not done anything with the MFC header files and know that it cannot be due to the program. It might be the way I inserted the c code into the GUI application. Please advise. Thanks. c:\program files\microsoft visual studio\vc98\include\crtdbg.h(536) : error C2833: 'operator DEBUG_NEW' is not a recognized operator or type c:\program files\microsoft visual studio\vc98\include\crtdbg.h(536) : error C2059: syntax error : 'newline' c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(674) : error C2833: 'operator DEBUG_NEW' is not a recognized operator or type c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(674) : error C2059: syntax error : 'newline' c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(674) : error C2238: unexpected token(s) preceding ';' c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(675) : error C2833: 'operator DEBUG_NEW' is not a recognized operator or type c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(675) : error C2059: syntax error : 'newline' c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(675) : error C2238: unexpected token(s) preceding ';' c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(683) : error C2833: 'operator DEBUG_NEW' is not a recognized operator or type c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(683) : error C2059: syntax error : 'newline' c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(683) : error C2238: unexpected token(s) preceding ';' c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(1631) : error C2833: 'operator DEBUG_NEW' is not a recognized operator or type c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(1631) : error C2059: syntax error : 'newline' c:\program files\microsoft visual studio\vc98\mfc\include\afxtls_.h(122) : error C2059: syntax error : 'string' c:\program files\microsoft visual studio\vc98\mfc\include\afxtls_.h(123) : error C2091: function returns function c:\program files\microsoft visual studio\vc98\mfc\include\afxtls_.h(123) : error C2802: static member 'operator new' has no formal parameters c:\program files\microsoft visual studio\vc98\mfc\include\afxtls_.h(123) : error C2333: 'new' : error in function decla

        H Offline
        H Offline
        Hamid Taebi
        wrote on last edited by
        #3

        See here[^] maybe it is some helpful to you


        WhiteSky


        1 Reply Last reply
        0
        • S searcher08

          I have developed a simple dialog based GUI and was attempting to link some C-code to it in the CDialog class i.e. copying the C code into the file and updating the header files. However, when I started to compile it, the following errors were encountered. I have not done anything with the MFC header files and know that it cannot be due to the program. It might be the way I inserted the c code into the GUI application. Please advise. Thanks. c:\program files\microsoft visual studio\vc98\include\crtdbg.h(536) : error C2833: 'operator DEBUG_NEW' is not a recognized operator or type c:\program files\microsoft visual studio\vc98\include\crtdbg.h(536) : error C2059: syntax error : 'newline' c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(674) : error C2833: 'operator DEBUG_NEW' is not a recognized operator or type c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(674) : error C2059: syntax error : 'newline' c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(674) : error C2238: unexpected token(s) preceding ';' c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(675) : error C2833: 'operator DEBUG_NEW' is not a recognized operator or type c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(675) : error C2059: syntax error : 'newline' c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(675) : error C2238: unexpected token(s) preceding ';' c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(683) : error C2833: 'operator DEBUG_NEW' is not a recognized operator or type c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(683) : error C2059: syntax error : 'newline' c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(683) : error C2238: unexpected token(s) preceding ';' c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(1631) : error C2833: 'operator DEBUG_NEW' is not a recognized operator or type c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(1631) : error C2059: syntax error : 'newline' c:\program files\microsoft visual studio\vc98\mfc\include\afxtls_.h(122) : error C2059: syntax error : 'string' c:\program files\microsoft visual studio\vc98\mfc\include\afxtls_.h(123) : error C2091: function returns function c:\program files\microsoft visual studio\vc98\mfc\include\afxtls_.h(123) : error C2802: static member 'operator new' has no formal parameters c:\program files\microsoft visual studio\vc98\mfc\include\afxtls_.h(123) : error C2333: 'new' : error in function decla

          H Offline
          H Offline
          Hamid Taebi
          wrote on last edited by
          #4

          First I glad that your problem solve and I guess you are a student:) (1)I think best help is MSDN(From the MSDN) "If either /Yc or /Yu is specified with /YX, a warning is issued. In such cases, /YX is ignored, and /Yc or /Yu takes precedence". For more information see here[^] (2)can you be more specific,I saw many errors with error LNK2001


          WhiteSky


          S 1 Reply Last reply
          0
          • H Hamid Taebi

            First I glad that your problem solve and I guess you are a student:) (1)I think best help is MSDN(From the MSDN) "If either /Yc or /Yu is specified with /YX, a warning is issued. In such cases, /YX is ignored, and /Yc or /Yu takes precedence". For more information see here[^] (2)can you be more specific,I saw many errors with error LNK2001


            WhiteSky


            S Offline
            S Offline
            searcher08
            wrote on last edited by
            #5

            You are right. I am a student but an old one. This is the first time linking C code with C++ code. Normally, I used only C++ and it is simply using the defined classes. I have this GUI that was developed and this C-code that performs image processing. I have copied the main() code to the GUI and declared the global variables in the dialog class. The image processing files are brought into the workspace and the GUI made dependent on these files. No problem on compiling. However, during the linking up, there are some extern variables in the image processing files that need referencing to. They are declared in the Dialog cpp file. That is the reason for the "unresolved external symbol _img" and the strings of other error message. I have included the Dialog.h in the source file of the image processing file and they could not recognize the class terms i.e. more error occurred. 2nd question is the declaration of C- code in a C++ program. Can I use this method? The two functions are C functions. afx_msg void decode(void); afx_msg void Configure(void); Thanks a lot for your time and advise. Greatly appreciated. searcher08

            H 1 Reply Last reply
            0
            • S searcher08

              You are right. I am a student but an old one. This is the first time linking C code with C++ code. Normally, I used only C++ and it is simply using the defined classes. I have this GUI that was developed and this C-code that performs image processing. I have copied the main() code to the GUI and declared the global variables in the dialog class. The image processing files are brought into the workspace and the GUI made dependent on these files. No problem on compiling. However, during the linking up, there are some extern variables in the image processing files that need referencing to. They are declared in the Dialog cpp file. That is the reason for the "unresolved external symbol _img" and the strings of other error message. I have included the Dialog.h in the source file of the image processing file and they could not recognize the class terms i.e. more error occurred. 2nd question is the declaration of C- code in a C++ program. Can I use this method? The two functions are C functions. afx_msg void decode(void); afx_msg void Configure(void); Thanks a lot for your time and advise. Greatly appreciated. searcher08

              H Offline
              H Offline
              Hamid Taebi
              wrote on last edited by
              #6

              Student,I was student and I know when a student has a problem he trys to find his problem(anyway I couldnt found my answer:))But I have a question why you want to use c code is it possible for you to write your code on C++.


              WhiteSky


              S 1 Reply Last reply
              0
              • H Hamid Taebi

                Student,I was student and I know when a student has a problem he trys to find his problem(anyway I couldnt found my answer:))But I have a question why you want to use c code is it possible for you to write your code on C++.


                WhiteSky


                S Offline
                S Offline
                searcher08
                wrote on last edited by
                #7

                I can't use C++ coz the c code was developed by another person and I have to add in the GUI and perform improvement on the code. To recode that will take too long. I have already spent hours on this problem and I am not getting anywhere. I think the answer is out there except that it is not made known. Thanks. searcher08

                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