Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Cannot run C++ example on Win7. #2792

Closed
anthony-han opened this issue Jul 21, 2016 · 9 comments
Closed

Cannot run C++ example on Win7. #2792

anthony-han opened this issue Jul 21, 2016 · 9 comments

Comments

@anthony-han
Copy link

Hi everyone,

I cannot run the C++ example on Win7. There is no error during compilation. When running the program, it cannot enter the main function. However, the same program can run pretty well on Win10. Can anyone help?

Tony

@thirdwing
Copy link
Contributor

@hjk41

@hjk41
Copy link
Contributor

hjk41 commented Jul 25, 2016

Are you using pre-compiled libmxnet.dll or did you compile it on your own?

On Fri, Jul 22, 2016 at 11:46 PM, Qiang Kou (KK) [email protected]
wrote:

@hjk41 https://github.com/hjk41


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#2792 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/ABFI4Y_z9EsUsDivSUMxVneQCAeBl-qwks5qYOXXgaJpZM4JRjqB
.

@xxradon
Copy link

xxradon commented Sep 14, 2016

I have the same problem with @anthony-han , @hjk41 and i use both pre-compiled libmxnet.dll and compiled it on my own,the problem is still there.

@basejn
Copy link

basejn commented Nov 16, 2016

I have the same problem . If this line is in the code
#include "mxnet-cpp/MxNetCpp.h"
The CMD windows starts but just freezes , without even entering the main function.
if a comment the include and all the code that uses it , the program runs ok (Just printf("Started\n"))

@hjk41
Copy link
Contributor

hjk41 commented Nov 18, 2016

This is usually caused by a mis-match in the DLL.
If you are using pre-compiled libmxnet.dll, you should download the
win10_x64_xxx releases instead of win2012_xxx. If you are building your own
dll, make sure you use the same machine/compiler/compiler options to
compile the DLL and the CPP code.

On Wed, Nov 16, 2016 at 9:22 PM, basejn [email protected] wrote:

I have the same problem . If this line is in the code
#include "mxnet-cpp/MxNetCpp.h"
The CMD windows starts but just freezes , without even entering the main
function.
if a comment the include and all the code that uses it , the program runs
ok (Just printf("Started\n"))


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#2792 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/ABFI4U9uWnItU2JY33hJ5aIfLzzqg31Iks5q-wOIgaJpZM4JRjqB
.

@jemaw
Copy link
Contributor

jemaw commented Dec 7, 2016

I have the same problem when compiling mxnet on windows 7 (32 bit). The build works without any errors, but simple examples using the c api just freeze:

#include <iostream>

extern "C" __declspec(dllimport) const char* MXGetLastError();
int main(){
	std::cout << "LAST ERROR: " << MXGetLastError() << std::endl;
	return 0;
}

The strange thing is the same executable (with same opencv, openblas, mxnet dlls) works without any problems on windows10 (32 and 64 bit).
Additionally I tried not linking mxnet but loading the library manually like this:

#include <iostream>
#include <windows.h>
#include <tchar.h>

typedef const char*(* f_LAST)();

int main(){
    HINSTANCE proc = LoadLibrary(_T("libmxnet.dll"));
	if(proc) std::cout << "lib loaded" << std::endl;
	f_LAST last = (f_LAST)GetProcAddress(proc, "MXGetLastError");
	if (last) std::cout << "FUNC last error loaded : " << last() << std::endl;
	return 0;
}

This works on windows 7 and 10.

@zhyj3038
Copy link

zhyj3038 commented Jan 16, 2017

@GabbaGandalf but it seems the MXGetLastError function does not work either! i saw somebody load the dll dynamically, but i do not know how to do it !

@yajiedesign
Copy link
Contributor

This issue is closed due to lack of activity in the last 90 days. Feel free to reopen if this is still an active issue. Thanks!

@Tyill
Copy link

Tyill commented Mar 26, 2018

On Win7 statically does not work, the application hangs.
Dynamically normal.
Check yourself what's the matter there.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants