__cdecl

Started by
2 comments, last by flucknugget 22 years, 1 month ago
i just recently started using visual c++ and directx rather than djgpp and allegro. back when i was used to dos programming, i wrote a little linked list template thing, with a struct and some functions. i included the same functions into a windows program, and when i try compiling it, it says
quote:anim.obj : error LNK2001: unresolved external symbol "void __cdecl list_delete(struct list * &,struct list *)" (?list_delete@@YAXAAPAU?$list@PAUIDirectDrawSurface7@@@@PAU1@@Z) anim.obj : error LNK2001: unresolved external symbol "void __cdecl list_new(struct list * &,struct IDirectDrawSurface7 *)" (?list_new@@YAXAAPAU?$list@PAUIDirectDrawSurface7@@@@PAUIDirectDrawSurface7@@@Z)
pressing f1 in vc++ told me that the __cdecl part means that i''m trying to port something from 16 bit to 32 bit (which i am), and it wants me to use things called EXPORTS to fix it. but i don''t really want to use exports. i don''t see why this wouldn''t just work in windows anyway. here''s my linked list template thing header file:
#ifndef _LIST_H
#define _LIST_H

// the linked list structure structure
template <class type>
struct list
{
     type data;
     list<type> * next;
};

// linked list functions
template <class type>
void list_new(list<type> *& head, type data);
template <class type>
void list_new(list<type> *& head, list<type> * prev, type data);
template <class type>
void list_delete(list<type> *& head, list<type> * node);
template <class type>
void list_delete_all(list<type> *& head);

#endif // _LIST_H 
is any reason why this would give me those linker errors in win32? - f l u c k y p o o - the geek inside
- f l u c k y p o o
Advertisement
Did you implement those functions in .cpp/.c file?

" Do we need us? "


Ionware Productions - Games and Game Tools Development

yes i did. i just didn''t post it here, because i know it works. i''ve used all these functions before, and they work.


- f l u c k y p o o
- the geek inside
- f l u c k y p o o
Last I checked VC++, like most current C++ compilers, doesn''t let you prototype templated code in one place and implement it in another.

This topic is closed to new replies.

Advertisement