I discovered a program that may meet some needs; the source is available on sourceforge but the dependency list was lacking sufficient detail. I've managed to track down (most) of them and selected the versions based upon the release date of the software. The goal is to get the code to compile as faithfully as it initially did back in 2011, then worry about upgrading/fixing/migrating to newer libraries.
One package, FLTK, is using the abandoned 2.0 version. I found two different versions. The project files included were 'one way upgraded' to MS2019. Many properties and links needed to be fixed.
I'm attempting to compile the test 'cubeview' program, and end up with 37 unresolved dependencies.
As below, I've gone into the project, properties, configuration prope
Severity Code Description Project File Line Suppression State
Error LNK1120 37 unresolved externals CubeView D:\CodeProjects\fltk-2.0.x-master\fltk-2.0.x-master\ide\vcnet\Debug\CubeView.exe 1
Error LNK2019 unresolved external symbol "public: bool __thiscall fltk::Widget::find(class fltk::AssociationType const &,void *)const " (?find#Widget#fltk##QBE_NABVAssociationType#2#PAX#Z) referenced in function "public: bool __thiscall fltk::Widget::add_shortcut(unsigned int)" (?add_shortcut#Widget#fltk##QAE_NI#Z) CubeView D:\CodeProjects\fltk-2.0.x-master\fltk-2.0.x-master\ide\vcnet\ShortcutAssignment.obj 1
Error LNK2019 unresolved external symbol "public: bool __thiscall fltk::Widget::remove(class fltk::AssociationType const &,void *)" (?remove#Widget#fltk##QAE_NABVAssociationType#2#PAX#Z) referenced in function "public: bool __thiscall fltk::Widget::remove_shortcut(unsigned int)" (?remove_shortcut#Widget#fltk##QAE_NI#Z) CubeView D:\CodeProjects\fltk-2.0.x-master\fltk-2.0.x-master\ide\vcnet\ShortcutAssignment.obj 1
Error LNK2019 unresolved external symbol "public: void * __thiscall fltk::Widget::foreach(class fltk::AssociationType const &,class fltk::AssociationFunctor &)const " (?foreach#Widget#fltk##QBEPAXABVAssociationType#2#AAVAssociationFunctor#2##Z) referenced in function "public: bool __thiscall fltk::Widget::test_shortcut(bool)const " (?test_shortcut#Widget#fltk##QBE_N_N#Z) CubeView D:\CodeProjects\fltk-2.0.x-master\fltk-2.0.x-master\ide\vcnet\ShortcutAssignment.obj 1
Error LNK2019 unresolved external symbol "public: void * __thiscall fltk::Widget::get(class fltk::AssociationType const &)const " (?get#Widget#fltk##QBEPAXABVAssociationType#2##Z) referenced in function "public: unsigned int __thiscall fltk::Widget::shortcut(void)const " (?shortcut#Widget#fltk##QBEIXZ) CubeView D:\CodeProjects\fltk-2.0.x-master\fltk-2.0.x-master\ide\vcnet\ShortcutAssignment.obj 1
Error LNK2019 unresolved external symbol "public: void __thiscall fltk::Widget::add(class fltk::AssociationType const &,void *)" (?add#Widget#fltk##QAEXABVAssociationType#2#PAX#Z) referenced in function "public: bool __thiscall fltk::Widget::add_shortcut(unsigned int)" (?add_shortcut#Widget#fltk##QAE_NI#Z) CubeView D:\CodeProjects\fltk-2.0.x-master\fltk-2.0.x-master\ide\vcnet\ShortcutAssignment.obj 1
Error LNK2019 unresolved external symbol "public: void __thiscall fltk::Widget::set(class fltk::AssociationType const &,void *)" (?set#Widget#fltk##QAEXABVAssociationType#2#PAX#Z) referenced in function "public: void __thiscall fltk::Widget::remove_shortcuts(void)" (?remove_shortcuts#Widget#fltk##QAEXXZ) CubeView D:\CodeProjects\fltk-2.0.x-master\fltk-2.0.x-master\ide\vcnet\ShortcutAssignment.obj 1
Error LNK2019 unresolved external symbol "void * __cdecl fltk::foreach(class fltk::AssociationType const *,class fltk::Widget const *,class fltk::AssociationFunctor &)" (?foreach#fltk##YAPAXPBVAssociationType#1#PBVWidget#1#AAVAssociationFunctor#1##Z) referenced in function "unsigned int __cdecl fltk::foreachShortcut(class fltk::Widget const *,class fltk::ShortcutFunctor &)" (?foreachShortcut#fltk##YAIPBVWidget#1#AAVShortcutFunctor#1##Z) CubeView D:\CodeProjects\fltk-2.0.x-master\fltk-2.0.x-master\ide\vcnet\ShortcutAssignment.obj 1
Error LNK2019 unresolved external symbol "void __cdecl delete_associations_for(class fltk::Widget *)" (?delete_associations_for##YAXPAVWidget#fltk###Z) referenced in function "public: virtual __thiscall fltk::Widget::~Widget(void)" (??1Widget#fltk##UAE#XZ) CubeView D:\CodeProjects\fltk-2.0.x-master\fltk-2.0.x-master\ide\vcnet\Widget.obj 1
Error LNK2019 unresolved external symbol _WSAAsyncSelect#16 referenced in function "void __cdecl fltk::add_fd(int,int,void (__cdecl*)(int,void *),void *)" (?add_fd#fltk##YAXHHP6AXHPAX#Z0#Z) CubeView D:\CodeProjects\fltk-2.0.x-master\fltk-2.0.x-master\ide\vcnet\run.obj 1
Error LNK2019 unresolved external symbol __imp__glBegin#4 referenced in function "private: void __thiscall CubeView::drawCube(void)" (?drawCube#CubeView##AAEXXZ) CubeView D:\CodeProjects\fltk-2.0.x-master\fltk-2.0.x-master\ide\vcnet\CubeView.obj 1
Error LNK2019 unresolved external symbol __imp__glBlendFunc#8 referenced in function "public: virtual void __thiscall CubeView::draw(void)" (?draw#CubeView##UAEXXZ) CubeView D:\CodeProjects\fltk-2.0.x-master\fltk-2.0.x-master\ide\vcnet\CubeView.obj 1
Error LNK2019 unresolved external symbol __imp__glClear#4 referenced in function "public: virtual void __thiscall CubeView::draw(void)" (?draw#CubeView##UAEXXZ) CubeView D:\CodeProjects\fltk-2.0.x-master\fltk-2.0.x-master\ide\vcnet\CubeView.obj 1
Error LNK2019 unresolved external symbol __imp__glColor3f#12 referenced in function "private: void __thiscall CubeView::drawCube(void)" (?drawCube#CubeView##AAEXXZ) CubeView D:\CodeProjects\fltk-2.0.x-master\fltk-2.0.x-master\ide\vcnet\CubeView.obj 1
Error LNK2019 unresolved external symbol __imp__glColor4f#16 referenced in function "private: void __thiscall CubeView::drawCube(void)" (?drawCube#CubeView##AAEXXZ) CubeView D:\CodeProjects\fltk-2.0.x-master\fltk-2.0.x-master\ide\vcnet\CubeView.obj 1
Error LNK2019 unresolved external symbol __imp__glCopyPixels#20 referenced in function "public: virtual void __thiscall fltk::GlWindow::flush(void)" (?flush#GlWindow#fltk##UAEXXZ) CubeView D:\CodeProjects\fltk-2.0.x-master\fltk-2.0.x-master\ide\vcnet\fltk2_gld.lib(Fl_Gl_Window.obj) 1
Error LNK2019 unresolved external symbol __imp__glDisable#4 referenced in function "public: virtual void __thiscall fltk::GlWindow::flush(void)" (?flush#GlWindow#fltk##UAEXXZ) CubeView D:\CodeProjects\fltk-2.0.x-master\fltk-2.0.x-master\ide\vcnet\fltk2_gld.lib(Fl_Gl_Window.obj) 1
Error LNK2019 unresolved external symbol __imp__glDrawBuffer#4 referenced in function "public: virtual void __thiscall fltk::GlWindow::flush(void)" (?flush#GlWindow#fltk##UAEXXZ) CubeView D:\CodeProjects\fltk-2.0.x-master\fltk-2.0.x-master\ide\vcnet\fltk2_gld.lib(Fl_Gl_Window.obj) 1
Error LNK2019 unresolved external symbol __imp__glEnable#4 referenced in function "public: virtual void __thiscall CubeView::draw(void)" (?draw#CubeView##UAEXXZ) CubeView D:\CodeProjects\fltk-2.0.x-master\fltk-2.0.x-master\ide\vcnet\CubeView.obj 1
Error LNK2019 unresolved external symbol __imp__glEnd#0 referenced in function "private: void __thiscall CubeView::drawCube(void)" (?drawCube#CubeView##AAEXXZ) CubeView D:\CodeProjects\fltk-2.0.x-master\fltk-2.0.x-master\ide\vcnet\CubeView.obj 1
Error LNK2019 unresolved external symbol __imp__glFlush#0 referenced in function "public: virtual void __thiscall fltk::GlWindow::flush(void)" (?flush#GlWindow#fltk##UAEXXZ) CubeView D:\CodeProjects\fltk-2.0.x-master\fltk-2.0.x-master\ide\vcnet\fltk2_gld.lib(Fl_Gl_Window.obj) 1
Error LNK2001 unresolved external symbol __imp__glLoadIdentity#0 CubeView D:\CodeProjects\fltk-2.0.x-master\fltk-2.0.x-master\ide\vcnet\fltk2_gld.lib(Fl_Gl_Window.obj) 1
Error LNK2019 unresolved external symbol __imp__glLoadIdentity#0 referenced in function "public: virtual void __thiscall CubeView::draw(void)" (?draw#CubeView##UAEXXZ) CubeView D:\CodeProjects\fltk-2.0.x-master\fltk-2.0.x-master\ide\vcnet\CubeView.obj 1
Error LNK2001 unresolved external symbol __imp__glOrtho#48 CubeView D:\CodeProjects\fltk-2.0.x-master\fltk-2.0.x-master\ide\vcnet\fltk2_gld.lib(Fl_Gl_Window.obj) 1
Error LNK2019 unresolved external symbol __imp__glOrtho#48 referenced in function "public: virtual void __thiscall CubeView::draw(void)" (?draw#CubeView##UAEXXZ) CubeView D:\CodeProjects\fltk-2.0.x-master\fltk-2.0.x-master\ide\vcnet\CubeView.obj 1
Error LNK2019 unresolved external symbol __imp__glPopMatrix#0 referenced in function "public: virtual void __thiscall CubeView::draw(void)" (?draw#CubeView##UAEXXZ) CubeView D:\CodeProjects\fltk-2.0.x-master\fltk-2.0.x-master\ide\vcnet\CubeView.obj 1
Error LNK2019 unresolved external symbol __imp__glPushMatrix#0 referenced in function "public: virtual void __thiscall CubeView::draw(void)" (?draw#CubeView##UAEXXZ) CubeView D:\CodeProjects\fltk-2.0.x-master\fltk-2.0.x-master\ide\vcnet\CubeView.obj 1
Error LNK2019 unresolved external symbol __imp__glRasterPos2i#8 referenced in function "public: virtual void __thiscall fltk::GlWindow::flush(void)" (?flush#GlWindow#fltk##UAEXXZ) CubeView D:\CodeProjects\fltk-2.0.x-master\fltk-2.0.x-master\ide\vcnet\fltk2_gld.lib(Fl_Gl_Window.obj) 1
Error LNK2019 unresolved external symbol __imp__glReadBuffer#4 referenced in function "public: virtual void __thiscall fltk::GlWindow::flush(void)" (?flush#GlWindow#fltk##UAEXXZ) CubeView D:\CodeProjects\fltk-2.0.x-master\fltk-2.0.x-master\ide\vcnet\fltk2_gld.lib(Fl_Gl_Window.obj) 1
Error LNK2019 unresolved external symbol __imp__glRotatef#16 referenced in function "public: virtual void __thiscall CubeView::draw(void)" (?draw#CubeView##UAEXXZ) CubeView D:\CodeProjects\fltk-2.0.x-master\fltk-2.0.x-master\ide\vcnet\CubeView.obj 1
Error LNK2019 unresolved external symbol __imp__glScalef#12 referenced in function "public: virtual void __thiscall CubeView::draw(void)" (?draw#CubeView##UAEXXZ) CubeView D:\CodeProjects\fltk-2.0.x-master\fltk-2.0.x-master\ide\vcnet\CubeView.obj 1
Error LNK2019 unresolved external symbol __imp__glShadeModel#4 referenced in function "private: void __thiscall CubeView::drawCube(void)" (?drawCube#CubeView##AAEXXZ) CubeView D:\CodeProjects\fltk-2.0.x-master\fltk-2.0.x-master\ide\vcnet\CubeView.obj 1
Error LNK2019 unresolved external symbol __imp__glTranslatef#12 referenced in function "public: virtual void __thiscall CubeView::draw(void)" (?draw#CubeView##UAEXXZ) CubeView D:\CodeProjects\fltk-2.0.x-master\fltk-2.0.x-master\ide\vcnet\CubeView.obj 1
Error LNK2019 unresolved external symbol __imp__glVertex3fv#4 referenced in function "private: void __thiscall CubeView::drawCube(void)" (?drawCube#CubeView##AAEXXZ) CubeView D:\CodeProjects\fltk-2.0.x-master\fltk-2.0.x-master\ide\vcnet\CubeView.obj 1
Error LNK2001 unresolved external symbol __imp__glViewport#16 CubeView D:\CodeProjects\fltk-2.0.x-master\fltk-2.0.x-master\ide\vcnet\fltk2_gld.lib(Fl_Gl_Window.obj) 1
Error LNK2019 unresolved external symbol __imp__glViewport#16 referenced in function "public: virtual void __thiscall CubeView::draw(void)" (?draw#CubeView##UAEXXZ) CubeView D:\CodeProjects\fltk-2.0.x-master\fltk-2.0.x-master\ide\vcnet\CubeView.obj 1
Error LNK2019 unresolved external symbol __imp__wglCreateContext#4 referenced in function "struct HGLRC__ * __cdecl fltk::create_gl_context(class fltk::Window const *,class fltk::GlChoice const *,int)" (?create_gl_context#fltk##YAPAUHGLRC__##PBVWindow#1#PBVGlChoice#1#H#Z) CubeView D:\CodeProjects\fltk-2.0.x-master\fltk-2.0.x-master\ide\vcnet\fltk2_gld.lib(Fl_Gl_Choice.obj) 1
Error LNK2019 unresolved external symbol __imp__wglCreateLayerContext#8 referenced in function "struct HGLRC__ * __cdecl fltk::create_gl_context(class fltk::Window const *,class fltk::GlChoice const *,int)" (?create_gl_context#fltk##YAPAUHGLRC__##PBVWindow#1#PBVGlChoice#1#H#Z) CubeView D:\CodeProjects\fltk-2.0.x-master\fltk-2.0.x-master\ide\vcnet\fltk2_gld.lib(Fl_Gl_Choice.obj) 1
Error LNK2019 unresolved external symbol __imp__wglDeleteContext#4 referenced in function "void __cdecl fltk::delete_gl_context(struct HGLRC__ *)" (?delete_gl_context#fltk##YAXPAUHGLRC__###Z) CubeView D:\CodeProjects\fltk-2.0.x-master\fltk-2.0.x-master\ide\vcnet\fltk2_gld.lib(Fl_Gl_Choice.obj) 1
Error LNK2019 unresolved external symbol __imp__wglMakeCurrent#8 referenced in function "void __cdecl fltk::no_gl_context(void)" (?no_gl_context#fltk##YAXXZ) CubeView D:\CodeProjects\fltk-2.0.x-master\fltk-2.0.x-master\ide\vcnet\fltk2_gld.lib(Fl_Gl_Choice.obj) 1
Error LNK2019 unresolved external symbol __imp__wglShareLists#8 referenced in function "struct HGLRC__ * __cdecl fltk::create_gl_context(class fltk::Window const *,class fltk::GlChoice const *,int)" (?create_gl_context#fltk##YAPAUHGLRC__##PBVWindow#1#PBVGlChoice#1#H#Z) CubeView D:\CodeProjects\fltk-2.0.x-master\fltk-2.0.x-master\ide\vcnet\fltk2_gld.lib(Fl_Gl_Choice.obj) 1
Another 'output' portion that I failed to include:
1>------ Build started: Project: fltk, Configuration: Debug Win32 ------
1>C:\Apps\MSBuild\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(445,5): warning MSB8004: Output Directory does not end with a trailing slash. This build instance will add the slash as it is required to allow proper evaluation of the Output Directory.
1>C:\Apps\MSBuild\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(459,5): warning MSB8028: The intermediate directory (Debug\) contains files shared from another project (boxtype.vcxproj, checkers.vcxproj, color_chooser.vcxproj, CubeView.vcxproj, cursor.vcxproj, demo.vcxproj, editor.vcxproj, file_chooser.vcxproj, fltkdll.vcxproj, fltk_images.vcxproj, fltk_opengl.vcxproj, fonts.vcxproj, hello.vcxproj, image.vcxproj, input.vcxproj, label.vcxproj, libjpeg.vcxproj, libpng.vcxproj, pack.vcxproj, qubix.vcxproj, tile.vcxproj, zlib.vcxproj). This can lead to incorrect clean and rebuild behavior.
1>C:\Apps\MSBuild\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(1455,5): warning MSB8012: TargetPath(D:\CodeProjects\fltk-2.0.x-master\fltk-2.0.x-master\ide\vcnet\..\..\lib\fltk.lib) does not match the Library's OutputFile property value (D:\CodeProjects\fltk-2.0.x-master\fltk-2.0.x-master\lib\fltk2d.lib). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Lib.OutputFile).
1>C:\Apps\MSBuild\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(1457,5): warning MSB8012: TargetName(fltk) does not match the Library's OutputFile property value (fltk2d). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Lib.OutputFile).
1>fltk.lib.vcxproj -> D:\CodeProjects\fltk-2.0.x-master\fltk-2.0.x-master\ide\vcnet\..\..\lib\fltk.lib
1>Done building project "fltk.lib.vcxproj".
2>------ Build started: Project: CubeView, Configuration: Debug Win32 ------
2>C:\Apps\MSBuild\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(459,5): warning MSB8028: The intermediate directory (.\Debug\) contains files shared from another project (boxtype.vcxproj, checkers.vcxproj, color_chooser.vcxproj, cursor.vcxproj, demo.vcxproj, editor.vcxproj, file_chooser.vcxproj, fltk.vcxproj, fltkdll.vcxproj, fltk_images.vcxproj, fltk_opengl.vcxproj, fonts.vcxproj, hello.vcxproj, image.vcxproj, input.vcxproj, label.vcxproj, libjpeg.vcxproj, libpng.vcxproj, pack.vcxproj, qubix.vcxproj, tile.vcxproj, zlib.vcxproj). This can lead to incorrect clean and rebuild behavior.
2>cl : command line warning D9035: option 'Gm' has been deprecated and will be removed in a future release
2>cl : command line warning D9007: '/Gm' requires '/Zi or /ZI'; option ignored
2>CubeMain.cxx
2>CubeView.cxx
2>CubeViewUI.cxx
2>Generating Code...
2>C:\Apps\MSBuild\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(445,5): warning MSB8004: Output Directory does not end with a trailing slash. This build instance will add the slash as it is required to allow proper evaluation of the Output Directory.
2>C:\Apps\MSBuild\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(459,5): warning MSB8028: The intermediate directory (Debug\) contains files shared from another project (boxtype.vcxproj, checkers.vcxproj, color_chooser.vcxproj, CubeView.vcxproj, cursor.vcxproj, demo.vcxproj, editor.vcxproj, file_chooser.vcxproj, fltk.vcxproj, fltkdll.vcxproj, fltk_images.vcxproj, fonts.vcxproj, hello.vcxproj, image.vcxproj, input.vcxproj, label.vcxproj, libjpeg.vcxproj, libpng.vcxproj, pack.vcxproj, qubix.vcxproj, tile.vcxproj, zlib.vcxproj). This can lead to incorrect clean and rebuild behavior.
2>Done building project "fltk_opengl.vcxproj".
2>CubeView.obj : error LNK2019: unresolved external symbol __imp__glBegin#4 referenced in function "private: void __thiscall CubeView::drawCube(void)" (?drawCube#CubeView##AAEXXZ)
2>CubeView.obj : error LNK2019: unresolved external symbol __imp__glBlendFunc#8 referenced in function "public: virtual void __thiscall CubeView::draw(void)" (?draw#CubeView##UAEXXZ)
2>CubeView.obj : error LNK2019: unresolved external symbol __imp__glClear#4 referenced in function "public: virtual void __thiscall CubeView::draw(void)" (?draw#CubeView##UAEXXZ)
2>CubeView.obj : error LNK2019: unresolved external symbol __imp__glColor3f#12 referenced in function "private: void __thiscall CubeView::drawCube(void)" (?drawCube#CubeView##AAEXXZ)
2>CubeView.obj : error LNK2019: unresolved external symbol __imp__glColor4f#16 referenced in function "private: void __thiscall CubeView::drawCube(void)" (?drawCube#CubeView##AAEXXZ)
2>CubeView.obj : error LNK2019: unresolved external symbol __imp__glEnable#4 referenced in function "public: virtual void __thiscall CubeView::draw(void)" (?draw#CubeView##UAEXXZ)
2>CubeView.obj : error LNK2019: unresolved external symbol __imp__glEnd#0 referenced in function "private: void __thiscall CubeView::drawCube(void)" (?drawCube#CubeView##AAEXXZ)
2>CubeView.obj : error LNK2019: unresolved external symbol __imp__glLoadIdentity#0 referenced in function "public: virtual void __thiscall CubeView::draw(void)" (?draw#CubeView##UAEXXZ)
2>fltk2_gld.lib(Fl_Gl_Window.obj) : error LNK2001: unresolved external symbol __imp__glLoadIdentity#0
2>CubeView.obj : error LNK2019: unresolved external symbol __imp__glOrtho#48 referenced in function "public: virtual void __thiscall CubeView::draw(void)" (?draw#CubeView##UAEXXZ)
2>fltk2_gld.lib(Fl_Gl_Window.obj) : error LNK2001: unresolved external symbol __imp__glOrtho#48
2>CubeView.obj : error LNK2019: unresolved external symbol __imp__glPopMatrix#0 referenced in function "public: virtual void __thiscall CubeView::draw(void)" (?draw#CubeView##UAEXXZ)
2>CubeView.obj : error LNK2019: unresolved external symbol __imp__glPushMatrix#0 referenced in function "public: virtual void __thiscall CubeView::draw(void)" (?draw#CubeView##UAEXXZ)
2>CubeView.obj : error LNK2019: unresolved external symbol __imp__glRotatef#16 referenced in function "public: virtual void __thiscall CubeView::draw(void)" (?draw#CubeView##UAEXXZ)
2>CubeView.obj : error LNK2019: unresolved external symbol __imp__glScalef#12 referenced in function "public: virtual void __thiscall CubeView::draw(void)" (?draw#CubeView##UAEXXZ)
2>CubeView.obj : error LNK2019: unresolved external symbol __imp__glShadeModel#4 referenced in function "private: void __thiscall CubeView::drawCube(void)" (?drawCube#CubeView##AAEXXZ)
2>CubeView.obj : error LNK2019: unresolved external symbol __imp__glTranslatef#12 referenced in function "public: virtual void __thiscall CubeView::draw(void)" (?draw#CubeView##UAEXXZ)
2>CubeView.obj : error LNK2019: unresolved external symbol __imp__glVertex3fv#4 referenced in function "private: void __thiscall CubeView::drawCube(void)" (?drawCube#CubeView##AAEXXZ)
2>CubeView.obj : error LNK2019: unresolved external symbol __imp__glViewport#16 referenced in function "public: virtual void __thiscall CubeView::draw(void)" (?draw#CubeView##UAEXXZ)
2>fltk2_gld.lib(Fl_Gl_Window.obj) : error LNK2001: unresolved external symbol __imp__glViewport#16
2>run.obj : error LNK2019: unresolved external symbol _WSAAsyncSelect#16 referenced in function "void __cdecl fltk::add_fd(int,int,void (__cdecl*)(int,void *),void *)" (?add_fd#fltk##YAXHHP6AXHPAX#Z0#Z)
2>Widget.obj : error LNK2019: unresolved external symbol "void __cdecl delete_associations_for(class fltk::Widget *)" (?delete_associations_for##YAXPAVWidget#fltk###Z) referenced in function "public: virtual __thiscall fltk::Widget::~Widget(void)" (??1Widget#fltk##UAE#XZ)
2>fltk2_gld.lib(Fl_Gl_Window.obj) : error LNK2019: unresolved external symbol __imp__glCopyPixels#20 referenced in function "public: virtual void __thiscall fltk::GlWindow::flush(void)" (?flush#GlWindow#fltk##UAEXXZ)
2>fltk2_gld.lib(Fl_Gl_Window.obj) : error LNK2019: unresolved external symbol __imp__glDisable#4 referenced in function "public: virtual void __thiscall fltk::GlWindow::flush(void)" (?flush#GlWindow#fltk##UAEXXZ)
2>fltk2_gld.lib(Fl_Gl_Window.obj) : error LNK2019: unresolved external symbol __imp__glDrawBuffer#4 referenced in function "public: virtual void __thiscall fltk::GlWindow::flush(void)" (?flush#GlWindow#fltk##UAEXXZ)
2>fltk2_gld.lib(Fl_Gl_Window.obj) : error LNK2019: unresolved external symbol __imp__glFlush#0 referenced in function "public: virtual void __thiscall fltk::GlWindow::flush(void)" (?flush#GlWindow#fltk##UAEXXZ)
2>fltk2_gld.lib(Fl_Gl_Window.obj) : error LNK2019: unresolved external symbol __imp__glRasterPos2i#8 referenced in function "public: virtual void __thiscall fltk::GlWindow::flush(void)" (?flush#GlWindow#fltk##UAEXXZ)
2>fltk2_gld.lib(Fl_Gl_Window.obj) : error LNK2019: unresolved external symbol __imp__glReadBuffer#4 referenced in function "public: virtual void __thiscall fltk::GlWindow::flush(void)" (?flush#GlWindow#fltk##UAEXXZ)
2>fltk2_gld.lib(Fl_Gl_Choice.obj) : error LNK2019: unresolved external symbol __imp__wglCreateContext#4 referenced in function "struct HGLRC__ * __cdecl fltk::create_gl_context(class fltk::Window const *,class fltk::GlChoice const *,int)" (?create_gl_context#fltk##YAPAUHGLRC__##PBVWindow#1#PBVGlChoice#1#H#Z)
2>fltk2_gld.lib(Fl_Gl_Choice.obj) : error LNK2019: unresolved external symbol __imp__wglCreateLayerContext#8 referenced in function "struct HGLRC__ * __cdecl fltk::create_gl_context(class fltk::Window const *,class fltk::GlChoice const *,int)" (?create_gl_context#fltk##YAPAUHGLRC__##PBVWindow#1#PBVGlChoice#1#H#Z)
2>fltk2_gld.lib(Fl_Gl_Choice.obj) : error LNK2019: unresolved external symbol __imp__wglDeleteContext#4 referenced in function "void __cdecl fltk::delete_gl_context(struct HGLRC__ *)" (?delete_gl_context#fltk##YAXPAUHGLRC__###Z)
2>fltk2_gld.lib(Fl_Gl_Choice.obj) : error LNK2019: unresolved external symbol __imp__wglMakeCurrent#8 referenced in function "void __cdecl fltk::no_gl_context(void)" (?no_gl_context#fltk##YAXXZ)
2>fltk2_gld.lib(Fl_Gl_Choice.obj) : error LNK2019: unresolved external symbol __imp__wglShareLists#8 referenced in function "struct HGLRC__ * __cdecl fltk::create_gl_context(class fltk::Window const *,class fltk::GlChoice const *,int)" (?create_gl_context#fltk##YAPAUHGLRC__##PBVWindow#1#PBVGlChoice#1#H#Z)
2>.\Debug\CubeView.exe : fatal error LNK1120: 30 unresolved externals
2>Done building project "CubeView.vcxproj" -- FAILED.
========== Build: 1 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========
It appears that you need to add the Windows libraries to link.
I would start with adding these libraries to your linker command:
glu32.lib opengl32.lib ole32.lib uuid.lib comctl32.lib
If you are still missing things start adding these libraries if you are not already.
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib oleaut32.lib odbc32.lib odbccp32.lib
I'm sure I'm missing something trivial, but I can't put my finger on what.
I'm building a project with four external libraries using CLion. I'm trying to link Eigen, GLEW, GLFW, and libigl. I'm using the VC++ compiler in VS 2015.
This is one iteration of my cmake file:
cmake_minimum_required(VERSION 3.9)
project(Lab1)
set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_CXX_STANDARD 17)
add_executable(Lab1 main.cpp)
include_directories(external/libigl/include)
include_directories(external/glfw/include/)
include_directories(external/eigen-git-mirror/)
include_directories(external/glew_2_1_0/include)
INCLUDE_DIRECTORIES(external/glew_2_1_0/lib/Release/x64)
link_libraries(external/glew_2_1_0/lib/Release/x64)
I have added the glew libraries (both 32 and 64 bit) to their respective folders in VC++. I've also added the glew32.dll files to (64 and 32 bit) to their respective folders in the system folders. I don't think I need to do this if I define where to look for them in my Cmake file, but I'm not entirely sure.
This is my folder structure in CLion:
CLion folder structure.
Here's what main.cpp contains in case it matters:
#include <igl/readOFF.h>
#include <igl/viewer/Viewer.h>
Eigen::MatrixXd V;
Eigen::MatrixXi F;
int main(int argc, char *argv[])
{
// Load a mesh in OFF format
igl::readOFF("bunny.off", V, F);
// Plot the mesh
igl::viewer::Viewer viewer;
viewer.data.set_mesh(V, F);
viewer.launch();
}
These are the linker errors I get.
[100%] Linking CXX executable Lab1.exe
"D:\Actual Program Files\JetBrains\CLion 2017.3.1\bin\cmake\bin\cmake.exe" -E vs_link_exe --intdir=CMakeFiles\Lab1.dir --manifests -- D:\ACTUAL~1\VISUAL~2\VC\bin\link.exe /nologo #CMakeFiles\Lab1.dir\objects1.rsp #C:\Users\Mohammed\AppData\Local\Temp\nm6742.tmp
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glBindTexture#8 referenced in function "public: void __thiscall igl::viewer::OpenGL_state::bind_mesh(void)" (?bind_mesh#OpenGL_state#viewer#igl##QAEXXZ)
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glBlendFunc#8 referenced in function "public: void __thiscall igl::viewer::ViewerCore::draw(class igl::viewer::ViewerData &,class igl::viewer::OpenGL_state &,bool)" (?draw#ViewerCore#viewer#igl##QAEXAAVViewerData#23#AAVOpenGL_state#23#_N#Z)
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glClear#4 referenced in function "public: void __thiscall igl::viewer::ViewerCore::clear_framebuffers(void)" (?clear_framebuffers#ViewerCore#viewer#igl##QAEXXZ)
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glClearColor#16 referenced in function "public: void __thiscall igl::viewer::ViewerCore::clear_framebuffers(void)" (?clear_framebuffers#ViewerCore#viewer#igl##QAEXXZ)
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glDeleteTextures#8 referenced in function "public: void __thiscall igl::viewer::OpenGL_state::free_buffers(void)" (?free_buffers#OpenGL_state#viewer#igl##QAEXXZ)
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glDisable#4 referenced in function "public: void __thiscall igl::viewer::ViewerCore::draw(class igl::viewer::ViewerData &,class igl::viewer::OpenGL_state &,bool)" (?draw#ViewerCore#viewer#igl##QAEXAAVViewerData#23#AAVOpenGL_state#23#_N#Z)
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glDrawElements#16 referenced in function "public: void __thiscall igl::viewer::OpenGL_state::draw_mesh(bool)" (?draw_mesh#OpenGL_state#viewer#igl##QAEX_N#Z)
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glEnable#4 referenced in function "public: void __thiscall igl::viewer::ViewerCore::draw(class igl::viewer::ViewerData &,class igl::viewer::OpenGL_state &,bool)" (?draw#ViewerCore#viewer#igl##QAEXAAVViewerData#23#AAVOpenGL_state#23#_N#Z)
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glGenTextures#8 referenced in function "public: void __thiscall igl::viewer::OpenGL_state::init_buffers(void)" (?init_buffers#OpenGL_state#viewer#igl##QAEXXZ)
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glGetError#0 referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glGetString#4 referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glLineWidth#4 referenced in function "public: void __thiscall igl::viewer::ViewerCore::draw(class igl::viewer::ViewerData &,class igl::viewer::OpenGL_state &,bool)" (?draw#ViewerCore#viewer#igl##QAEXAAVViewerData#23#AAVOpenGL_state#23#_N#Z)
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glPixelStorei#8 referenced in function "public: void __thiscall igl::viewer::OpenGL_state::bind_mesh(void)" (?bind_mesh#OpenGL_state#viewer#igl##QAEXXZ)
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glPointSize#4 referenced in function "public: void __thiscall igl::viewer::ViewerCore::draw(class igl::viewer::ViewerData &,class igl::viewer::OpenGL_state &,bool)" (?draw#ViewerCore#viewer#igl##QAEXAAVViewerData#23#AAVOpenGL_state#23#_N#Z)
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glPolygonMode#8 referenced in function "public: void __thiscall igl::viewer::OpenGL_state::draw_mesh(bool)" (?draw_mesh#OpenGL_state#viewer#igl##QAEX_N#Z)
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glPolygonOffset#8 referenced in function "public: void __thiscall igl::viewer::OpenGL_state::draw_mesh(bool)" (?draw_mesh#OpenGL_state#viewer#igl##QAEX_N#Z)
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glTexImage2D#36 referenced in function "public: void __thiscall igl::viewer::OpenGL_state::bind_mesh(void)" (?bind_mesh#OpenGL_state#viewer#igl##QAEXXZ)
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glTexParameteri#12 referenced in function "public: void __thiscall igl::viewer::OpenGL_state::bind_mesh(void)" (?bind_mesh#OpenGL_state#viewer#igl##QAEXXZ)
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glViewport#16 referenced in function "public: void __thiscall igl::viewer::ViewerCore::draw(class igl::viewer::ViewerData &,class igl::viewer::OpenGL_state &,bool)" (?draw#ViewerCore#viewer#igl##QAEXAAVViewerData#23#AAVOpenGL_state#23#_N#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glewInit#0 referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glewGetErrorString#4 referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glewGetString#4 referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwInit referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwTerminate referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwSetErrorCallback referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwGetPrimaryMonitor referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwGetVideoMode referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwWindowHint referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwCreateWindow referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwDestroyWindow referenced in function "public: void __thiscall igl::viewer::Viewer::launch_shut(void)" (?launch_shut#Viewer#viewer#igl##QAEXXZ)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwWindowShouldClose referenced in function "public: bool __thiscall igl::viewer::Viewer::launch_rendering(bool)" (?launch_rendering#Viewer#viewer#igl##QAE_N_N#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwSetWindowShouldClose referenced in function "void __cdecl glfw_key_callback(struct GLFWwindow *,int,int,int,int)" (?glfw_key_callback##YAXPAUGLFWwindow##HHHH#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwGetWindowSize referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwGetFramebufferSize referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwGetWindowAttrib referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwSetWindowSizeCallback referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwPollEvents referenced in function "public: bool __thiscall igl::viewer::Viewer::launch_rendering(bool)" (?launch_rendering#Viewer#viewer#igl##QAE_N_N#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwWaitEvents referenced in function "public: bool __thiscall igl::viewer::Viewer::launch_rendering(bool)" (?launch_rendering#Viewer#viewer#igl##QAE_N_N#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwSetInputMode referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwSetKeyCallback referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwSetCharModsCallback referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwSetMouseButtonCallback referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwSetCursorPosCallback referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwSetScrollCallback referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwSetDropCallback referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwMakeContextCurrent referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwSwapBuffers referenced in function "public: bool __thiscall igl::viewer::Viewer::launch_rendering(bool)" (?launch_rendering#Viewer#viewer#igl##QAE_N_N#Z)
main.cpp.obj : error LNK2001: unresolved external symbol ___glewActiveTexture
main.cpp.obj : error LNK2001: unresolved external symbol ___glewBindBuffer
main.cpp.obj : error LNK2001: unresolved external symbol ___glewBufferData
main.cpp.obj : error LNK2001: unresolved external symbol ___glewDeleteBuffers
main.cpp.obj : error LNK2001: unresolved external symbol ___glewGenBuffers
main.cpp.obj : error LNK2001: unresolved external symbol ___glewAttachShader
main.cpp.obj : error LNK2001: unresolved external symbol ___glewCompileShader
main.cpp.obj : error LNK2001: unresolved external symbol ___glewCreateProgram
main.cpp.obj : error LNK2001: unresolved external symbol ___glewCreateShader
main.cpp.obj : error LNK2001: unresolved external symbol ___glewDeleteProgram
main.cpp.obj : error LNK2001: unresolved external symbol ___glewDeleteShader
main.cpp.obj : error LNK2001: unresolved external symbol ___glewDisableVertexAttribArray
main.cpp.obj : error LNK2001: unresolved external symbol ___glewEnableVertexAttribArray
main.cpp.obj : error LNK2001: unresolved external symbol ___glewGetAttribLocation
main.cpp.obj : error LNK2001: unresolved external symbol ___glewGetProgramInfoLog
main.cpp.obj : error LNK2001: unresolved external symbol ___glewGetProgramiv
main.cpp.obj : error LNK2001: unresolved external symbol ___glewGetShaderInfoLog
main.cpp.obj : error LNK2001: unresolved external symbol ___glewGetShaderiv
main.cpp.obj : error LNK2001: unresolved external symbol ___glewGetUniformLocation
main.cpp.obj : error LNK2001: unresolved external symbol ___glewLinkProgram
main.cpp.obj : error LNK2001: unresolved external symbol ___glewShaderSource
main.cpp.obj : error LNK2001: unresolved external symbol ___glewUniform1f
main.cpp.obj : error LNK2001: unresolved external symbol ___glewUniform1i
main.cpp.obj : error LNK2001: unresolved external symbol ___glewUniform3fv
main.cpp.obj : error LNK2001: unresolved external symbol ___glewUniform4f
main.cpp.obj : error LNK2001: unresolved external symbol ___glewUniformMatrix4fv
main.cpp.obj : error LNK2001: unresolved external symbol ___glewUseProgram
main.cpp.obj : error LNK2001: unresolved external symbol ___glewVertexAttribPointer
main.cpp.obj : error LNK2001: unresolved external symbol ___glewBindFragDataLocation
main.cpp.obj : error LNK2001: unresolved external symbol ___glewProgramParameteri
main.cpp.obj : error LNK2001: unresolved external symbol ___glewBindVertexArray
main.cpp.obj : error LNK2001: unresolved external symbol ___glewDeleteVertexArrays
main.cpp.obj : error LNK2001: unresolved external symbol ___glewGenVertexArrays
main.cpp.obj : error LNK2001: unresolved external symbol _glewExperimental
Lab1.exe : fatal error LNK1120: 81 unresolved externals
LINK Pass 1 failed. with 1120
NMAKE : fatal error U1077: '"D:\Actual Program Files\JetBrains\CLion 2017.3.1\bin\cmake\bin\cmake.exe"' : return code '0xffffffff'
Stop.
NMAKE : fatal error U1077: '"D:\Actual Program Files\Visual Studio 2015\VC\BIN\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"D:\Actual Program Files\Visual Studio 2015\VC\BIN\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"D:\Actual Program Files\Visual Studio 2015\VC\BIN\nmake.exe"' : return code '0x2'
Stop.
Thanks for the help.
EDIT:
Tsyvarev helped me out with the obvious errors. Changed everything to 32-bit too. Down to 47 unresolved externals. Will update once it's working.
Current Cmake:
cmake_minimum_required(VERSION 3.9)
project(Lab1)
set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_CXX_STANDARD 17)
link_libraries(../external/glew_2_1_0/lib/Release/Win32/glew32s)
add_executable(Lab1 main.cpp)
include_directories(external/libigl/include)
include_directories(external/glfw/include/)
include_directories(external/eigen-git-mirror/)
include_directories(external/glew_2_1_0/include)
EDIT: SOLVED It all works! Was missing some libraries. Decided to link them locally. Here's the cmake for the next pour soul that comes across this:
cmake_minimum_required(VERSION 3.9)
project(Lab1)
set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_CXX_STANDARD 17)
link_libraries(../external/glew_2_1_0/lib/Release/Win32/glew32s)
link_libraries(../external/glfw/lib-vc2015/glfw3)
link_libraries(../external/openGL/OPENGL32)
link_libraries(../external/openGL/glut32)
link_libraries(../external/openGL/glu32)
find_package(OpenGL REQUIRED)
include_directories( ${OPENGL_INCLUDE_DIRS})
#target_link_libraries(${PROJECTNAME} ${OPENGL_LIBRARIES})
add_executable(Lab1 main.cpp)
include_directories(external/libigl/include)
include_directories(external/glfw/include/)
include_directories(external/eigen-git-mirror/)
include_directories(external/glew_2_1_0/include)
Thanks for the help!
Command link_libraries affects only on futher targets, so it should be issued before add_executable call.
Also, link_libraries accepts library files, not a directory with them.
I'm trying to compile the zeromq sources and I have the following error:
I'm using Visual studio 2013 update 4 / windows 7 x64
First of all I compile the libsodium library satisfactorily.
Then I link the libsodium header files directory path to additional dependencies and libsodium.lib to additional library directories. I also specify the name of library in additional dependencies.
I try to compile it under win32 architecture and x64 architecture but I get the same errors.
I know that a __imp prefix is used as a bridge to the function that I want to use so if I linked the libraries appropiately why do I get this error?
Console log:
1>Creating library E:\zmq\libzmq\builds\msvc\vs2013\libzmq\..\..\..\..\bin\Win32\Debug\v120\dynamic\libzmq.lib and object E:\zmq\libzmq\builds\msvc\vs2013\libzmq\..\..\..\..\bin\Win32\Debug\v120\dynamic\libzmq.exp
1>ctx.obj : error LNK2019: unresolved external symbol __imp__randombytes_close referenced in function "public: __thiscall zmq::ctx_t::~ctx_t(void)" (??1ctx_t#zmq##QAE#XZ)
1>curve_client.obj : error LNK2019: unresolved external symbol __imp__sodium_init referenced in function "public: __thiscall zmq::curve_client_t::curve_client_t(struct zmq::options_t const &)" (??0curve_client_t#zmq##QAE#ABUoptions_t#1##Z)
1>curve_server.obj : error LNK2001: unresolved external symbol __imp__sodium_init
1>curve_client.obj : error LNK2019: unresolved external symbol __imp__crypto_box_keypair referenced in function "public: __thiscall zmq::curve_client_t::curve_client_t(struct zmq::options_t const &)" (??0curve_client_t#zmq##QAE#ABUoptions_t#1##Z)
1>curve_server.obj : error LNK2001: unresolved external symbol __imp__crypto_box_keypair
1>zmq_utils.obj : error LNK2001: unresolved external symbol __imp__crypto_box_keypair
1>curve_client.obj : error LNK2019: unresolved external symbol __imp__crypto_box_beforenm referenced in function "private: int __thiscall zmq::curve_client_t::process_welcome(unsigned char const *,unsigned int)" (?process_welcome#curve_client_t#zmq##AAEHPBEI#Z)
1>curve_server.obj : error LNK2001: unresolved external symbol __imp__crypto_box_beforenm
1>curve_client.obj : error LNK2019: unresolved external symbol __imp__crypto_box referenced in function "private: int __thiscall zmq::curve_client_t::produce_hello(class zmq::msg_t *)" (?produce_hello#curve_client_t#zmq##AAEHPAVmsg_t#2##Z)
1>curve_server.obj : error LNK2001: unresolved external symbol __imp__crypto_box
1>curve_client.obj : error LNK2019: unresolved external symbol __imp__crypto_box_open referenced in function "private: int __thiscall zmq::curve_client_t::process_welcome(unsigned char const *,unsigned int)" (?process_welcome#curve_client_t#zmq##AAEHPBEI#Z)
1>curve_server.obj : error LNK2001: unresolved external symbol __imp__crypto_box_open
1>curve_client.obj : error LNK2019: unresolved external symbol __imp__crypto_box_afternm referenced in function "public: virtual int __thiscall zmq::curve_client_t::encode(class zmq::msg_t *)" (?encode#curve_client_t#zmq##UAEHPAVmsg_t#2##Z)
1>curve_server.obj : error LNK2001: unresolved external symbol __imp__crypto_box_afternm
1>curve_client.obj : error LNK2019: unresolved external symbol __imp__crypto_box_open_afternm referenced in function "public: virtual int __thiscall zmq::curve_client_t::decode(class zmq::msg_t *)" (?decode#curve_client_t#zmq##UAEHPAVmsg_t#2##Z)
1>curve_server.obj : error LNK2001: unresolved external symbol __imp__crypto_box_open_afternm
1>curve_client.obj : error LNK2019: unresolved external symbol __imp__randombytes referenced in function "private: int __thiscall zmq::curve_client_t::produce_initiate(class zmq::msg_t *)" (?produce_initiate#curve_client_t#zmq##AAEHPAVmsg_t#2##Z)
1>curve_server.obj : error LNK2001: unresolved external symbol __imp__randombytes
1>curve_server.obj : error LNK2019: unresolved external symbol __imp__crypto_secretbox referenced in function "private: int __thiscall zmq::curve_server_t::produce_welcome(class zmq::msg_t *)" (?produce_welcome#curve_server_t#zmq##AAEHPAVmsg_t#2##Z)
1>curve_server.obj : error LNK2019: unresolved external symbol __imp__crypto_secretbox_open referenced in function "private: int __thiscall zmq::curve_server_t::process_initiate(class zmq::msg_t *)" (?process_initiate#curve_server_t#zmq##AAEHPAVmsg_t#2##Z)
Thanks in advance.
You're probably compiling libsodium in a static way.
Try to compile it dinamically and link it again.
Such errors are also able to occur when you have a wrong set calling convention at your project.
I have been trying to communicate with my cassandra database with this demo code from Cassandra's cpp-driver. I am using Visual Studio Express 2013 I have been blocked with the following errors:
1>------ Build started: Project: Test_Boost, Configuration: Debug Win32 ------
1> main.cpp`
1>main.obj : error LNK2019: unresolved external symbol "void __cdecl cql::cql_initialize(void)" (?cql_initialize#cql##YAXXZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: static class boost::shared_ptr<class cql::cql_builder_t> __cdecl cql::cql_cluster_t::builder(void)" (?builder#cql_cluster_t#cql##SA?AV?$shared_ptr#Vcql_builder_t#cql###boost##XZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol _sk_new_null referenced in function "public: __thiscall boost::asio::ssl::detail::openssl_init_base::do_init::do_init(void)" (??0do_init#openssl_init_base#detail#ssl#asio#boost##QAE#XZ)
1>main.obj : error LNK2019: unresolved external symbol _sk_free referenced in function "public: __thiscall boost::asio::ssl::detail::openssl_init_base::do_init::~do_init(void)" (??1do_init#openssl_init_base#detail#ssl#asio#boost##QAE#XZ)
1>main.obj : error LNK2019: unresolved external symbol _CRYPTO_cleanup_all_ex_data referenced in function "public: __thiscall boost::asio::ssl::detail::openssl_init_base::do_init::~do_init(void)" (??1do_init#openssl_init_base#detail#ssl#asio#boost##QAE#XZ)
1>main.obj : error LNK2019: unresolved external symbol _CRYPTO_num_locks referenced in function "public: __thiscall boost::asio::ssl::detail::openssl_init_base::do_init::do_init(void)" (??0do_init#openssl_init_base#detail#ssl#asio#boost##QAE#XZ)
1>main.obj : error LNK2019: unresolved external symbol _CRYPTO_set_locking_callback referenced in function "public: __thiscall boost::asio::ssl::detail::openssl_init_base::do_init::do_init(void)" (??0do_init#openssl_init_base#detail#ssl#asio#boost##QAE#XZ)
1>main.obj : error LNK2019: unresolved external symbol _CRYPTO_set_id_callback referenced in function "public: __thiscall boost::asio::ssl::detail::openssl_init_base::do_init::do_init(void)" (??0do_init#openssl_init_base#detail#ssl#asio#boost##QAE#XZ)
1>main.obj : error LNK2019: unresolved external symbol _CONF_modules_unload referenced in function "public: __thiscall boost::asio::ssl::detail::openssl_init_base::do_init::~do_init(void)" (??1do_init#openssl_init_base#detail#ssl#asio#boost##QAE#XZ)
1>main.obj : error LNK2019: unresolved external symbol _OPENSSL_add_all_algorithms_noconf referenced in function "public: __thiscall boost::asio::ssl::detail::openssl_init_base::do_init::do_init(void)" (??0do_init#openssl_init_base#detail#ssl#asio#boost##QAE#XZ)
1>main.obj : error LNK2019: unresolved external symbol _EVP_cleanup referenced in function "public: __thiscall boost::asio::ssl::detail::openssl_init_base::do_init::~do_init(void)" (??1do_init#openssl_init_base#detail#ssl#asio#boost##QAE#XZ)
1>main.obj : error LNK2019: unresolved external symbol _SSL_load_error_strings referenced in function "public: __thiscall boost::asio::ssl::detail::openssl_init_base::do_init::do_init(void)" (??0do_init#openssl_init_base#detail#ssl#asio#boost##QAE#XZ)
1>main.obj : error LNK2019: unresolved external symbol _SSL_library_init referenced in function "public: __thiscall boost::asio::ssl::detail::openssl_init_base::do_init::do_init(void)" (??0do_init#openssl_init_base#detail#ssl#asio#boost##QAE#XZ)
1>main.obj : error LNK2019: unresolved external symbol _ERR_reason_error_string referenced in function "public: virtual class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall boost::asio::error::detail::ssl_category::message(int)const " (?message#ssl_category#detail#error#asio#boost##UBE?AV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##H#Z)
1>main.obj : error LNK2019: unresolved external symbol _ERR_free_strings referenced in function "public: __thiscall boost::asio::ssl::detail::openssl_init_base::do_init::~do_init(void)" (??1do_init#openssl_init_base#detail#ssl#asio#boost##QAE#XZ)
1>main.obj : error LNK2019: unresolved external symbol _ERR_remove_state referenced in function "public: __thiscall boost::asio::ssl::detail::openssl_init_base::do_init::~do_init(void)" (??1do_init#openssl_init_base#detail#ssl#asio#boost##QAE#XZ)
1>main.obj : error LNK2019: unresolved external symbol _ENGINE_cleanup referenced in function "public: __thiscall boost::asio::ssl::detail::openssl_init_base::do_init::~do_init(void)" (??1do_init#openssl_init_base#detail#ssl#asio#boost##QAE#XZ)
1>main.obj : error LNK2019: unresolved external symbol "public: class boost::shared_ptr<class cql::cql_cluster_t> __thiscall cql::cql_builder_t::build(void)" (?build#cql_builder_t#cql##QAE?AV?$shared_ptr#Vcql_cluster_t#cql###boost##XZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: class cql::cql_builder_t & __thiscall cql::cql_builder_t::add_contact_point(class boost::asio::ip::address const &)" (?add_contact_point#cql_builder_t#cql##QAEAAV12#ABVaddress#ip#asio#boost###Z) referenced in function _main
1>D:\dev\CassandraData\VisualStudio\Test_Boost\Debug\Test_Boost.exe : fatal error LNK1120: 19 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I am a complete newbie in cpp and I would appreciate any help!
Thank you!
I am quite new to C++ so I downloaded a sample C++ program. The sample program seems to hit the following error when it is compiling :-
Error 22 error LNK2019: unresolved external symbol _acsEnumServerNames#12 referenced in function "protected: virtual int __thiscall COpenTsrv::OnInitDialog(void)" (?OnInitDialog#COpenTsrv##MAEHXZ) Opentsrv.obj
I traced it to the referred function but I do not know anything wrong with it ?
BOOL COpenTsrv::OnInitDialog()
{
CDialog::OnInitDialog();
CenterWindow();
acsEnumServerNames(ST_CSTA, AddToList, (unsigned long) (CComboBox*)&m_TserverListControl);
UpdateData(FALSE);
The following is the build log. Apparently there are still other errors but would like to start with the first one.
1>Generating Code...
1>Compiling resources...
1>Compiling manifest to resources...
1>Linking...
1>Opentsrv.obj : error LNK2019: unresolved external symbol _acsEnumServerNames#12 referenced in function "protected: virtual int __thiscall COpenTsrv::OnInitDialog(void)" (? OnInitDialog#COpenTsrv##MAEHXZ)
1>Opentsrv.obj : error LNK2019: unresolved external symbol _acsQueryAuthInfo#8 referenced in function "protected: void __thiscall COpenTsrv::OnSelchangeTserverlist(void)" (?OnSelchangeTserverlist#COpenTsrv##IAEXXZ)
1>Opentsrv.obj : error LNK2019: unresolved external symbol _acsAbortStream#8 referenced in function "protected: virtual void __thiscall COpenTsrv::OnOK(void)" (?OnOK#COpenTsrv##MAEXXZ)
1>Tsapi.obj : error LNK2001: unresolved external symbol _acsAbortStream#8
1>Opentsrv.obj : error LNK2019: unresolved external symbol _acsEventNotify#16 referenced in function "protected: virtual void __thiscall COpenTsrv::OnOK(void)" (?OnOK#COpenTsrv##MAEXXZ)
1>Opentsrv.obj : error LNK2019: unresolved external symbol _acsOpenStream#60 referenced in function "protected: virtual void __thiscall COpenTsrv::OnOK(void)" (?OnOK#COpenTsrv##MAEXXZ)
1>Opentsrv.obj : error LNK2019: unresolved external symbol _cstaMonitorDevice#20 referenced in function "protected: long __thiscall COpenTsrv::OnTsapiAcsConfirmation(unsigned int,long)" (?OnTsapiAcsConfirmation#COpenTsrv##IAEJIJ#Z)
1>Sampldlg.obj : error LNK2019: unresolved external symbol _cstaMakeCall#20 referenced in function "protected: void __thiscall CSampleDlg::OnCall(void)" (?OnCall#CSampleDlg##IAEXXZ)
1>Sampldlg.obj : error LNK2019: unresolved external symbol _cstaClearConnection#16 referenced in function "protected: void __thiscall CSampleDlg::OnHangup(void)" (?OnHangup#CSampleDlg##IAEXXZ)
1>Sampldlg.obj : error LNK2019: unresolved external symbol _cstaAnswerCall#16 referenced in function "protected: void __thiscall CSampleDlg::OnAnswer(void)" (?OnAnswer#CSampleDlg##IAEXXZ)
1>Tsapi.obj : error LNK2019: unresolved external symbol _acsGetEventPoll#20 referenced in function "protected: long __thiscall CTsapiWnd::OnTsapiMsg(unsigned int,long)" (?OnTsapiMsg#CTsapiWnd##IAEJIJ#Z)
1>C:\Users\steventang\Documents\Visual Studio 2005\Projects\TSAPINEW\Debug\TSAPINEW.exe : fatal error LNK1120: 10 unresolved externals
1>Build log was saved at "file://c:\Users\steventang\Documents\Visual Studio 2005\Projects\TSAPINEW\TSAPINEW\Debug\BuildLog.htm"
1>TSAPINEW - 12 error(s), 21 warning(s)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
Any help to point me to the right direction would very much be appreciated.
Thanks
Seems like your compilation was sucessfull. Only the linking did not work.
Probably the linker is complaining because you defined the header of the method "acsEnumServerNames" but you did not provide an implementation of the method.
Maybe you used a header-file but you did not provide the library to which the header belongs ?
Find out to which pakage "acsEnumServerNames" belongs and check if you have the implementation of the method in some .c/.cpp file, or if the implementation should be provided by some library on which you do rely.