Thread: importing from .lib into DLL

  1. #1
    Registered User xds4lx's Avatar
    Join Date
    Nov 2001
    Posts
    630

    importing from .lib into DLL

    Ok this is kinda hard to explain. Im working on a project for shcool that requires me to alter some of my teachers code to some simulation models enable it to run under windos, no problem doing that. The problem is that he created a .lib with the implementations of the base classes in the lib. Now with the derived classes im trying to stuff them into a generic DLL so that I can have the app load any of the models the same way. I got the code to compile with no errors or warnings, but when I go to link it gives me 3 unresolved externs which are in the lib and I have no access to the code for the lib. Oh and his lib uses classes no C style functions.

  2. #2
    i want wookie cookies the Wookie's Avatar
    Join Date
    Oct 2002
    Posts
    455
    you need to add them in the linker options

  3. #3
    Registered User xds4lx's Avatar
    Join Date
    Nov 2001
    Posts
    630
    Originally posted by the Wookie
    you need to add them in the linker options
    Do you think im stupid? How do you think I got it to run in the console? Magically? Some people dont know how to pick info out of readings. Anyways, to state again, just compiling the "model" to run in the console works fine. What I want to do is wrap each model into a DLL so that I can have a basic app that can display the output from the models. They all have the basic format so modifying them is simple. The problem occurs when I put the code into a DLL and link with the lib. For some reason it cant find 3 functions from the lib, but under console app everything works fine.
    Last edited by xds4lx; 11-14-2002 at 11:17 PM.

  4. #4
    Registered User xds4lx's Avatar
    Join Date
    Nov 2001
    Posts
    630
    Just wanted to say thanks anyways and sorry for being beligerant (sp?) before in my last post, but i figured it out, for some reason putting the models includes before Windows.h made everything work fine. Its been a tough day My best friend for the last 12 years was killed by a drunk in a car crash this afternooon. He was just leaving his house for school and not even 2 miles down the road when he was broad sided by a drunk and killed instantly Who in the hell drinks during the day? People who have no respect for the lives of others......

  5. #5
    i want wookie cookies the Wookie's Avatar
    Join Date
    Oct 2002
    Posts
    455
    I'm sorry, I just gave what came off the top of my head.

    Sorry about your friend

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. non-MFC DLL with MFC app question.
    By Kempelen in forum Windows Programming
    Replies: 10
    Last Post: 08-20-2008, 07:11 AM
  2. Importing dll functions
    By fl00d in forum C++ Programming
    Replies: 13
    Last Post: 12-08-2007, 08:53 PM
  3. Replies: 4
    Last Post: 07-06-2006, 02:53 AM
  4. dll communicating between each other
    By cloudy in forum C++ Programming
    Replies: 5
    Last Post: 06-17-2005, 02:20 AM
  5. DLL and std::string woes!
    By Magos in forum C++ Programming
    Replies: 7
    Last Post: 09-08-2004, 12:34 PM