CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 12 of 12
  1. #1
    Join Date
    Dec 2006
    Posts
    5

    Question about Ezwindow

    Hi there, I'm pretty new to C++ and I'm not sure why my ezwindow code would not work, would be nice if someone point out the problem. I'm currently using Visual Studio 2005 and I read something about setting the path of my include folder in preprocessor under project settings(not in VS2005).

    The code:

    #include <iostream>
    #include <string>
    #include "ezwin.h"
    using namespace std;

    int main() {
    string name;
    cout << "what is ur name? ";
    cin >> name;
    cout << "Die scum!" << name << endl;
    SimpleWindow W;
    W.Open();
    return 0;
    }

    and the error:
    1>------ Build started: Project: test2, Configuration: Debug Win32 ------
    1>Compiling...
    1>test2.cpp
    1>Linking...
    1>test2.obj : error LNK2019: unresolved external symbol "public: __thiscall SimpleWindow::~SimpleWindow(void)" (??1SimpleWindow@@QAE@XZ) referenced in function _main
    1>test2.obj : error LNK2019: unresolved external symbol "public: enum WindowStatus __thiscall SimpleWindow::Open(void)" (?Open@SimpleWindow@@QAE?AW4WindowStatus@@XZ) referenced in function _main
    1>test2.obj : error LNK2019: unresolved external symbol "public: __thiscall SimpleWindow::SimpleWindow(char const *,float,float,class Position const &)" (??0SimpleWindow@@QAE@PBDMMABVPosition@@@Z) referenced in function _main
    1>test2.obj : error LNK2019: unresolved external symbol "public: __thiscall Position::Position(float,float)" (??0Position@@QAE@MM@Z) referenced in function _main
    1>C:\Documents and Settings\Julius\My Documents\Visual Studio 2005\Projects\test2\Debug\test2.exe : fatal error LNK1120: 4 unresolved externals
    1>Build log was saved at "file://c:\Documents and Settings\Julius\My Documents\Visual Studio 2005\Projects\test2\Debug\BuildLog.htm"
    1>test2 - 5 error(s), 0 warning(s)
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped

  2. #2
    Join Date
    Sep 2004
    Location
    New Delhi, India
    Posts
    640

    Re: Question about Ezwindow

    The errors show that you have not linked with the library.

    Right click on the solution->Properties->Linker, in Additional Dependencies enter the name of the library.
    "I rather not play football than wear Nerrazzuri shirt" - Paolo Maldini
    FORZA MILAN!!!

  3. #3
    Join Date
    Aug 1999
    Location
    <Classified>
    Posts
    6,882

    Re: Question about Ezwindow

    Where did you got this SimpleWindow library? Is that the one which comes with one of the C++ book?
    Regards,
    Ramkrishna Pawar

  4. #4
    Join Date
    Aug 1999
    Location
    <Classified>
    Posts
    6,882

    Re: Question about Ezwindow

    Quote Originally Posted by logan
    The errors show that you have not linked with the library.

    Right click on the solution->Properties->Linker, in Additional Dependencies enter the name of the library.
    Or this class could be in form of CPP file, you will need o include it in your project in that case.
    Regards,
    Ramkrishna Pawar

  5. #5
    Join Date
    Dec 2006
    Posts
    5

    Re: Question about Ezwindow

    Ok I've put Ezwinvc50.lib at the "Additional Dependencies" but it generates another error:
    1>------ Build started: Project: test2, Configuration: Debug Win32 ------
    1>Compiling...
    1>test2.cpp
    1>Linking...
    1>Ezwinvc50.lib(ezwin.obj) : error LNK2005: _main already defined in test2.obj
    1>LINK : fatal error LNK1104: cannot open file 'libcpd.lib'
    1>Build log was saved at "file://c:\Documents and Settings\Julius\My Documents\Visual Studio 2005\Projects\test2\Debug\BuildLog.htm"
    1>test2 - 2 error(s), 0 warning(s)
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

    And yes the library is from a C++ book, is there a better source for the lib?

  6. #6
    Join Date
    Aug 1999
    Location
    <Classified>
    Posts
    6,882

    Re: Question about Ezwindow

    Is that lib file supposed to be used as library? Are you sure that the book says you can use EzWindows like this?

    Why there is main function defined inside ezWindows.lib file? This directly means that it is not a library of functions, instead it is a LIB file produced with the program(like exe etc.)
    Regards,
    Ramkrishna Pawar

  7. #7
    Join Date
    Dec 2006
    Posts
    5

    Re: Question about Ezwindow

    Oh ok, I'm not sure what to do now, hint please =D

  8. #8
    Join Date
    Aug 1999
    Location
    <Classified>
    Posts
    6,882

    Re: Question about Ezwindow

    I would first see what the book says on how to use that library.
    Regards,
    Ramkrishna Pawar

  9. #9
    Join Date
    Dec 2006
    Posts
    5

    Re: Question about Ezwindow

    This is kinda silly, the book doesn't seem to say how to use it. Is there another source for ezwindow, or am I screwed?

  10. #10
    Join Date
    Aug 1999
    Location
    <Classified>
    Posts
    6,882

    Re: Question about Ezwindow

    Why do you need ezWindows anyway? I haven't seen/heard anyone using it. Isn't win32 API or MFC enough?
    Regards,
    Ramkrishna Pawar

  11. #11
    Join Date
    Apr 1999
    Posts
    27,449

    Re: Question about Ezwindow

    Quote Originally Posted by NightBladeN
    This is kinda silly, the book doesn't seem to say how to use it. Is there another source for ezwindow, or am I screwed?
    So far, no one knows what this "ezwindows" is or has ever used it. My advice is to learn to program Windows the correct way, i.e. Win32 API, MFC, ATL, or other well-known technologies.

    Then after learning how to program using Windows, then you don't need "ezwindows".

    Regards,

    Paul McKenzie

  12. #12
    Join Date
    Dec 2006
    Posts
    5

    Re: Question about Ezwindow

    Ah ok, I'm pretty new so I didn't know this is not a common thing, I'll try google ways to make windows properly then thanks for the help!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured