Closed ghost closed 8 years ago
I never tried to compile Medusa with mingw, actually I don't use mingw at all, so I don't have any experience for this kind of issue.
Could you make sure WIN32
is defined?
If you manage to compile it with mingw, I will gladly add your patch.
changing WIN32
to #if defined WIN32 || defined _WIN32 || defined __CYGWIN__
in types.hpp works fine, but I got another problem std::this_thread::sleep_for mingw implementation using their lastest stable windows header is broken. nanosleep function is not defined. Someone says c++config.h had defined _GLIBCXX_USE_NANOSLEEP to 1 which is not available for non posix system. I'll post another progress
my final patch, sorry Im paste-ing here since I never work with git here before
--- medusa-dev\inc\medusa\binary_stream.hpp 2015-02-23 19:12:44 +0700
+++ medusa-dev1\medusa-dev\inc\medusa\binary_stream.hpp 2015-02-16 05:22:35 +0700
@@ -14,7 +14,6 @@
#include <boost/type_traits.hpp>
#include <boost/filesystem/path.hpp>
-#include <boost/filesystem/operations.hpp>
MEDUSA_NAMESPACE_BEGIN
--- medusa-dev\src\core\windows_module.cpp 2015-02-24 05:28:33 +0700
+++ medusa-dev1\medusa-dev\src\core\windows_module.cpp 2015-02-16 05:22:35 +0700
@@ -31,15 +31,10 @@
return pModule;
}
-#ifdef __MINGW32__
-FARPROC WINAPI Module::ImplGetFunctionAddress(void* pModule, std::string const& FunctionName)
-{
- return GetProcAddress(static_cast<HMODULE>(pModule), FunctionName.c_str());
-}
-#else
-void * Module::ImplGetFunctionAddress(void* pModule, std::string const& FunctionName)
+
+void* Module::ImplGetFunctionAddress(void* pModule, std::string const& FunctionName)
{
return GetProcAddress(static_cast<HMODULE>(pModule), FunctionName.c_str());
}
-#endif
+
MEDUSA_NAMESPACE_END
\ No newline at end of file
--- medusa-dev\inc\medusa\module.hpp 2015-02-24 05:30:31 +0700
+++ medusa-dev1\medusa-dev\inc\medusa\module.hpp 2015-02-16 05:22:35 +0700
@@ -48,11 +48,8 @@
typedef std::map< boost::filesystem::path, void* > TModuleMap;
void* ImplLoadLibrary(boost::filesystem::path const& LibraryPath);
-#ifdef __MINGW32__
- FARPROC WINAPI ImplGetFunctionAddress(void* pModule, std::string const& FunctionName);
-#else
-void * ImplGetFunctionAddress(void* pModule, std::string const& FunctionName);
-#endif
+ void* ImplGetFunctionAddress(void* pModule, std::string const& FunctionName);
+
TModuleMap m_ModuleMap;
};
--- medusa-dev\inc\medusa\module.hpp 2015-02-24 05:30:31 +0700
+++ medusa-dev1\medusa-dev\inc\medusa\module.hpp 2015-02-16 05:22:35 +0700
@@ -48,11 +48,8 @@
typedef std::map< boost::filesystem::path, void* > TModuleMap;
void* ImplLoadLibrary(boost::filesystem::path const& LibraryPath);
-#ifdef __MINGW32__
- FARPROC WINAPI ImplGetFunctionAddress(void* pModule, std::string const& FunctionName);
-#else
-void * ImplGetFunctionAddress(void* pModule, std::string const& FunctionName);
-#endif
+ void* ImplGetFunctionAddress(void* pModule, std::string const& FunctionName);
+
TModuleMap m_ModuleMap;
};
I have the question,why when doing the dissasembly graph(Ctrl+f), edge vertex color appears to slow?is there delay or something else ?
Thanks for the patch, I'll apply it ASAP. :)
Regarding the question, it would be better if you can make a new issue for it.
Anyway, the CFG view may appear to be slow because it has to compute the layout of the graph (using OGDF), the problem is this computation is made by the main thread (i.e. the GUI thread) which blocks the entire interface. I think it could be fixed by doing this computation in a asynchronous way (QThread
?).
Thanks for reporting though!
Like this one you mean?
QMetaObject::invokeMethod(thread, "quit",
Qt::QueuedConnection);
Im not familiar with OGDF, but I will see firstly
Hello kangjoni76,
I tried to compiled medusa with MinGW using your patch and I get stuck with coin library:
error: #error "Trying to use configall_system for unknown compiler."
# error "Trying to use configall_system for unknown compiler."
^
Did you have the same issue?
Sorry for late answer, I was busy another jobs. No, I didnt, I built fine. Let me clarify this
WIN32
should be changed to something like #if defined WIN32 || defined _WIN32 || defined __CYGWIN__ || __MINGW32__
#include <boost/filesystem/operations.hpp>
to binary_stream.hpp FARPROC
nasty C callback. As temporary workaround
we need to change some statements to something like#ifdef __MINGW32__
FARPROC WINAPI Module::ImplGetFunctionAddress(void* pModule, std::string const& FunctionName)
{
return GetProcAddress(static_cast<HMODULE>(pModule), FunctionName.c_str());
}
#else
void * Module::ImplGetFunctionAddress(void* pModule, std::string const& FunctionName)
void* Module::ImplGetFunctionAddress(void* pModule, std::string const& FunctionName)
{
return GetProcAddress(static_cast<HMODULE>(pModule), FunctionName.c_str());
}
#endif
this also should be adjusted to module.hpp for the interface declaration.
And lastly in the c++config.h in mingw 4.9 distribution posix thread _GLIBCXX_USE_NANOSLEEP
should be commented
Those all working fine for me.
No problem, I'm also busy these days. :) I trust you on this one since I'm still unable to make mingw to compile Medusa, too bad the last patch requires to patch a c++config.h. The commit is https://github.com/wisk/medusa/commit/2f121349f3a2796b6874f62da39a17427b199dbc, please tell me if it's good for you.
Thanks for sharing!
in module.hpp this statement should be changed
FARPROC WINAPI Module::ImplGetFunctionAddress(void* pModule, std::string const& FunctionName)
to FARPROC WINAPI ImplGetFunctionAddress(void* pModule, std::string const& FunctionName)
and viola yey.. :dancers:
Hi,
This change was made some time ago, I close the issue now. If you still have this issue, feel free to re-open this issue. If you experience another issue when compiling with mingw (which I do not use), please create a new issue.
Thanks.
I try to build using mingw 4.9 using boost 1.5.7