eezstreet / OpenD2

A project to open source Diablo 2.
GNU General Public License v3.0
573 stars 77 forks source link

Library issues in Linux (possibly Windows) #26

Open ghost opened 5 years ago

ghost commented 5 years ago

[ 83%] Linking CXX executable game /usr/bin/ld: CMakeFiles/game.dir/Game/Renderer_SDL.cpp.o: undefined reference to symbol 'SDL_CreateTexture' /usr/bin/ld: /usr/lib/libSDL2-2.0.so.0: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status make[2]: [CMakeFiles/game.dir/build.make:489: game] Error 1 make[1]: [CMakeFiles/Makefile2:110: CMakeFiles/game.dir/all] Error 2 make: *** [Makefile:84: all] Error 2

This isn't the first time I've had this problem with other code bases, but, I've never seen a method to correct for this.

eezstreet commented 5 years ago

Hi, make sure your system has SDL installed on it.


From: Inotamira notifications@github.com Sent: Thursday, June 20, 2019 11:32 AM To: eezstreet/OpenD2 Cc: Subscribed Subject: [eezstreet/OpenD2] Library issues in Linux (possibly Windows) (#26)

[ 83%] Linking CXX executable game /usr/bin/ld: CMakeFiles/game.dir/Game/Renderer_SDL.cpp.o: undefined reference to symbol 'SDL_CreateTexture' /usr/bin/ld: /usr/lib/libSDL2-2.0.so.0: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status make[2]: [CMakeFiles/game.dir/build.make:489: game] Error 1 make[1]: [CMakeFiles/Makefile2:110: CMakeFiles/game.dir/all] Error 2 make: *** [Makefile:84: all] Error 2

This isn't the first time I've had this problem with other code bases, but, I've never seen a method to correct for this.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/eezstreet/OpenD2/issues/26?email_source=notifications&email_token=AAN6MRO22HQ4L7NWDG4B6ODP3OPH7A5CNFSM4HZVEAFKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G2XUGDA, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AAN6MRI7YAT7UXOBSDWDSCDP3OPH7ANCNFSM4HZVEAFA.

fengwang commented 5 years ago

I solved it by updating this line: https://github.com/eezstreet/OpenD2/blob/master/CMakeLists.txt#L68 to

    target_link_libraries(game ${SDL2_LIBRARIES} SDL2 SDL2_net SDL2_mixer m dl)
gfriloux commented 5 years ago

Ran into the same issue, fixed doing the same.