Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: CSFML Audio - Yet Another LINK Question  (Read 3987 times)

0 Members and 1 Guest are viewing this topic.

FDO

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
CSFML Audio - Yet Another LINK Question
« on: February 27, 2019, 08:11:39 pm »
CSFML - Yet Another LINK Question

Using Visual Studio Express 2013 for Windows

Hi,

I have a fairly large, legacy C language, simulation app that currently supports sound via a late 90's audio library named SEAL.  I'd like to upgrade it to CSFML Audio.
I've created a project and simple C program (below) to help me understand the features of CSFML.

I installed SFML-2.5.1 and then dropped the CSFML-2.5.1 folders on top of it, merging them together.  I (theoretically) followed Project Setup instructions for PATHs and supporting files (see screenshots below).  When I build the project, compilation is fine but I get a unresolved external symbol LINK error, also shown below.

I've played with this for many hours now and my mistake eludes me.  Does anyone have any thoughts?

Thanks!
Brad

//****** EXAMPLE CSFML PROGRAM******//
#include <SFML/Audio/Sound.h>
#include <SFML/Audio/Music.h>

static void CSFMLSoundTest(void);

int main(int argc, char* argv[])
{
   int      i = 0;

   CSFMLSoundTest();
   return;
}

void CSFMLSoundTest(void)
{
   sfMusic *TestMusic;
   TestMusic = sfMusic_createFromFile("test.wav");
}
 

Output
1>noise1.obj : error LNK2019: unresolved external symbol __imp__sfMusic_createFromFile@4 referenced in function _CSFMLSoundTest@0
1>.\Release/randomprojects1.exe : fatal error LNK1120: 1 unresolved externals
« Last Edit: February 27, 2019, 08:14:44 pm by Laurent »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: CSFML Audio - Yet Another LINK Question
« Reply #1 on: February 27, 2019, 08:17:44 pm »
You should use a version of SFML compiled with Visual Studio 2013, which we don't provide as far as I know. In this case you'll have to compile SFML and CSFML yourself. Or upgrade to a recent Visual Studio.

Quote
I installed SFML-2.5.1 and then dropped the CSFML-2.5.1 folders on top of it, merging them together.
Uuhhhh, best way to mess things up. They are separate self-contained libraries, don't try to mix them.
Laurent Gomila - SFML developer

FDO

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Re: CSFML Audio - Yet Another LINK Question
« Reply #2 on: February 27, 2019, 08:41:48 pm »
Thanks for the quick response!

Yes, I started out that way (standalone CSFML directory tree) and resorted to merging in an attempt to fix the reported problem.  I had read somewhere that is was okay to combine them since the file names were unique.  I just now "separated" CSFML from SFML, copied openal32.lib, etc. to the CSFML lib folder and the problem still exists.

Thanks!
Brad

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: CSFML Audio - Yet Another LINK Question
« Reply #3 on: February 27, 2019, 10:17:26 pm »
Yes, as I said the problem is with your version of Visual Studio, don't focus on my other comment that had nothing to do with your problem ;)
Laurent Gomila - SFML developer

FDO

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Re: CSFML Audio - Yet Another LINK Question
« Reply #4 on: February 27, 2019, 11:13:04 pm »
My bad.  I zeroed in on your response after the "Quote" and totally missed your lead in.  Sorry!

I though SFML 2.5.1 was offered for Visual Studio 2013 (which is VC12).  I was able to take the SFML sound example code in C++ and compile, link and run it successfully.   However, I didn't realize that the CSFML 2.5 download was Visual Studio version sensitive.

Unfortunately, a newer version of Visual Studio is not currently an option for me as the one I have is (my understanding) the last to support DirectX 9.0c.

Thanks,
Brad


Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: CSFML Audio - Yet Another LINK Question
« Reply #5 on: February 28, 2019, 07:49:45 am »
Quote
I though SFML 2.5.1 was offered for Visual Studio 2013 (which is VC12)
Ah, you're right, I should have checked before posting.

Quote
However, I didn't realize that the CSFML 2.5 download was Visual Studio version sensitive.
After thinking more about it, I'm not sure... you should try to recompile it and see if it solves your problem.
Laurent Gomila - SFML developer

FDO

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Re: CSFML Audio - Yet Another LINK Question
« Reply #6 on: February 28, 2019, 01:46:29 pm »
Okay. 

Thanks!
Brad

 

anything