Dll's and problems with them

Reply

Join Date: Oct 2006
Posts: 164
Reputation: Barefootsanders is an unknown quantity at this point 
Solved Threads: 3
Barefootsanders Barefootsanders is offline Offline
Junior Poster

Dll's and problems with them

 
0
  #1
Nov 28th, 2006
Hey guys, I was writing code or DLL's (doubly linked lists) and I think I have everything right but it keeps giving me a makefile error. My code is below along with the error log. ANy help would be apprecaited.

  1. //DLLNode.h
  2.  
  3. #include <iostream>
  4. #include <cstdlib>
  5.  
  6. #ifndef DOUBLY_LINKED_LIST
  7. #define DOUBLY_LINKED_LIST
  8.  
  9. template<class T>
  10. class IntDLLNode
  11. {
  12. public:
  13. IntDLLNode();
  14. IntDLLNode(const T&,IntDLLNode*,IntDLLNode*);
  15.  
  16. protected:
  17. T info;
  18. IntDLLNode *next,*prev;
  19. };
  20.  
  21. #endif

  1. //DLLNode.cpp
  2.  
  3. #include "DLLNode.h"
  4.  
  5. template<class T>
  6. IntDLLNode<T>::IntDLLNode()
  7. {
  8. next = prev = NULL;
  9. }
  10.  
  11. template<class T>
  12. IntDLLNode<T>::IntDLLNode(const T& el,IntDLLNode *n = NULL,IntDLLNode *p = NULL)
  13. {
  14. info = el;
  15. next = n;
  16. prev = p;
  17. }

Error Log:
Compiler: Default compiler
Building Makefile: "C:\Documents and Settings\My Documents\C++\Lab06\Makefile.win"
Executing make...
make.exe -f "C:\Documents and Settings\My Documents\C++\Lab06\Makefile.win" all
g++.exe DLLNode.o -o "Lab06.exe" -L"C:/Dev-Cpp/lib"

C:/Dev-Cpp/lib/libmingw32.a(main.o)(.text+0x106):main.c: undefined reference to `WinMain@16'
collect2: ld returned 1 exit status

make.exe: *** [Lab06.exe] Error 1

Execution terminated
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,160
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1437
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Most Valuable Poster

Re: Dll's and problems with them

 
0
  #2
Nov 28th, 2006
All dlls must have DllMain(). This is the code generated by M$ VC++ compiler when creating a dll project.
  1. BOOL APIENTRY DllMain( HMODULE hModule,
  2. DWORD ul_reason_for_call,
  3. LPVOID lpReserved
  4. )
  5. {
  6. switch (ul_reason_for_call)
  7. {
  8. case DLL_PROCESS_ATTACH:
  9. case DLL_THREAD_ATTACH:
  10. case DLL_THREAD_DETACH:
  11. case DLL_PROCESS_DETACH:
  12. break;
  13. }
  14. return TRUE;
  15. }
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC