weixin_39928768
2020-11-27 20:38 阅读 19

Windows build problem: SDL link error

Using visual studio 2019 version 16.3.4, the build solution fails to link SDL (or is it a uclibc problem?):


...
3>------ Rebuild All started: Project: lobster, Configuration: Release Win32 ------
3>main.cpp
3>LIBCMT.lib(ftol2.obj) : error LNK2005: __ftol2_sse already defined in engine.lib(SDL_stdlib.obj)
3>   Creating library ..\..\bin\lobster.lib and object ..\..\bin\lobster.exp
3>engine.lib(SDL_stdlib.obj) : error LNK2001: unresolved external symbol _SDL_uclibc_exp
3>engine.lib(SDL_stdlib.obj) : error LNK2001: unresolved external symbol _SDL_uclibc_fmod
3>engine.lib(SDL_stdlib.obj) : error LNK2001: unresolved external symbol _SDL_uclibc_log10
3>C:\Users\jcorb\lobster\dev\lobster\..\..\bin\lobster.exe : fatal error LNK1120: 3 unresolved externals

Full build output fwiw:


1>------ Rebuild All started: Project: language, Configuration: Release Win32 ------
1>stdafx.cpp
1>idl_gen_text.cpp
1>idl_parser.cpp
1>util.cpp
1>towasm.cpp
1>builtins.cpp
1>disasm.cpp
1>file.cpp
1>compiler.cpp
1>lobsterreader.cpp
1>platform.cpp
1>tocpp.cpp
1>tonative.cpp
1>vm.cpp
1>vmdata.cpp
1>vmlog.cpp
1>language.vcxproj -> C:\Users\jcorb\lobster\dev\lobster\..\..\build\lobster\language\language.lib
2>------ Rebuild All started: Project: engine, Configuration: Release Win32 ------
2>stdafx.cpp
2>autofit.c
2>ftapi.c
2>ftbase.c
2>ftbbox.c
2>ftbitmap.c
2>ftdebug.c
2>ftglyph.c
2>ftinit.c
2>ftstroke.c
2>ftsynth.c
2>ftsystem.c
2>cff.c
2>pshinter.c
2>psnames.c
2>raster.c
2>sfnt.c
2>smooth.c
2>truetype.c
2>imgui.cpp
2>imgui_demo.cpp
2>imgui_draw.cpp
2>imgui_impl_opengl3.cpp
2>imgui_impl_sdl.cpp
2>imgui_widgets.cpp
2>SDL_wasapi_winrt.cpp
2>b2BroadPhase.cpp
2>b2CollideCircle.cpp
2>b2CollideEdge.cpp
2>b2CollidePolygon.cpp
2>b2Collision.cpp
2>b2Distance.cpp
2>b2DynamicTree.cpp
2>b2TimeOfImpact.cpp
2>b2ChainShape.cpp
2>b2CircleShape.cpp
2>b2EdgeShape.cpp
2>b2PolygonShape.cpp
2>b2BlockAllocator.cpp
2>b2Draw.cpp
2>b2FreeList.cpp
2>b2Math.cpp
2>b2Settings.cpp
2>b2StackAllocator.cpp
2>b2Stat.cpp
2>b2Timer.cpp
2>b2TrackedBlock.cpp
2>b2Body.cpp
2>b2ContactManager.cpp
2>b2Fixture.cpp
2>b2Island.cpp
2>b2World.cpp
2>b2WorldCallbacks.cpp
2>b2ChainAndCircleContact.cpp
2>b2ChainAndPolygonContact.cpp
2>b2CircleContact.cpp
2>b2Contact.cpp
2>b2ContactSolver.cpp
2>b2EdgeAndCircleContact.cpp
2>b2EdgeAndPolygonContact.cpp
2>b2PolygonAndCircleContact.cpp
2>b2PolygonContact.cpp
2>b2DistanceJoint.cpp
2>b2FrictionJoint.cpp
2>b2GearJoint.cpp
2>b2Joint.cpp
2>b2MotorJoint.cpp
2>b2MouseJoint.cpp
2>b2PrismaticJoint.cpp
2>b2PulleyJoint.cpp
2>b2RevoluteJoint.cpp
2>b2RopeJoint.cpp
2>b2WeldJoint.cpp
2>b2WheelJoint.cpp
2>b2Particle.cpp
2>b2ParticleAssembly.cpp
2>b2ParticleGroup.cpp
2>b2ParticleSystem.cpp
2>b2VoronoiDiagram.cpp
2>b2Rope.cpp
2>StackWalker.cpp
2>StackWalkerHelpers.cpp
2>dynamic_flac.c
2>dynamic_fluidsynth.c
2>dynamic_mod.c
2>dynamic_modplug.c
2>dynamic_mp3.c
2>dynamic_ogg.c
2>effects_internal.c
2>effect_position.c
2>effect_stereoreverse.c
2>fluidsynth.c
2>load_aiff.c
2>load_flac.c
2>load_mp3.c
2>load_ogg.c
2>load_voc.c
2>mixer.c
2>music.c
2>music_cmd.c
2>music_flac.c
2>music_mad.c
2>music_mod.c
2>music_modplug.c
2>music_ogg.c
2>wavestream.c
2>SDL_wasapi.c
2>SDL_windows_main.c
2>SDL_dataqueue.c
2>SDL_vulkan_utils.c
2>SDL_windowsvulkan.c
2>e_atan2.c
2>e_log.c
2>e_pow.c
2>e_rem_pio2.c
2>e_sqrt.c
2>k_cos.c
2>k_rem_pio2.c
2>k_sin.c
2>k_tan.c
2>s_atan.c
2>s_copysign.c
2>s_cos.c
2>s_fabs.c
2>s_floor.c
2>s_scalbn.c
2>s_sin.c
2>s_tan.c
2>SDL.c
2>SDL_assert.c
2>SDL_atomic.c
2>SDL_audio.c
2>SDL_audiocvt.c
2>SDL_audiodev.c
2>SDL_audiotypecvt.c
2>SDL_blendfillrect.c
2>SDL_blendline.c
2>SDL_blendpoint.c
2>SDL_blit.c
2>SDL_blit_0.c
2>SDL_blit_1.c
2>SDL_blit_A.c
2>SDL_blit_auto.c
2>SDL_blit_copy.c
2>SDL_blit_N.c
2>SDL_blit_slow.c
2>SDL_bmp.c
2>SDL_clipboard.c
2>SDL_clipboardevents.c
2>SDL_cpuinfo.c
2>SDL_d3dmath.c
2>SDL_dinputhaptic.c
2>SDL_dinputjoystick.c
2>SDL_directsound.c
2>SDL_diskaudio.c
2>SDL_drawline.c
2>SDL_drawpoint.c
2>SDL_dropevents.c
2>SDL_dummyaudio.c
2>SDL_dynapi.c
2>SDL_egl.c
2>SDL_error.c
2>SDL_events.c
2>SDL_fillrect.c
2>SDL_gamecontroller.c
2>SDL_gesture.c
2>SDL_getenv.c
2>SDL_haptic.c
2>SDL_hints.c
2>SDL_iconv.c
2>SDL_joystick.c
2>SDL_keyboard.c
2>SDL_log.c
2>SDL_malloc.c
2>SDL_mixer.c
2>SDL_mmjoystick.c
2>SDL_mouse.c
2>SDL_nullevents.c
2>SDL_nullframebuffer.c
2>SDL_nullvideo.c
2>SDL_pixels.c
2>SDL_power.c
2>SDL_qsort.c
2>SDL_quit.c
2>SDL_rect.c
2>SDL_render.c
2>SDL_render_d3d.c
2>SDL_render_d3d11.c
2>SDL_render_gl.c
2>SDL_render_gles2.c
2>SDL_render_sw.c
2>SDL_RLEaccel.c
2>SDL_rotate.c
2>SDL_rwops.c
2>SDL_shaders_gl.c
2>SDL_shaders_gles2.c
2>SDL_shape.c
2>SDL_spinlock.c
2>SDL_stretch.c
2>SDL_string.c
2>SDL_surface.c
2>SDL_syscond.c
2>SDL_sysfilesystem.c
2>SDL_sysloadso.c
2>SDL_sysmutex.c
2>SDL_syspower.c
2>SDL_syssem.c
2>SDL_systhread.c
2>SDL_systimer.c
2>SDL_systls.c
2>SDL_thread.c
2>SDL_timer.c
2>SDL_touch.c
2>SDL_video.c
2>SDL_wave.c
2>SDL_windowevents.c
2>SDL_windows.c
2>SDL_windowsclipboard.c
2>SDL_windowsevents.c
2>SDL_windowsframebuffer.c
2>SDL_windowshaptic.c
2>SDL_windowsjoystick.c
2>SDL_windowskeyboard.c
2>SDL_windowsmessagebox.c
2>SDL_windowsmodes.c
2>SDL_windowsmouse.c
2>SDL_windowsopengl.c
2>SDL_windowsopengles.c
2>SDL_windowsshape.c
2>SDL_windowsvideo.c
2>SDL_windowswindow.c
2>SDL_winmm.c
2>SDL_xaudio2.c
2>SDL_xinput.c
2>SDL_xinputhaptic.c
2>SDL_xinputjoystick.c
2>SDL_yuv_mmx.c
2>SDL_yuv_sw.c
2>SDL_wasapi_win32.c
2>hid.c
2>SDL_hidapijoystick.c
2>SDL_hidapi_ps4.c
2>SDL_hidapi_switch.c
2>SDL_dummysensor.c
2>SDL_sensor.c
2>SDL_yuv.c
2>yuv_rgb.c
2>audio.cpp
2>cubegen.cpp
2>engine.cpp
2>font.cpp
2>fontrenderer.cpp
2>glgeom.cpp
2>glloadiqm.cpp
2>glshader.cpp
2>gltexture.cpp
2>glvr.cpp
2>graphics.cpp
2>meshgen.cpp
2>glsystem.cpp
2>octree.cpp
2>physics.cpp
2>sdlsystem.cpp
2>simplex.cpp
2>steamworks.cpp
2>imbind.cpp
2>sdlaudiosfxr.cpp
2>C:\Users\jcorb\lobster\dev\src\imbind.cpp(317,36): warning C4459: declaration of 'boolean' hides global declaration
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\include\concepts(213,9): message : see declaration of 'std::boolean' (compiling source file ..\src\imbind.cpp)
2>SDL_stdlib.c
2>lobster.vcxproj -> C:\Users\jcorb\lobster\dev\lobster\..\..\build\lobster\engine\engine.lib
2>Done building project "lobster.vcxproj".
3>------ Rebuild All started: Project: lobster, Configuration: Release Win32 ------
3>main.cpp
3>LIBCMT.lib(ftol2.obj) : error LNK2005: __ftol2_sse already defined in engine.lib(SDL_stdlib.obj)
3>   Creating library ..\..\bin\lobster.lib and object ..\..\bin\lobster.exp
3>engine.lib(SDL_stdlib.obj) : error LNK2001: unresolved external symbol _SDL_uclibc_exp
3>engine.lib(SDL_stdlib.obj) : error LNK2001: unresolved external symbol _SDL_uclibc_fmod
3>engine.lib(SDL_stdlib.obj) : error LNK2001: unresolved external symbol _SDL_uclibc_log10
3>C:\Users\jcorb\lobster\dev\lobster\..\..\bin\lobster.exe : fatal error LNK1120: 3 unresolved externals
3>Done building project "main.vcxproj" -- FAILED.
========== Rebuild All: 2 succeeded, 1 failed, 0 skipped ==========

该提问来源于开源项目:aardappel/lobster

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

5条回答 默认 最新

  • weixin_39974409 weixin_39974409 2020-11-27 20:38

    Weird, since all files are included, it should in theory build exactly the same on all systems. Did you change anything?

    I'll update to the same version of VS to see if its a recent problem.

    点赞 评论 复制链接分享
  • weixin_39974409 weixin_39974409 2020-11-27 20:38

    Updated, rebuild Release x64 - no problems. Are you building Release x64?

    点赞 评论 复制链接分享
  • weixin_39974409 weixin_39974409 2020-11-27 20:38

    Ok, I get the issue in Win32 as well. Build with x64 (dropdown at the top), its faster.

    I should really remove Win32 as there's no use for it, other than testing.

    I'll have a look tomorrow what the problem is.

    点赞 评论 复制链接分享
  • weixin_39928768 weixin_39928768 2020-11-27 20:38

    d'oh, bamboozled by 32-bit yet again, successfully built for x64!

    点赞 评论 复制链接分享
  • weixin_39974409 weixin_39974409 2020-11-27 20:38

    Just removed Win32 from the VS projects :)

    点赞 评论 复制链接分享

相关推荐