Ok thanks, i already read that page but i don't understand how can i do it in visual studio.
I have one simple function in my exe, the main function!
I want to put this fuction in the dll, make it global and import into a c# project.
I created a new project with visual studio wizard: under qt project i choosed Qt library and pasted the code into the cpp.
This is the function in cpp:
int Mp4D::Decap(int argc, char** argv)
{
NaluMatcher.
setPattern(QByteArray(( char*)NaluSync,
3));
assert(argc > 1);
bool h264 = isH264(data);
qDebug() << "Autodetected stream format: " << (h264 ? "H264" : "Mpeg4");
if (h264)
writeH264StreamToMp4File(data, output,25,720,576);
return 0;
}
int Mp4D::Decap(int argc, char** argv)
{
NaluMatcher.setPattern(QByteArray(( char*)NaluSync, 3));
assert(argc > 1);
QFile stream(argv[1]);
stream.open(QIODevice::ReadOnly);
QByteArray data = stream.readAll();
QString output = argv[argc-1];
bool h264 = isH264(data);
qDebug() << "Autodetected stream format: " << (h264 ? "H264" : "Mpeg4");
if (h264)
writeH264StreamToMp4File(data, output,25,720,576);
return 0;
}
To copy to clipboard, switch view to plain text mode
don't look at the parameters of the function i know they r not correct, it's just an example.
Visual studio compile it but it doesn't like any dll or lib.
The .pro generated by Visual studio is this:
TEMPLATE = lib
TARGET = Mp4DecapDll
DESTDIR = ../Release
QT += core qtmain
CONFIG += staticlib
DEFINES += QT_LARGEFILE_SUPPORT MP4DECAPDLL_LIB
INCLUDEPATH += ./GeneratedFiles \
./GeneratedFiles/Release \
.
LIBS += -llibmp4v2
DEPENDPATH += .
MOC_DIR += ./GeneratedFiles/release
OBJECTS_DIR += release
UI_DIR += ./GeneratedFiles
RCC_DIR += ./GeneratedFiles
include(Mp4DecapDll.pri)
TEMPLATE = lib
TARGET = Mp4DecapDll
DESTDIR = ../Release
QT += core qtmain
CONFIG += staticlib
DEFINES += QT_LARGEFILE_SUPPORT MP4DECAPDLL_LIB
INCLUDEPATH += ./GeneratedFiles \
./GeneratedFiles/Release \
.
LIBS += -llibmp4v2
DEPENDPATH += .
MOC_DIR += ./GeneratedFiles/release
OBJECTS_DIR += release
UI_DIR += ./GeneratedFiles
RCC_DIR += ./GeneratedFiles
include(Mp4DecapDll.pri)
To copy to clipboard, switch view to plain text mode
What should i do??
Thanks!
Bookmarks