Got Linker error(found)

Started by
1 comment, last by kontrolkl 18 years, 8 months ago
I'm having linker error while trying to add sound to my game. I don't know how, i'v read 2-3 tutorial and none talk about something i forgot. Yes i did include SDL_Mixer.h Linking... MSVCRTD.lib(cinitexe.obj) : warning LNK4098: defaultlib 'msvcrt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library Interface.obj : error LNK2019: unresolved external symbol _Mix_LoadWAV_RW referenced in function "public: void __thiscall CInterface::Init_Audio(void)" (?Init_Audio@CInterface@@QAEXXZ) Interface.obj : error LNK2019: unresolved external symbol _Mix_OpenAudio referenced in function "public: void __thiscall CInterface::Init_Audio(void)" (?Init_Audio@CInterface@@QAEXXZ) Interface.obj : error LNK2019: unresolved external symbol _Mix_PlayChannelTimed referenced in function "public: void __thiscall CInterface::Play_Wav(void)" (?Play_Wav@CInterface@@QAEXXZ) main.obj : error LNK2019: unresolved external symbol _Mix_CloseAudio referenced in function _SDL_main Debug/Tetris.exe : fatal error LNK1120: 4 unresolved externals [Edited by - deathwearer on August 19, 2005 1:49:58 PM]
Advertisement
AFAIK for the first LNK4098 error, you have to compile with Multithreaded DLL (Project options -> C++ -> Code generation). As for the rest, you have to link (not only #include <SDL_mixer.h>!) with SDL_Mixer.lib (or sth like that) in Linker tab (also in Project options).

BTW, all your questions are pretty frequent and are answered in standard SDL docs, so please RTFM :-)
Quote:Original post by Koshmaar
AFAIK for the first LNK4098 error, you have to compile with Multithreaded DLL (Project options -> C++ -> Code generation). As for the rest, you have to link (not only #include <SDL_mixer.h>!) with SDL_Mixer.lib (or sth like that) in Linker tab (also in Project options).

BTW, all your questions are pretty frequent and are answered in standard SDL docs, so please RTFM :-)



1. No that was because i didn'T corectly linked the SDL_Mixer.lib and i tought i did, so i was like "what the... everything seems ok"

2. Yes will do in the futur, but that's because I'm not so fammiliar with the docs and all. I never worked with an API before.

This topic is closed to new replies.

Advertisement