Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Steps in including lib file and dll built in unicode

Steps in including lib file and dll built in unicode

Scheduled Pinned Locked Moved C / C++ / MFC
c++debuggingtutorialquestionannouncement
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    waxie
    wrote on last edited by
    #1

    Hi, This is my situation: I have created a project (MFC) which depends on a dll with a lib file (non-unicode). Everything compiles fine (for both debug and release). But I have to build my project again in UNICODE. I have corrected everything for unicode build (as to my source code). I have now a dll and lib file built in unicode. How to I add that dll and lib file to my project? I keep getting unresolved external symbol errors for Debug Unicode and Release Unicode(I think the compiler is looking for a specific function from the dll built in unicode. I would really appreciate it if you could tell me the steps in adding my unicode lib file to the project(not just the simple right click on project and add file, that still doesn't work).:sigh::(( Thanks, Waxie -- modified at 23:57 Thursday 19th January, 2006

    O A 2 Replies Last reply
    0
    • W waxie

      Hi, This is my situation: I have created a project (MFC) which depends on a dll with a lib file (non-unicode). Everything compiles fine (for both debug and release). But I have to build my project again in UNICODE. I have corrected everything for unicode build (as to my source code). I have now a dll and lib file built in unicode. How to I add that dll and lib file to my project? I keep getting unresolved external symbol errors for Debug Unicode and Release Unicode(I think the compiler is looking for a specific function from the dll built in unicode. I would really appreciate it if you could tell me the steps in adding my unicode lib file to the project(not just the simple right click on project and add file, that still doesn't work).:sigh::(( Thanks, Waxie -- modified at 23:57 Thursday 19th January, 2006

      O Offline
      O Offline
      Owner drawn
      wrote on last edited by
      #2

      Check like this...

      #ifdef _UNICODE

      #pragma comment(lib, "your_unicode_lib.lib")

      #else

      #pragma comment(lib, "your_other_lib.lib")

      #endif

      This will link to the appropriate library.

      Jesus Loves:rose:

      --Owner Drawn:rose: --Nothing special --Defeat is temporary but surrender is permanent --Never say quits --Jesus is Lord:rose:

      W 1 Reply Last reply
      0
      • O Owner drawn

        Check like this...

        #ifdef _UNICODE

        #pragma comment(lib, "your_unicode_lib.lib")

        #else

        #pragma comment(lib, "your_other_lib.lib")

        #endif

        This will link to the appropriate library.

        Jesus Loves:rose:

        --Owner Drawn:rose: --Nothing special --Defeat is temporary but surrender is permanent --Never say quits --Jesus is Lord:rose:

        W Offline
        W Offline
        waxie
        wrote on last edited by
        #3

        Thanks for the reply.:-O Where will be I placing this snippet of code? In what file? waxie

        O 1 Reply Last reply
        0
        • W waxie

          Thanks for the reply.:-O Where will be I placing this snippet of code? In what file? waxie

          O Offline
          O Offline
          Owner drawn
          wrote on last edited by
          #4

          stdafx.h This is where I do it. This is where you should do it too. But it depends on your application and your needs.

          Jesus Loves:rose:

          --Owner Drawn:rose: --Nothing special --Defeat is temporary but surrender is permanent --Never say quits --Jesus is Lord:rose:

          1 Reply Last reply
          0
          • W waxie

            Hi, This is my situation: I have created a project (MFC) which depends on a dll with a lib file (non-unicode). Everything compiles fine (for both debug and release). But I have to build my project again in UNICODE. I have corrected everything for unicode build (as to my source code). I have now a dll and lib file built in unicode. How to I add that dll and lib file to my project? I keep getting unresolved external symbol errors for Debug Unicode and Release Unicode(I think the compiler is looking for a specific function from the dll built in unicode. I would really appreciate it if you could tell me the steps in adding my unicode lib file to the project(not just the simple right click on project and add file, that still doesn't work).:sigh::(( Thanks, Waxie -- modified at 23:57 Thursday 19th January, 2006

            A Offline
            A Offline
            Aamir Butt
            wrote on last edited by
            #5

            Another way to do this is to create a separate configuration for unicode debug. In that configuration link your unicode libs and that will work. Similar can be done for Unicode Release. Regards,

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups