www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.ide
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript
electronics



c++ - how to compile/link with dll

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