Results 1 to 5 of 5

Thread: use of VC++ code in Qt

  1. #1
    Join Date
    Mar 2006
    Posts
    9
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question use of VC++ code in Qt

    Hi guys,

    Is it possible in anyway to use VC++ code in Qt. I am using VC++ 6 compiler for compiling Qt Application.

    I have include afx.h header file. I hav also write this statement: CString str; Then i compiled code and code gets compiled. But the problems r coming during linking. The problem are:

    Linking...
    uafxcw.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) already defined in MSVCRT.lib(MSVCRT.dll)

    uafxcw.lib(afxmem.obj) : error LNK2005: "void __cdecl operator delete(void *)" (??3@YAXPAX@Z) already defined in msvcprt.lib(delop_s.obj)

    uafxcw.lib(appcore.obj) : error LNK2001: unresolved external symbol ___wargv
    uafxcw.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argc
    release/tds_prg.exe : fatal error LNK1120: 2 unresolved externals
    Error executing link.exe.

    Reply me as soon as possible.

    Thanks in advance.

    Regards,
    Shail
    Last edited by shailesh; 26th April 2006 at 13:01.

  2. #2
    Join Date
    Jan 2006
    Location
    Ukraine,Lviv
    Posts
    454
    Thanks
    9
    Thanked 27 Times in 27 Posts
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Re: use of VC++ code in Qt

    Are you really need that?
    Why you dont want use QString insthead
    a life without programming is like an empty bottle

  3. #3
    Join Date
    Mar 2006
    Posts
    9
    Thanks
    2
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: use of VC++ code in Qt

    I could be wrong, but it seems that uafxcw.lib library is linked with a C/C++ runtime library and your project is using another one. Try to recompile it with the same one that your project uses. This option could be adjusted in Project Options -> C/C++ Code Generation -> Runtime library.

  4. #4
    Join Date
    Mar 2006
    Posts
    9
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: use of VC++ code in Qt

    Ok guys

    Thanks for your reply. I have resolved that error. The solution is just make the use in dll in Shared dll mode and compile again.

    But, still one question : Is it so that any VC++ code can be compiled and linked with Qt project?

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: use of VC++ code in Qt

    Quote Originally Posted by shailesh
    But, still one question : Is it so that any VC++ code can be compiled and linked with Qt project?
    There is no such thing as "VC++ code". These are WinAPI (or MFC) calls. Qt is a library like any other. It uses WinAPI internally, so there is no reason not to use other WinAPI calls if you need them.

Similar Threads

  1. copyright and gpl
    By janus in forum General Discussion
    Replies: 8
    Last Post: 21st October 2008, 01:13
  2. Qt Cryptographic Architecture
    By vermarajeev in forum Qt Programming
    Replies: 6
    Last Post: 9th February 2007, 13:15
  3. Problem closing a QMainWindow in Qt4.2
    By ian in forum Qt Programming
    Replies: 11
    Last Post: 17th October 2006, 00:49
  4. problem with linking
    By mickey in forum Qt Programming
    Replies: 49
    Last Post: 12th August 2006, 21:41

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.