Hi,
I am trying to build a sort of game engine for myself using allegro. I had what I have so far working perfectly when linking to the non-static versions of allegro found at http://allegro.cc/files, using visual studio 2010. however, when I tried to link with the static versions, it gave me tons of linker errors. It looks to me like most of them have to do with open gl or something, which I wouldn't be using on windows anyway. Here goes -- hang tight!:
1>------ Build started: Project: allegro-test, Configuration: Debug Win32 ------
1>Build started 4/2/2012 3:08:31 AM.
1>InitializeBuildStatus:
1> Touching "Debug\allegro-test.unsuccessfulbuild".
1>ClCompile:
1> test.cpp
1>test.obj : warning LNK4217: locally defined symbol _al_rest imported in function _main
1>test.obj : warning LNK4217: locally defined symbol _al_install_keyboard imported in function _main
1>test.obj : warning LNK4217: locally defined symbol _al_get_display_mode imported in function _main
1>test.obj : warning LNK4217: locally defined symbol _al_get_num_display_modes imported in function _main
1>test.obj : warning LNK4217: locally defined symbol _al_install_system imported in function _main
1>allegro-5.0.6-static-mt.lib(wtime.obj) : error LNK2019: unresolved external symbol __imp__timeGetTime@0 referenced in function _low_res_current_time
1>allegro-5.0.6-static-mt.lib(wxthread.obj) : error LNK2001: unresolved external symbol __imp__timeGetTime@0
1>allegro-5.0.6-static-mt.lib(wsystem.obj) : error LNK2019: unresolved external symbol __imp__timeBeginPeriod@4 referenced in function _win_initialize
1>allegro-5.0.6-static-mt.lib(wsystem.obj) : error LNK2019: unresolved external symbol __imp__timeEndPeriod@4 referenced in function _win_shutdown
1>allegro-5.0.6-static-mt.lib(wsystem.obj) : error LNK2019: unresolved external symbol _GetModuleFileNameExA@16 referenced in function __al_win_get_path
1>allegro-5.0.6-static-mt.lib(wsystem.obj) : error LNK2019: unresolved external symbol __imp__PathFindOnPathA@8 referenced in function __al_win_safe_load_library
1>allegro-5.0.6-static-mt.lib(wgl_disp.obj) : error LNK2019: unresolved external symbol __imp__glOrtho@48 referenced in function _setup_gl
1>allegro-5.0.6-static-mt.lib(ogl_display.obj) : error LNK2001: unresolved external symbol __imp__glOrtho@48
1>allegro-5.0.6-static-mt.lib(wgl_disp.obj) : error LNK2019: unresolved external symbol __imp__glLoadIdentity@0 referenced in function _setup_gl
1>allegro-5.0.6-static-mt.lib(ogl_display.obj) : error LNK2001: unresolved external symbol __imp__glLoadIdentity@0
1>allegro-5.0.6-static-mt.lib(ogl_draw.obj) : error LNK2001: unresolved external symbol __imp__glLoadIdentity@0
1>allegro-5.0.6-static-mt.lib(ogl_bitmap.obj) : error LNK2001: unresolved external symbol __imp__glLoadIdentity@0
1>allegro-5.0.6-static-mt.lib(wgl_disp.obj) : error LNK2019: unresolved external symbol __imp__glMatrixMode@4 referenced in function _setup_gl
1>allegro-5.0.6-static-mt.lib(ogl_display.obj) : error LNK2001: unresolved external symbol __imp__glMatrixMode@4
1>allegro-5.0.6-static-mt.lib(ogl_draw.obj) : error LNK2001: unresolved external symbol __imp__glMatrixMode@4
1>allegro-5.0.6-static-mt.lib(wgl_disp.obj) : error LNK2019: unresolved external symbol __imp__glViewport@16 referenced in function _setup_gl
1>allegro-5.0.6-static-mt.lib(ogl_display.obj) : error LNK2001: unresolved external symbol __imp__glViewport@16
1>allegro-5.0.6-static-mt.lib(wgl_disp.obj) : error LNK2019: unresolved external symbol __imp__wglGetProcAddress@4 referenced in function _is_wgl_extension_supported
1>allegro-5.0.6-static-mt.lib(extensions.obj) : error LNK2001: unresolved external symbol __imp__wglGetProcAddress@4
1>allegro-5.0.6-static-mt.lib(wgl_disp.obj) : error LNK2019: unresolved external symbol __imp__glGetString@4 referenced in function _is_wgl_extension_supported
1>allegro-5.0.6-static-mt.lib(extensions.obj) : error LNK2001: unresolved external symbol __imp__glGetString@4
1>allegro-5.0.6-static-mt.lib(wgl_disp.obj) : error LNK2019: unresolved external symbol __imp__wglDeleteContext@4 referenced in function _init_temp_context
1>allegro-5.0.6-static-mt.lib(wgl_disp.obj) : error LNK2019: unresolved external symbol __imp__wglMakeCurrent@8 referenced in function _init_temp_context
1>allegro-5.0.6-static-mt.lib(wgl_disp.obj) : error LNK2019: unresolved external symbol __imp__wglCreateContext@4 referenced in function _init_temp_context
1>allegro-5.0.6-static-mt.lib(wgl_disp.obj) : error LNK2019: unresolved external symbol __imp__wglGetCurrentDC@0 referenced in function _init_ogl_context_ex
1>allegro-5.0.6-static-mt.lib(wgl_disp.obj) : error LNK2019: unresolved external symbol __imp__wglGetCurrentContext@0 referenced in function _init_ogl_context_ex
1>allegro-5.0.6-static-mt.lib(wgl_disp.obj) : error LNK2019: unresolved external symbol __imp__glFlush@0 referenced in function _wgl_flip_display
1>allegro-5.0.6-static-mt.lib(extensions.obj) : error LNK2019: unresolved external symbol __imp__glGetIntegerv@8 referenced in function __ogl_is_extension_supported
1>allegro-5.0.6-static-mt.lib(ogl_display.obj) : error LNK2001: unresolved external symbol __imp__glGetIntegerv@8
1>allegro-5.0.6-static-mt.lib(ogl_draw.obj) : error LNK2001: unresolved external symbol __imp__glGetIntegerv@8
1>allegro-5.0.6-static-mt.lib(ogl_display.obj) : error LNK2019: unresolved external symbol __imp__glScissor@16 referenced in function __al_ogl_setup_bitmap_clipping
1>allegro-5.0.6-static-mt.lib(ogl_display.obj) : error LNK2019: unresolved external symbol __imp__glEnable@4 referenced in function __al_ogl_setup_bitmap_clipping
1>allegro-5.0.6-static-mt.lib(ogl_draw.obj) : error LNK2001: unresolved external symbol __imp__glEnable@4
1>allegro-5.0.6-static-mt.lib(ogl_bitmap.obj) : error LNK2001: unresolved external symbol __imp__glEnable@4
1>allegro-5.0.6-static-mt.lib(ogl_display.obj) : error LNK2019: unresolved external symbol __imp__glDisable@4 referenced in function __al_ogl_setup_bitmap_clipping
1>allegro-5.0.6-static-mt.lib(ogl_draw.obj) : error LNK2001: unresolved external symbol __imp__glDisable@4
1>allegro-5.0.6-static-mt.lib(ogl_bitmap.obj) : error LNK2001: unresolved external symbol __imp__glDisable@4
1>allegro-5.0.6-static-mt.lib(ogl_draw.obj) : error LNK2019: unresolved external symbol __imp__glBlendFunc@8 referenced in function _set_opengl_blending
1>allegro-5.0.6-static-mt.lib(ogl_bitmap.obj) : error LNK2001: unresolved external symbol __imp__glBlendFunc@8
1>allegro-5.0.6-static-mt.lib(ogl_draw.obj) : error LNK2019: unresolved external symbol __imp__glClear@4 referenced in function _ogl_clear
1>allegro-5.0.6-static-mt.lib(ogl_draw.obj) : error LNK2019: unresolved external symbol __imp__glClearColor@16 referenced in function _ogl_clear
1>allegro-5.0.6-static-mt.lib(ogl_draw.obj) : error LNK2019: unresolved external symbol __imp__glDisableClientState@4 referenced in function _ogl_draw_pixel
1>allegro-5.0.6-static-mt.lib(ogl_draw.obj) : error LNK2019: unresolved external symbol __imp__glDrawArrays@12 referenced in function _ogl_draw_pixel
1>allegro-5.0.6-static-mt.lib(ogl_draw.obj) : error LNK2019: unresolved external symbol __imp__glColorPointer@16 referenced in function _ogl_draw_pixel
1>allegro-5.0.6-static-mt.lib(ogl_draw.obj) : error LNK2019: unresolved external symbol __imp__glVertexPointer@16 referenced in function _ogl_draw_pixel
1>allegro-5.0.6-static-mt.lib(ogl_draw.obj) : error LNK2019: unresolved external symbol __imp__glEnableClientState@4 referenced in function _ogl_draw_pixel
1>allegro-5.0.6-static-mt.lib(ogl_draw.obj) : error LNK2019: unresolved external symbol __imp__glTexCoordPointer@16 referenced in function _ogl_flush_vertex_cache
1>allegro-5.0.6-static-mt.lib(ogl_draw.obj) : error LNK2019: unresolved external symbol __imp__glBindTexture@8 referenced in function _ogl_flush_vertex_cache
1>allegro-5.0.6-static-mt.lib(ogl_bitmap.obj) : error LNK2001: unresolved external symbol __imp__glBindTexture@8
1>allegro-5.0.6-static-mt.lib(ogl_draw.obj) : error LNK2019: unresolved external symbol __imp__glGetBooleanv@8 referenced in function _ogl_flush_vertex_cache
1>allegro-5.0.6-static-mt.lib(ogl_draw.obj) : error LNK2019: unresolved external symbol __imp__glLoadMatrixf@4 referenced in function _ogl_update_transformation
1>allegro-5.0.6-static-mt.lib(ogl_draw.obj) : error LNK2019: unresolved external symbol __imp__glMultMatrixf@4 referenced in function _ogl_update_transformation
1>allegro-5.0.6-static-mt.lib(ogl_draw.obj) : error LNK2019: unresolved external symbol __imp__glTranslatef@12 referenced in function _ogl_update_transformation
1>allegro-5.0.6-static-mt.lib(ogl_bitmap.obj) : error LNK2019: unresolved external symbol __imp__glCopyTexSubImage2D@32 referenced in function _ogl_draw_bitmap_region
1>allegro-5.0.6-static-mt.lib(ogl_bitmap.obj) : error LNK2019: unresolved external symbol __imp__glDeleteTextures@8 referenced in function _ogl_upload_bitmap
1>allegro-5.0.6-static-mt.lib(ogl_bitmap.obj) : error LNK2019: unresolved external symbol __imp__glPopClientAttrib@0 referenced in function _ogl_upload_bitmap
1>allegro-5.0.6-static-mt.lib(ogl_bitmap.obj) : error LNK2019: unresolved external symbol __imp__glPixelStorei@8 referenced in function _ogl_upload_bitmap
1>allegro-5.0.6-static-mt.lib(ogl_bitmap.obj) : error LNK2019: unresolved external symbol __imp__glTexImage2D@36 referenced in function _ogl_upload_bitmap
1>allegro-5.0.6-static-mt.lib(ogl_bitmap.obj) : error LNK2019: unresolved external symbol __imp__glPushClientAttrib@4 referenced in function _ogl_upload_bitmap
1>allegro-5.0.6-static-mt.lib(ogl_bitmap.obj) : error LNK2019: unresolved external symbol __imp__glTexParameteri@12 referenced in function _ogl_upload_bitmap
1>allegro-5.0.6-static-mt.lib(ogl_bitmap.obj) : error LNK2019: unresolved external symbol __imp__glGetError@0 referenced in function _ogl_upload_bitmap
1>allegro-5.0.6-static-mt.lib(ogl_bitmap.obj) : error LNK2019: unresolved external symbol __imp__glGenTextures@8 referenced in function _ogl_upload_bitmap
1>allegro-5.0.6-static-mt.lib(ogl_bitmap.obj) : error LNK2019: unresolved external symbol __imp__glGetTexImage@20 referenced in function _ogl_lock_region
1>allegro-5.0.6-static-mt.lib(ogl_bitmap.obj) : error LNK2019: unresolved external symbol __imp__glReadPixels@28 referenced in function _ogl_lock_region
1>allegro-5.0.6-static-mt.lib(ogl_bitmap.obj) : error LNK2019: unresolved external symbol __imp__glTexSubImage2D@36 referenced in function _ogl_unlock_region
1>allegro-5.0.6-static-mt.lib(ogl_bitmap.obj) : error LNK2019: unresolved external symbol __imp__glPopMatrix@0 referenced in function _ogl_unlock_region
1>allegro-5.0.6-static-mt.lib(ogl_bitmap.obj) : error LNK2019: unresolved external symbol __imp__glDrawPixels@20 referenced in function _ogl_unlock_region
1>allegro-5.0.6-static-mt.lib(ogl_bitmap.obj) : error LNK2019: unresolved external symbol __imp__glRasterPos2f@8 referenced in function _ogl_unlock_region
1>allegro-5.0.6-static-mt.lib(ogl_bitmap.obj) : error LNK2019: unresolved external symbol __imp__glPushMatrix@0 referenced in function _ogl_unlock_region
1>allegro-5.0.6-static-mt.lib(ogl_bitmap.obj) : error LNK2019: unresolved external symbol __imp__glPixelTransferi@8 referenced in function _ogl_unlock_region
1>C:\Users\Owner\Documents\Visual Studio 2010\Projects\allegro-test\Debug\allegro-test.exe : fatal error LNK1120: 52 unresolved externals
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.95
========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========
Any help is appreciated -- also, what does it mean by the warnings near the top -- thanks!
-Michael.
When you static link you have to manually link some libraries. The ones I see are winmm, shlwapi, and opengl. It helps if you google the symbols. For example I couldn't remember which library PathFindOnPath was in so I googled it and MSDN says it's in shlwapi.
Hi,
I finally got it to work by changing all the mt's to md's and changing the mt's to md's in the properties as well. I don't quite understand what's the difference between md and mt, so if someone could explain that that would be nice. Also if someone could explain why when doing mt I got all those multiple symbol warnings/errors.
Thanks,
-Michael.
An explanation is here.