c++ - how to compile/link with dll
- Ellen Solomon <esolomon2 gmail.com> Aug 19 2008
Hi! A rather novice question here, hopefully one of you can
answer it faster than the time it takes to read my query.
I want to compile a simple c++ program that calls a standard
windows dll. But at link time I'm getting an Unknown Symbol error.
I put the dll in my windows path; since it isn't a com dll it
can't be registered, and I'm not sure if I should be installing it
in some other way.
This is my code, which compiles but gets a link error. The .exe
is built but when I try to run it I get an error "not a valid
win32 application"
////////////////////// convertxls.cpp ////////////////////////////
//parameters in the source code
//
//convertxls.exe
//
#include <string.h>
int __declspec(dllimport) __stdcall XLStoDBF_Converter
(int, int, char *[]);
int
main()
{
int n=0;
char *params[10];
params[n++]=strdup("convertxls.exe");
params[n++]=strdup("source.xls");
params[n++]=strdup("c:\\target\\");
params[n++]=strdup("/HEADER=0");
return XLStoDBF_Converter(0, n, params);
}
//
////////////////////// convertxls.cpp ////////////////////////////
Here's a link to my dll vendor's sample (see sample2):
http://www.whitetown.com/xls2dbf/
Any help or suggestions would be very appreciated. Thank you.
Regards,
Ellen
Aug 19 2008








Ellen Solomon <esolomon2 gmail.com>