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. Exporting functions with strings

Exporting functions with strings

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++tutorialquestion
2 Posts 2 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.
  • M Offline
    M Offline
    mosquitooth
    wrote on last edited by
    #1

    Hi, I've got a (probably) common problem: I want to create a several unmanged C++ DLLs in VS2005, most of them shall export functions with strings (best CString), like this: void TestFunc1(int a, CString b); void TestFunc2(int a, LPCTSTR b); CString TestFunc3(int a); All these DLLs compile and link well, but when I try to use them in my applications, I always receive a linker error (LNK2019: undefined external symbol). Obviously, this problem is related to the use of strings as arguments (or return values), because if I remove them as arguments, everything works fine... any ideas how to solve this? Greetings, Peter

    G 1 Reply Last reply
    0
    • M mosquitooth

      Hi, I've got a (probably) common problem: I want to create a several unmanged C++ DLLs in VS2005, most of them shall export functions with strings (best CString), like this: void TestFunc1(int a, CString b); void TestFunc2(int a, LPCTSTR b); CString TestFunc3(int a); All these DLLs compile and link well, but when I try to use them in my applications, I always receive a linker error (LNK2019: undefined external symbol). Obviously, this problem is related to the use of strings as arguments (or return values), because if I remove them as arguments, everything works fine... any ideas how to solve this? Greetings, Peter

      G Offline
      G Offline
      Giannakakis Kostas
      wrote on last edited by
      #2

      Have you created an MFC or a regular dll? MFC dlls can only be used from MFC applications. If you want to use the functions from a not-MFC application, replace CString with string.

      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