Hi,

I have written a program using Dev C++. The program needs to call on functions from a .dll to run, so I have loaded the corresponding .lib into the project and all of the headers and the .dll is in the same directory as the .cpp file I have created.

When I go to run the program, it executes as expected until it comes to one of the functions I call from the .dll. At this point the program crashes and asks would I like to send the error of to microsoft. The usual thing.

I ran the debugger in Dev and it stepped through the program until it reached one of the functions. At this point the following was displayed.

An Access Violation (Segmentation Fault) raised in your program.

A friend suggested that the problem could be because the .dll was created with Microsoft Visual Studio and is not compatible with mingw.

Does anybody know if this is true and if so, any suggestions on what to do?

Regards

Brownie

P.S. The following is a segment of the code. The error is caused when the program tries to execute
ETGetLinkStatus()
or
Code:
ETSocketLink(ipaddr, 16385)
Code:
#include <cstdlib>
#include <iostream>
#include <stdio.h>
#include <memory.h>
#include "et1000.h"

using namespace std;

int main ()
{
    int iMachine;
    int iRet;
    int iRetVal;
    char ipaddr[16];
    
    cout << "1" << endl;
    
    iRetVal = ETGetLinkStatus();
    if (iRetVal < 1)
    {
                cout << "Not Linked" << endl;
    } else {
                cout << "Linked" << endl;
                }
        
    cout << "2" << endl;
    
    // prompt for IP and link to chassis
	printf("Enter IP address of SmartBits chassis ==> ");
	scanf("%s",ipaddr);
	printf("Linking on %s \n", ipaddr);
	
	cout << "3" << endl;
	
// negative return value means command failed
	iRet=ETSocketLink(ipaddr, 16385);
	if (iRet < 0)
	{
		printf("Error linking to chassis: %d \n",iRet);
		return iRet;
	}
    
    cout << "4" << endl;