Skip to main content
Submitted by joemsong on Thu, 12/18/2014 - 19:21

Operating system: Windows 8
Compiler: Microsoft (R) C/C++ Optimizing Compiler Version 17.00.61030 for x86

hello.cpp or example.cpp is able to create a connection to the DMC, but then the program crashes by saying ""hello.exe" has stopped working". Was this because I am using x86 version? Will switching to 64-bit OS work better?

Thanks.

Comments 3

joemsong on 12/18/2014 - 19:38

By the way, I am able to run simple command through Galil Suite.

Additionally, my host computer is using WiFi and the DMC is connected to the router.

MattK on 12/19/2014 - 09:00

Hi joemsong,

My suspicion is that you are using binaries that are mismatched to the compiler command line being used. It is important to note whether you are compiling as release or debug mode.

This is set by the -MD option of the compiler command. As per the hello.cpp comments:
Release version: cl hello.cpp Galil1.lib -EHsc -MD
Debug version: cl hello.cpp Galil1.lib -EHsc -MDd
The library downloads contain the appropriate binaries for each option in the "debug" and "release" folders.

joemsong on 12/19/2014 - 22:19

Matt: Thank you for the answer. I am now able to make some progress but still have serious issues in the end. Here is the summary.

OS: Windows 8.1
MSVC compiler: Microsoft (R) C/C++ Optimizing Compiler Version 17.00.50727.1 for x64
LibGalil: LibGalil-1.6.4.552-vs2010-x64\release
Program: example.cpp, galil.h (from LibGalil-1.6.4.552b download)
Compilation: cl example.cpp Galil1.lib -EHsc -MD
Execution: example

The program crashed after printing out

Qt: Untested Windows version 6.2 detected!
Listing library Version...
Galil1.dll
192.168.0.30, DMC30010 Rev 1.2c, 3289, IHC IHD

Now if I modify the program by replacing the line
cout << " " << g.connection() << endl;
with two lines as follows:
string conn = g.connection();
std::cout << conn << endl;
the program can run much further but still crashes later. The output is

Qt: Untested Windows version 6.2 detected!

Listing library Version...
Galil1.dll
192.168.0.30, DMC30010 Rev 1.2c, 3289, IHC IHD

Executing commandValue...
3.37

Executing program download/upload...
MG TIME;EN 6675438.0000

Executing array download/upload...
0
1
4
9
16
25

Reading data record...
0 @AN[1] 0 V Analog input 1
1 0

This almost suggest to me that there is memory leak with in the library, caused by various reasons.

The first suspicion that I have is regarding the version of visual studio: I am using visual studio 2012 (with 2013 update and thus the latest version), but the Galil library seems to be compiled under visual studio 2010. We know that there is the c++11 standard in between which is a major upgrade. I don't want to re-install the old 2010 visual studio. Is it possible to release libGalil using the latest 2013 compiler? The 2013 version provided from the libGalil download link does not compile.

Thank you.

Joe