还是不行
我把代码贴出来,希望各位多多指点
****************************************************************
filesmas.pro文件
TEMPLATE = app
TARGET = FileSmash
QT += core gui
HEADERS += filesmash.h
SOURCES += main.cpp \
filesmash.cpp
FORMS += filesmash.ui
RESOURCES +=
INCLUDEPATH += H:/LibTest/include
LIBS += H:/LibTest/lib/wipelib.a
********************************************************************************
filesmash.h文件
#ifndef FILESMASH_H
#define FILESMASH_H
#include "ui_filesmash.h"
#include <qt_windows.h>
class FileSmash : public QWidget
{
Q_OBJECT
public:
FileSmash(QWidget *parent = 0);
~FileSmash();
private:
void QStringToTchar (const QString& str, TCHAR buf[]);
private:
Ui_FileSmashClass* ui;
};
#endif // FILESMASH_H
*********************************************************************
filesmash.cpp文件
#include "filesmash.h"
//#include <QDebug>
#include "H:\\LibTest\\include\\export.h"
FileSmash::FileSmash(QWidget *parent)
: QWidget(parent)
{
ui = new Ui_FileSmashClass;
ui->setupUi(this);
TCHAR filePath [255];
memset (filePath, 0, 255);
QString s = "G:\aaaa.txt";
QStringToTchar (s, filePath);
DoWipe (filePath);
}
FileSmash::~FileSmash()
{
delete ui;
}
void FileSmash::QStringToTchar (const QString& str, TCHAR buf[])
{
#if defined (UNICODE) || defined (_CL_HAVE_WCHAR_H) && defined (_CL_HAVE_WCHAR_T)
str.toWCharArray (buf);
#else
const QByteArray ba = str.toLocal8Bit ();
strcpy (buf, ba.constData ());
#endif
}
******************************************************************************
export.h文件
BOOL DoWipe(TCHAR *szPath); //FALSE 函数执行完毕
*****************************************************************************
生成wipelib.a的过程
C:\Documents and Settings\Administrator>cd H:\LibTest\lib
C:\Documents and Settings\Administrator>H:
H:\LibTest\lib>reimp -d wipelib.lib
H:\LibTest\lib>dlltool -k -d wipelib.def -l wipelib.a
******************************************************************************
wipelib.def文件
EXPORTS
DoWipe @1
*******************************************************************************
wipelib.lib大小为115kb
生成的wipelib.a的大小为3kb