Jump to content
Sign in to follow this  
syko

help with first autoitX in dev C++

Recommended Posts

syko

I am trying to use autoitX in dev C++ I have Autoit3.h and AutoItX3.dll in the directory and here is my code

// Empty project additions:
//      Added "AutoIt3.h" include
//      Added "AutoItX3.lib" to the input linker libraries
//
// AutoItX3.dll needs to be in the run path during execution

#include <Windows.h>
#include <tchar.h>
#include "AutoIt3.h"

int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR   lpCmdLine,
                     int       nCmdShow)
{
    // You can now call AutoIt commands, e.g. to send the keystrokes "hello"
    AU3_Sleep(1000);
    AU3_Run(_T("notepad.exe"), _T(""), 1);
    AU3_WinWaitActive(_T("Untitled -"), _T(""), 0);
    AU3_Send(_T("Hello{!}"), 0);

    // Get the text in the status bar
    //char szText[1000];
    //AU3_StatusbarGetText("Untitled -", "", 2, szText, 1000);
    //MessageBox(NULL, szText, "Text:", MB_OK);

    return 0;
}

now here are errors:

[Linker error] undefined reference to `AU3_Sleep@4' 
  [Linker error] undefined reference to `AU3_Run@12' 
  [Linker error] undefined reference to `AU3_WinWaitActive@12' 
  [Linker error] undefined reference to `AU3_Send@8' 
  ld returned 1 exit status

Share this post


Link to post
Share on other sites
calc0000

Added "AutoItX3.lib" to the input linker libraries

Did you do this?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.