我正在使用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();
}
}
難道目錄' C:\ Users \ brr \ documents \ visual studio 2012 \ Projects \ sfmlgame \ Release'存在且可寫嗎?你可以使用資源管理器或其他文件管理器將任何文件複製到它? – borisbn 2013-03-19 06:00:22
嘗試做清潔和建立,這個錯誤,然後報告呢? – 4pie0 2013-03-19 06:11:23