PDA

View Full Version : creating dll problem -> no exports ...



vrudolf
30th July 2006, 13:38
hi,

i can't import functions from the dll in other programs written in Delphi or Visual Studio...

the header file

.
.
.
#include <qt_windows.h>
#include <qglobal.h>

#ifdef _DLL_BUILD_
# define DLL_EXPORT Q_DECL_EXPORT
#else
# define DLL_EXPORT Q_DECL_IMPORT
#endif

bool DLL_EXPORT rsXML2CSV( char *fileName );
.
.
.

the source file

.
.
.
bool DLL_EXPORT rsXML2CSV( char *fileName )
{
QXMLExtractor exp( fileName, NULL, "QXLMEX" );
return( true );
}
.
.
.

the compiler output :confused:

MAKE Version 5.2 Copyright (c) 1987, 2000 Borland
bcc32 -c -tWR -w -w-hid -tWM -O2 -x- -D_DLL_BUILD_ -DQT_DLL -DQT_THREAD_
SUPPORT -DQT_NO_DEBUG -I"C:\Qt\3.1.2\include" -I"C:\Projekte\qt\fes\dimdi\dll" -
I"C:\Qt\3.1.2\mkspecs\win32-borland" -oqxmlextractor.obj ..\qxmlextractor.cpp
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
..\qxmlextractor.cpp:
Error E2141 ..\qxmlextractor.h 30: Declaration syntax error
Error E2238 ..\qxmlextractor.cpp 280: Multiple declaration for 'Q_DECL_EXPORT'
Error E2344 ..\qxmlextractor.h 30: Earlier declaration of 'Q_DECL_EXPORT'
Error E2141 ..\qxmlextractor.cpp 280: Declaration syntax error
*** 4 errors in Compile ***

** error 1 ** deleting qxmlextractor.obj

jacek
30th July 2006, 13:44
Q_DECL_EXPORT and Q_DECL_IMPORT macros might not be available in Qt 3.1.2.

Try:

#ifndef Q_OS_UNIX
# ifdef _DLL_BUILD_
# define DLL_EXPORT __declspec(dllexport)
# else
# define DLL_EXPORT __declspec(dllimport)
# endif
#else
# define DLL_EXPORT
#endif

vrudolf
30th July 2006, 17:47
@jacek

thx... :D