2013-03-19 42 views
0

我正在使用sfml 2.0。我知道我可以問那裏的論壇,但我不認爲它有什麼關係鏈接一個庫錯誤,因爲我編譯了一個示例項目罰款,它幾乎是完全相同的薄我只是試圖合併一個外部類。我得到這個,當我嘗試編譯無法打開文件.exe 1104

1> LINK:致命錯誤LNK1104:無法打開文件 'C:\用戶\ BRR \文件\的Visual Studio 2012 \項目\ sfmlgame \發佈\ sfmlgame.exe'

我的代碼如下:

main.cpp中:

#include "functions.h" 
int main() 
{ 
    functions func; 
    std::cout << "Testing 123, testing 123!"; 
    sf::CircleShape shape(100.f); 
    shape.setFillColor(sf::Color::Green); 
    bool running = true; 
    while (running) 
    { 
     func.window.clear(); 
     func.window.draw(shape); 
     func.window.display(); 
    } 
    return 0; 
} 

functions.h:

#pragma once 
#include <SFML/Graphics.hpp> 
#include <SFML/System.hpp> 
#include<SFML\Network.hpp> 
#include <SFML/Window.hpp> 
#include <iostream> 

class functions 
{ 
public: 
    functions(void); 
    ~functions(void); 
    void Events(); 
    void Window(); 
    sf::RenderWindow window; 
    sf::Event event; 
}; 

functions.cpp:

#include "functions.h" 
functions::functions(void) 
{ 
} 

functions::~functions(void) 
{ 
} 

void functions::Window(){ 
    window.setSize(sf::Vector2u(800,600)); 
    window.setTitle("Test"); 
} 

void functions::Events(){ 
    while (window.pollEvent(event)) 
    { 
     if (event.type == sf::Event::Closed) 
      window.close(); 
    } 
} 
+0

難道目錄' C:\ Users \ brr \ documents \ visual studio 2012 \ Projects \ sfmlgame \ Release'存在且可寫嗎?你可以使用資源管理器或其他文件管理器將任何文件複製到它? – borisbn 2013-03-19 06:00:22

+0

嘗試做清潔和建立,這個錯誤,然後報告呢? – 4pie0 2013-03-19 06:11:23

回答

1

一個當它們具有程序(sfmlgame.exe)通常會得到這個錯誤已經開啓/運行,因此視覺工作室不能用新編譯的更換。如果您已經在運行程序,請關閉該程序,然後重試。

6

有兩種可能性。

1.您沒有訪問C:\Users\brr\documents\visual studio 2012\Projects\sfmlgame\Release目錄。您可以通過嘗試在此位置創建新文件進行檢查。

2.該過程已在使用中。運行任務管理器(start->run->taskmgr),並檢查sfmlgame.exe是否正在運行。 如果是,則終止進程

1
  1. 去任務管理器
  2. 到進程選項卡查找所需的exe文件
  3. 點擊結束時再次進程
  4. 建設項目