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. Link Error

Link Error

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpquestionannouncement
14 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.
  • N Navin

    IT sounds like you either don't have a CWinApp class defined (e.g., somewhere you need the line: CMyWinAppDerievdClass theApp;) Or your your project settings are incorrect and you aren't set to run an MFC project or something. Remember, even if you win the rat race, you're still a rat.

    S Offline
    S Offline
    satcat
    wrote on last edited by
    #4

    Well, I have in my code the line CWindowApp theApp; and I have "Use MFC in a shared DLL" so I don't know but I think they are not the problem... Usually, I can compile and link with no problem, but when I try to create threads then I got this problems in link. Any idea?:doh: Thanks!

    1 Reply Last reply
    0
    • D David Crow

      Are you using the /ENTRY option with the linker?


      "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

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

      Where should I write down this option, please? Thank you.

      D 1 Reply Last reply
      0
      • S satcat

        Where should I write down this option, please? Thank you.

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

        In the .mak file. I assume you have one since nmake was mentioned.


        "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

        S 1 Reply Last reply
        0
        • D David Crow

          In the .mak file. I assume you have one since nmake was mentioned.


          "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

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

          My make file is: todo: cliente.exe servidor.exe servidorV.exe cliente.exe: cliente.obj imevoc.obj link.exe cliente.obj imevoc.obj TAO_Portableserver.lib TAO_RTEvent.lib TAO_CosNaming.lib TAO.lib ace.lib /libpath:"C:\corba\ACE_wrappers\LIB" servidor.exe: servidor.obj imevoc.obj imevos.obj imevo_i.obj imevo.obj link.exe servidor.obj imevo.obj imevoc.obj imevos.obj imevo_i.obj TAO_Portableserver.lib TAO_RTEvent.lib TAO_CosNaming.lib TAO.lib ace.lib /libpath:"C:\corba\ACE_wrappers\LIB" /NODEFAULTLIB:nafxcw.lib servidorV.exe: ventana.obj ventanaDlg.obj imevoc.obj imevos.obj imevo_i.obj imevo.obj link.exe ventana.obj ventanaDlg.obj imevo.obj imevoc.obj imevos.obj imevo_i.obj TAO_Portableserver.lib TAO_RTEvent.lib TAO_CosNaming.lib TAO.lib ace.lib /libpath:"C:\corba\ACE_wrappers\LIB" /ENTRY:"WinMain" cliente.obj: cliente.cpp imevoc.h CL cliente.CPP /MD /W3 /GX /O2 /I "C:\corba\ACE_wrappers" /I "C:\corba\ACE_wrappers\TAO" /I "C:\corba\ACE_wrappers\TAO\orbsvcs" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c imevoc.obj: imevoc.cpp imevoc.h CL imevoC.CPP /MD /W3 /GX /O2 /I "C:\corba\ACE_wrappers" /I "C:\corba\ACE_wrappers\TAO" /I "C:\corba\ACE_wrappers\TAO\orbsvcs" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c imevos.obj: imevos.cpp imevos.h CL imevos.CPP /MD /W3 /GX /O2 /I "C:\corba\ACE_wrappers" /I "C:\corba\ACE_wrappers\TAO" /I "C:\corba\ACE_wrappers\TAO\orbsvcs" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c servidor.obj: servidor.cpp imevo_i.h CL servidor.CPP /MD /W3 /GX /O2 /I "C:\corba\ACE_wrappers" /I "C:\corba\ACE_wrappers\TAO" /I "C:\corba\ACE_wrappers\TAO\orbsvcs" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c imevo_i.obj: imevo_i.h imevo_i.cpp imevoS.h imevo.h imevo.cpp CL imevo_i.CPP /MD /W3 /GX /O2 /I "C:\corba\ACE_wrappers" /I "C:\corba\ACE_wrappers\TAO" /I "C:\corba\ACE_wrappers\TAO\orbsvcs" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c imevo.obj: imevo.h imevo.cpp CL imevo.CPP /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c ventana.obj: ventana.h ventana.cpp CL ventana.CPP /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /FD /c ventanaDlg.obj: ventanaDlg.h ventanaDlg.cpp CL ventanaDlg.CPP /MD /W3 /GX /O2 /I "C:\corba\ACE_wrappers" /I "C:\corba\ACE_wrappers\TAO" /I "C:\corba\ACE_wrappers\TAO\orbsvcs" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /FD

          D 1 Reply Last reply
          0
          • S satcat

            My make file is: todo: cliente.exe servidor.exe servidorV.exe cliente.exe: cliente.obj imevoc.obj link.exe cliente.obj imevoc.obj TAO_Portableserver.lib TAO_RTEvent.lib TAO_CosNaming.lib TAO.lib ace.lib /libpath:"C:\corba\ACE_wrappers\LIB" servidor.exe: servidor.obj imevoc.obj imevos.obj imevo_i.obj imevo.obj link.exe servidor.obj imevo.obj imevoc.obj imevos.obj imevo_i.obj TAO_Portableserver.lib TAO_RTEvent.lib TAO_CosNaming.lib TAO.lib ace.lib /libpath:"C:\corba\ACE_wrappers\LIB" /NODEFAULTLIB:nafxcw.lib servidorV.exe: ventana.obj ventanaDlg.obj imevoc.obj imevos.obj imevo_i.obj imevo.obj link.exe ventana.obj ventanaDlg.obj imevo.obj imevoc.obj imevos.obj imevo_i.obj TAO_Portableserver.lib TAO_RTEvent.lib TAO_CosNaming.lib TAO.lib ace.lib /libpath:"C:\corba\ACE_wrappers\LIB" /ENTRY:"WinMain" cliente.obj: cliente.cpp imevoc.h CL cliente.CPP /MD /W3 /GX /O2 /I "C:\corba\ACE_wrappers" /I "C:\corba\ACE_wrappers\TAO" /I "C:\corba\ACE_wrappers\TAO\orbsvcs" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c imevoc.obj: imevoc.cpp imevoc.h CL imevoC.CPP /MD /W3 /GX /O2 /I "C:\corba\ACE_wrappers" /I "C:\corba\ACE_wrappers\TAO" /I "C:\corba\ACE_wrappers\TAO\orbsvcs" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c imevos.obj: imevos.cpp imevos.h CL imevos.CPP /MD /W3 /GX /O2 /I "C:\corba\ACE_wrappers" /I "C:\corba\ACE_wrappers\TAO" /I "C:\corba\ACE_wrappers\TAO\orbsvcs" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c servidor.obj: servidor.cpp imevo_i.h CL servidor.CPP /MD /W3 /GX /O2 /I "C:\corba\ACE_wrappers" /I "C:\corba\ACE_wrappers\TAO" /I "C:\corba\ACE_wrappers\TAO\orbsvcs" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c imevo_i.obj: imevo_i.h imevo_i.cpp imevoS.h imevo.h imevo.cpp CL imevo_i.CPP /MD /W3 /GX /O2 /I "C:\corba\ACE_wrappers" /I "C:\corba\ACE_wrappers\TAO" /I "C:\corba\ACE_wrappers\TAO\orbsvcs" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c imevo.obj: imevo.h imevo.cpp CL imevo.CPP /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c ventana.obj: ventana.h ventana.cpp CL ventana.CPP /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /FD /c ventanaDlg.obj: ventanaDlg.h ventanaDlg.cpp CL ventanaDlg.CPP /MD /W3 /GX /O2 /I "C:\corba\ACE_wrappers" /I "C:\corba\ACE_wrappers\TAO" /I "C:\corba\ACE_wrappers\TAO\orbsvcs" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /FD

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

            It looks like only 1 of the three "link" lines have the /ENTRY option.


            "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

            S 1 Reply Last reply
            0
            • D David Crow

              It looks like only 1 of the three "link" lines have the /ENTRY option.


              "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

              S Offline
              S Offline
              satcat
              wrote on last edited by
              #9

              ok, I understand... My problem now is that I don't know which is the main procedure in the application... I'm working in Visual C++ and my app is called Window (I only wrote /ENTRY:WinMain so I could know if I had understood you). Thank you.

              D 1 Reply Last reply
              0
              • S satcat

                ok, I understand... My problem now is that I don't know which is the main procedure in the application... I'm working in Visual C++ and my app is called Window (I only wrote /ENTRY:WinMain so I could know if I had understood you). Thank you.

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

                Try changing the .mak file to the following in hopes of narrowing down which of the three modules is causing the problem: todo: cliente.exe cliente.exe: cliente.obj imevoc.obj link.exe cliente.obj imevoc.obj TAO_Portableserver.lib TAO_RTEvent.lib TAO_CosNaming.lib TAO.lib ace.lib /libpath:"C:\corba\ACE_wrappers\LIB" cliente.obj: cliente.cpp imevoc.h CL cliente.CPP /MD /W3 /GX /O2 /I "C:\corba\ACE_wrappers" /I "C:\corba\ACE_wrappers\TAO" /I "C:\corba\ACE_wrappers\TAO\orbsvcs" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c imevoc.obj: imevoc.cpp imevoc.h CL imevoC.CPP /MD /W3 /GX /O2 /I "C:\corba\ACE_wrappers" /I "C:\corba\ACE_wrappers\TAO" /I "C:\corba\ACE_wrappers\TAO\orbsvcs" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c If this works, do the same for servidor.exe, and then servidorv.exe.


                "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

                S 1 Reply Last reply
                0
                • D David Crow

                  Try changing the .mak file to the following in hopes of narrowing down which of the three modules is causing the problem: todo: cliente.exe cliente.exe: cliente.obj imevoc.obj link.exe cliente.obj imevoc.obj TAO_Portableserver.lib TAO_RTEvent.lib TAO_CosNaming.lib TAO.lib ace.lib /libpath:"C:\corba\ACE_wrappers\LIB" cliente.obj: cliente.cpp imevoc.h CL cliente.CPP /MD /W3 /GX /O2 /I "C:\corba\ACE_wrappers" /I "C:\corba\ACE_wrappers\TAO" /I "C:\corba\ACE_wrappers\TAO\orbsvcs" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c imevoc.obj: imevoc.cpp imevoc.h CL imevoC.CPP /MD /W3 /GX /O2 /I "C:\corba\ACE_wrappers" /I "C:\corba\ACE_wrappers\TAO" /I "C:\corba\ACE_wrappers\TAO\orbsvcs" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c If this works, do the same for servidor.exe, and then servidorv.exe.


                  "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

                  S Offline
                  S Offline
                  satcat
                  wrote on last edited by
                  #11

                  I get the error building servidorv.exe The makefile is: todo: servidorV.exe servidorV.exe: ventana.obj ventanaDlg.obj imevoc.obj imevos.obj imevo_i.obj imevo.obj link.exe ventana.obj ventanaDlg.obj imevo.obj imevoc.obj imevos.obj imevo_i.obj TAO_Portableserver.lib TAO_RTEvent.lib TAO_CosNaming.lib TAO.lib ace.lib /libpath:"d:\ACE_wrappers\LIB" ventana.obj: ventana.h ventana.cpp CL ventana.CPP /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /FD /c ventanaDlg.obj: ventanaDlg.h ventanaDlg.cpp CL ventanaDlg.CPP /MD /W3 /GX /O2 /I "d:\ACE_wrappers" /I "d:\ACE_wrappers\TAO" /I "d:\ACE_wrappers\TAO\orbsvcs" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /FD /c imevos.obj: imevos.cpp imevos.h CL imevos.CPP /MD /W3 /GX /O2 /I "d:\ACE_wrappers" /I "d:\ACE_wrappers\TAO" /I "d:\ACE_wrappers\TAO\orbsvcs" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c imevoc.obj: imevoc.cpp imevoc.h CL imevoC.CPP /MD /W3 /GX /O2 /I "d:\ACE_wrappers" /I "d:\ACE_wrappers\TAO" /I "d:\ACE_wrappers\TAO\orbsvcs" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c imevo_i.obj: imevo_i.h imevo_i.cpp imevoS.h imevo.h imevo.cpp CL imevo_i.CPP /MD /W3 /GX /O2 /I "d:\ACE_wrappers" /I "d:\ACE_wrappers\TAO" /I "d:\ACE_wrappers\TAO\orbsvcs" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c imevo.obj: imevo.h imevo.cpp CL imevo.CPP /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c ``And the nmake throws: `LINK : fatal error LNK1561: entry point must be defined NMAKE : fatal error U1077: 'link.exe' : return code '0x619' Stop.` when it ends compiling. servidor and cliente are OK. Which could be the problem? Thanks!``

                  D 1 Reply Last reply
                  0
                  • S satcat

                    I get the error building servidorv.exe The makefile is: todo: servidorV.exe servidorV.exe: ventana.obj ventanaDlg.obj imevoc.obj imevos.obj imevo_i.obj imevo.obj link.exe ventana.obj ventanaDlg.obj imevo.obj imevoc.obj imevos.obj imevo_i.obj TAO_Portableserver.lib TAO_RTEvent.lib TAO_CosNaming.lib TAO.lib ace.lib /libpath:"d:\ACE_wrappers\LIB" ventana.obj: ventana.h ventana.cpp CL ventana.CPP /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /FD /c ventanaDlg.obj: ventanaDlg.h ventanaDlg.cpp CL ventanaDlg.CPP /MD /W3 /GX /O2 /I "d:\ACE_wrappers" /I "d:\ACE_wrappers\TAO" /I "d:\ACE_wrappers\TAO\orbsvcs" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /FD /c imevos.obj: imevos.cpp imevos.h CL imevos.CPP /MD /W3 /GX /O2 /I "d:\ACE_wrappers" /I "d:\ACE_wrappers\TAO" /I "d:\ACE_wrappers\TAO\orbsvcs" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c imevoc.obj: imevoc.cpp imevoc.h CL imevoC.CPP /MD /W3 /GX /O2 /I "d:\ACE_wrappers" /I "d:\ACE_wrappers\TAO" /I "d:\ACE_wrappers\TAO\orbsvcs" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c imevo_i.obj: imevo_i.h imevo_i.cpp imevoS.h imevo.h imevo.cpp CL imevo_i.CPP /MD /W3 /GX /O2 /I "d:\ACE_wrappers" /I "d:\ACE_wrappers\TAO" /I "d:\ACE_wrappers\TAO\orbsvcs" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c imevo.obj: imevo.h imevo.cpp CL imevo.CPP /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c ``And the nmake throws: `LINK : fatal error LNK1561: entry point must be defined NMAKE : fatal error U1077: 'link.exe' : return code '0x619' Stop.` when it ends compiling. servidor and cliente are OK. Which could be the problem? Thanks!``

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

                    Do any of the following modules contain a WinMain(), or equivalent, function: ventana.cpp ventanaDlg.cpp imevoc.cpp imevos.cpp imevo_i.cpp imevo.cpp


                    "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

                    S 1 Reply Last reply
                    0
                    • D David Crow

                      Do any of the following modules contain a WinMain(), or equivalent, function: ventana.cpp ventanaDlg.cpp imevoc.cpp imevos.cpp imevo_i.cpp imevo.cpp


                      "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

                      S Offline
                      S Offline
                      satcat
                      wrote on last edited by
                      #13

                      I think so since I've created the ventana.dsw project and in other projects I had no problems, but I don't really know which is the function that begins here :doh: When I build my project in Visual C++ instead of DOS console with nmake, I get this different message error: ventanaDlg.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall CVentanaDlg::OnOK(void)" (?OnOK@CVentanaDlg@@MAEXXZ) Release/ventana.exe : fatal error LNK1120: 1 unresolved externals The error that I get in the DOS console is about the entry point as I told you... I can't see the relationship between these errors. Waiting for your help and knowledge :) Thanks!

                      D 1 Reply Last reply
                      0
                      • S satcat

                        I think so since I've created the ventana.dsw project and in other projects I had no problems, but I don't really know which is the function that begins here :doh: When I build my project in Visual C++ instead of DOS console with nmake, I get this different message error: ventanaDlg.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall CVentanaDlg::OnOK(void)" (?OnOK@CVentanaDlg@@MAEXXZ) Release/ventana.exe : fatal error LNK1120: 1 unresolved externals The error that I get in the DOS console is about the entry point as I told you... I can't see the relationship between these errors. Waiting for your help and knowledge :) Thanks!

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

                        Why don't you open the ventana.dsw workspace, click on Project/Export Makefile. Compare this .mak file with the one you are currently using. Notice that it probably contains a lot more .cpp files.


                        "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

                        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