Results 1 to 3 of 3

Thread: Why does Qt not work with dll compiled with multi-bytes?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2013
    Posts
    11
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    2

    Question Why does Qt not work with dll compiled with multi-bytes?

    I am currently working on a program that using dll produced by multi-bytes.

    I designed a GUI and have put my dll into the GUI.

    After I have done this, I tried out my program, The dll and the GUI code can work perfectly well seperately, but when they combined the program does not work .

    I have done a test, and figured out that it was the unicode/multibyte problem.

    I am kinda stuck at this problem for hours now... hope you guys can help me!

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Wiki edits
    17

    Default Re: Why does Qt not work with dll compiled with multi-bytes?

    What exactly do you mean by "multi-byte"?
    What exactly does, "does not work" mean? Does not compile, does not run at all, or does odd things?
    Can you post the compilation errors? Can you post a short example code that demonstrates the problem?

  3. #3
    Join Date
    Nov 2013
    Posts
    11
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    2

    Default Re: Why does Qt not work with dll compiled with multi-bytes?

    Ok, let me show you what happened. I'll demonstrate in two parts.
    First part: I have created two projects in VS2010. The first one is for test. The other one is for GUI.The test is a simple console program. When i set (Property->Configuration Properties->General->project Defaults->character set) to (use multi-byte character set), it works well. But when i change it to (use unicode character set), compiler said "error LNK2019: unresolved external symbol".So i think it must be about the character set. So i came to the GUI. I changed the character set just as i did in the test program. But it turned out that it did't work out with GUI program. So i am confused.

    Second part: I will give you some code pieces in my project.
    test program:
    Qt Code:
    1. #include "stdafx.h"
    2. #include "head.h"
    3.  
    4.  
    5. #pragma comment(lib,"test.lib")
    6. BOOL __declspec(dllimport) TEST(LPCTSTR in_filename,LPCTSTR in_file_name2,LPCTSTR out_file_name,LPCTSTR out_file_name2);
    7.  
    8.  
    9. int _tmain(int argc, _TCHAR* argv[])
    10. {
    11. LPCTSTR a = LPCTSTR("in.dat");
    12. LPCTSTR b = LPCTSTR("in2.dat");
    13. LPCTSTR c = LPCTSTR("out.dat");
    14. LPCTSTR d = LPCTSTR("out2.dat");
    15.  
    16. BOOL bSuccess =TEST(a,b,c,d);
    17. return 0;
    18. }
    To copy to clipboard, switch view to plain text mode 
    GUI program:
    I use the same method as in the console one, while the character set change doesn't matter.
    Last edited by anda_skoa; 20th July 2014 at 08:58. Reason: missing [code] tags

Similar Threads

  1. Replies: 4
    Last Post: 23rd October 2012, 08:40
  2. Emulating Qt compiled code for MIPS in VirtualFrameBuffer(Qvfb in X11-X86 compiled)
    By sunil-vasudevan in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 22nd October 2012, 06:07
  3. Replies: 3
    Last Post: 9th October 2012, 13:58
  4. Code compiled on Qt 4.6.3 does not work on Qt 4.7.0
    By frikkasoft in forum Qt Programming
    Replies: 3
    Last Post: 14th December 2011, 08:29
  5. make QTableView work as a multi-column list view
    By wesley in forum Qt Programming
    Replies: 1
    Last Post: 11th March 2008, 14:43

Tags for this Thread

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
  •  
Qt is a trademark of The Qt Company.