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

Author Topic: I can't compile  (Read 1126 times)

0 Members and 1 Guest are viewing this topic.

Jzx

  • Newbie
  • *
  • Posts: 2
    • View Profile
I can't compile
« on: January 02, 2018, 12:04:20 am »
The program is as follows:
#include <SFML/Graphics.hpp>

int main()
{
 
}
Everything goes OK if I use
Quote
clang++ helloworld.cpp -I/usr/include/ -lsfml-graphics -lsfml-window -lsfml-system
. But when I try to cross-compile it for Windows I get an error:
Quote
clang++ helloworld.cpp -I/usr/include/ -lsfml-graphics -lsfml-window -lsfml-system -target x86_64-win32
helloworld.cpp:1:10: fatal error: 'ostream' file not found
#include <ostream>
         ^
1 error generated.
Any ideas how to fix?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: I can't compile
« Reply #1 on: January 02, 2018, 02:03:58 am »
It's not really related to SFML, e.g. just include ostream yourself and you'll most likely get the same error.

As such you will probably find better answers on something like StackOverflow or similar.

Personally, I find it easier to just boot into a Windows VM and build something natively or if it's open source use Travis/Appveyor to automate builds.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

 

anything