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

Author Topic: LNK1104 can't open "sfml-audio-s-d.lib  (Read 900 times)

0 Members and 1 Guest are viewing this topic.

MrTi1603

  • Newbie
  • *
  • Posts: 1
    • View Profile
    • Email
LNK1104 can't open "sfml-audio-s-d.lib
« on: June 06, 2018, 06:30:12 pm »
I did one project with sfml a lot of time ago and today i tried to do another simple project but after all i recive that message. I have followed the guide of sfml but it doesen't go. How can i do?
My code: (the comment are in italian and sorry for my bad English)
/*
Autore: Tiberio Filippo
Programma: Tank, un piccolo programma di combattimento

Versione attuale: 1.0

*/


//Inclusione librerie standard
#include "stdafx.h"
#include <iostream>
//Inclusione librerie grafiche
#include <SFML/Graphics.hpp>
#include <SFML/OpenGL.hpp>
#include <SFML/Audio.hpp>

//Definizioni
using namespace sf;             //Utilizzo Namespace della libreria SFML
#define PosizioneIniziale 40;
#define DifferenzaCannoneX 40;
#define DifferenzaCannoneY 28;
#define DimensioneDefaultBaseTank1X 188
#define DimensioneDefaultBaseTank1Y 182
#define DimensioneDefaultCannoneTank1X 134
#define DimensioneDefaultCannoneTank1Y 68
#define ScalaTank1 0.5


//Contatori
int ControlloAperturaTexture;
int Posizione1X;
int Posizione1Y;
int AngoloBaseTank1;
int AngoloCannoneTank1;

//Variabili
Texture sfondo1;        //Texture dello sfondo
Texture b1;
Texture c1;

Sprite background;
Sprite BaseTank1;
Sprite CannoneTank1;

//Funzioni
void CaricaTexturesAndSprites();

int main() //Inizio Main
{
        RenderWindow finestra(VideoMode(1920, 1080), "Wars!");          //Creo la finestra e abilito VSync
        finestra.setVerticalSyncEnabled(true);

        CaricaTexturesAndSprites();
        if (ControlloAperturaTexture != 0)
        {
                return ControlloAperturaTexture;
        }
        Posizione1X = PosizioneIniziale;
        Posizione1Y = PosizioneIniziale;
        AngoloBaseTank1 = 0;
        AngoloCannoneTank1 = 0;

        //Creo ed importo l'oggetto per la colonna sonora, controllo l'apertura ed eseguo il file
        Music sottofondo;
        //if (!sottofondo.openFromFile("sounds/Music.ogg"))
        //{
        //std::cout << "Impossibile aprire'Music.ogg' \n";
        //return -7;
        //}            
        //sottofondo.play();    // ----------> Esecuzione

        // MAIN LOOP!!!!
        while (finestra.isOpen())       // ciclo infinito
        {
                Event event;            // creo un evento per controllare lo stato della finestra
                while (finestra.pollEvent(event))       //controllo eventi in sospeso
                {
                        if (event.type == Event::Closed)//Se chiudo la finestra chiude il programma
                        {
                                finestra.close();
                        }
                        else if (event.type == Event::KeyPressed)
                        {
                                if (event.key.code == Keyboard::A)
                                {                              
                                        if (AngoloBaseTank1 == 0)
                                        {
                                                BaseTank1.setRotation(180);
                                                CannoneTank1.setRotation(180);
                                                AngoloBaseTank1 = 180;
                                                AngoloCannoneTank1 = 180;
                                                Posizione1X += DimensioneDefaultBaseTank1X * ScalaTank1;
                                                Posizione1Y += DimensioneDefaultBaseTank1Y * ScalaTank1 ;
                                                BaseTank1.move(Vector2f((DimensioneDefaultBaseTank1X * ScalaTank1), (DimensioneDefaultBaseTank1Y * ScalaTank1)));
                                                CannoneTank1.move(Vector2f(15, (DimensioneDefaultCannoneTank1Y*ScalaTank1)));
                                        }
                                        if (Posizione1X >= 10)
                                        {
                                                Posizione1X -= 6;
                                                BaseTank1.move(Vector2f(-6, 0));
                                                CannoneTank1.move(Vector2f(-6, 0));
                                        }                                      
                                }
                                else if (event.key.code == Keyboard::D)
                                {
                                        if (Posizione1X <= 1800)
                                        {
                                                Posizione1X += 6;
                                                BaseTank1.move(Vector2f(6, 0));
                                                CannoneTank1.move(Vector2f(6, 0));
                                        }
                                }
                                else if (event.key.code == Keyboard::W)
                                {
                                        if (Posizione1Y >= 10)
                                        {
                                                Posizione1Y -= 6;
                                                BaseTank1.move(Vector2f(0, -6));
                                                CannoneTank1.move(Vector2f(0, -6));
                                        }
                                }
                                else if (event.key.code == Keyboard::S)
                                {
                                        if (Posizione1Y <= 1000)
                                        {
                                                Posizione1Y += 6;
                                                BaseTank1.move(Vector2f(0, 6));
                                                CannoneTank1.move(Vector2f(0, 6));
                                        }
                                }
                        }
                }

                finestra.clear(Color::Black);   //Pulisco e applico lo sfondo
                finestra.draw(background);

                finestra.draw(BaseTank1);
                finestra.draw(CannoneTank1);

                finestra.display();
        }
        return 0;
}

void CaricaTexturesAndSprites()
{
        if (!sfondo1.loadFromFile("images/Sfondo/Sfondo.jpg"))          //controllo dell'importazione
        {
                std::cout << "Impossibile aprire 'Sfondo.jpg' \n";
                ControlloAperturaTexture++;
        }

        if (!b1.loadFromFile("images/Tank1/Tank.png"))
        {
                std::cout << "Impossibile aprire 'Tank.png' \n";
                ControlloAperturaTexture++;
        }

        if (!c1.loadFromFile("images/Tank1/GunTurret.png"))
        {
                std::cout << "Impossibile aprire 'Gun Turret.png' \n";
                ControlloAperturaTexture++;
        }


        background.setTexture(sfondo1);
        background.scale(sf::Vector2f(2.f, 2.f));

        BaseTank1.setTexture(b1);
        BaseTank1.scale(sf::Vector2f(0.5f, 0.5f));     
        BaseTank1.setPosition(sf::Vector2f(40, 40));

        CannoneTank1.setTexture(c1);
        CannoneTank1.scale(sf::Vector2f(0.5f, 0.5f));
        CannoneTank1.setPosition(sf::Vector2f(40+40, 40+28));

        return;
}
 
« Last Edit: June 06, 2018, 06:39:42 pm by MrTi1603 »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10863
    • View Profile
    • development blog
    • Email
Re: LNK1104 can't open &quot;sfml-audio-s-d.lib
« Reply #1 on: June 06, 2018, 06:35:34 pm »
You didn't seem to have set the additional library directories correctly.

What's the full verbose build command? https://www.sfml-dev.org/faq.php#tr-grl-verbose-ide
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

 

anything