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

Author Topic: odd error  (Read 3259 times)

0 Members and 1 Guest are viewing this topic.

alucard33592

  • Newbie
  • *
  • Posts: 7
    • View Profile
    • Email
odd error
« on: February 01, 2012, 07:07:25 pm »
have no idea what this error means, I probably did something wrong while setting up sfml spent about 30 minutes searching for the answer, basically I want the program to open a window click on an area then click on a second area. Right now I cant even get it to open up the window.........

 
Code: [Select]
#include<iostream>
#include<windows.h>
#include<SFML/Window.hpp>
#include<SFML/Graphics.hpp>

using namespace std;


int main ()
{

        sf::Window App (sf::VideoMode(800, 600 , 32), "SFML window");

           cout << "Hi, now the mouse is on X = 450 and Y = 780 :)";

           SetCursorPos(450, 780);

           mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, 0, 0, 0, 0); // Left click


           mouse_event(MOUSEEVENTF_RIGHTDOWN | MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0); // Right click
           return 0;
}


Compiling: main.cpp
Linking console executable: bin\Debug\test.exe
obj\Debug\main.o: In function `main':
C:/Users/Tim.Tim-PC/Desktop/testing stuff/test/main.cpp:12: undefined reference to `_imp___ZN2sf9VideoModeC1Ejjj'
C:/Users/Tim.Tim-PC/Desktop/testing stuff/test/main.cpp:12: undefined reference to `_imp___ZN2sf12RenderWindowC1ENS_9VideoModeERKSsmRKNS_14WindowSettingsE'
C:/Users/Tim.Tim-PC/Desktop/testing stuff/test/main.cpp:12: undefined reference to `_imp___ZN2sf12RenderWindowD1Ev'
C:/Users/Tim.Tim-PC/Desktop/testing stuff/test/main.cpp:22: undefined reference to `_imp___ZN2sf12RenderWindowD1Ev'
C:/Users/Tim.Tim-PC/Desktop/testing stuff/test/main.cpp:22: undefined reference to `_imp___ZN2sf12RenderWindowD1Ev'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 1 seconds)
5 errors, 0 warnings

victorlevasseur

  • Full Member
  • ***
  • Posts: 206
    • View Profile
odd error
« Reply #1 on: February 01, 2012, 07:32:10 pm »
Hello,

You have probably made an incorrect linking with SFML libraries. Can you show your link settings ?

alucard33592

  • Newbie
  • *
  • Posts: 7
    • View Profile
    • Email
odd error
« Reply #2 on: February 01, 2012, 07:39:37 pm »
yeah O.o thanks for the heads up I did a bit looking around that general area and found what I did wrong but a new problem showed up it compiled just fine with now errors but the window just showed up and did nothing I could re-size it and minimize it though when I tried to close it it froze for a moment before going away


not the window created by sfml but the standard cmd ish window that usuailly pops up

Breakman79

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
odd error
« Reply #3 on: February 01, 2012, 08:11:17 pm »
Two things stick out to me looking at your example.  

1) Your program doesn't really do much; there isn't a loop it keep it running.  It's just going to exit right after it starts.

2) I don't think you can use those WinAPI functions, SetCursorPos and mouse_event, like that inside a SFML window.  SFML has a built-in mouse class for that purpose.

alucard33592

  • Newbie
  • *
  • Posts: 7
    • View Profile
    • Email
odd error
« Reply #4 on: February 01, 2012, 08:44:30 pm »
Ah I used them before without sfml and it worked fine now I'm trying to set up a user interface for a program I made that would automate clicks on the screen I know that code sample doesnt do much and yeah....no loop yet to keep it running I was gonna add that later after I got the errors worked out of what it actuailly did I also found out that sfml has some trouble with the graphics card that I'm using so I found a tutorial on youtube to build 2.0 with cmake .....anyway after I get sfml in a workable position on my computer I'll post the full source code in my thread =D

alucard33592

  • Newbie
  • *
  • Posts: 7
    • View Profile
    • Email
odd error
« Reply #5 on: February 03, 2012, 12:33:23 am »
:shock: