current position:Home>Vs2015 migration project, failed to connect can

Vs2015 migration project, failed to connect can

2022-02-02 21:54:22 CSDN Q & A

The phenomenon and background of the problem

Environmental Science : All are win10+VS2015
The same project , stay A You can succeed in a computer (amd processor )
But in B You can't do it on a computer (intel processor )
The configuration is the same , Include directory and Library Directory , The addition of dependent libraries is the same (opencv,CAN_lib file )

    {        if (openCAN.RunCAN(0) == 1)        {            cout << "Successfully opened CAN0"<< endl;        }        if (openCAN1.RunCAN(1) == 1)        {            cout << "Successfully opened CAN1" << endl;        }    }    else    {        cout << "openCAN.RunDevive():" << openCAN.RunDevive() << endl;        openCAN.StopCAN();// Output usbcan is not exist    }

RunDevive() Definition

int OpenCAN::RunDevive(){    return (VCI_OpenDevice(DeviceType, DeviceIndex, Reserved));}

OpenDevice Definition ( stay B Return from computer 0, The correct should return 1)

EXTERNC DWORD __stdcall VCI_OpenDevice(DWORD DeviceType,DWORD DeviceInd,DWORD Reserved);
Operation results and error reporting contents

An error is as follows :


My solution ideas and tried methods

1、 An error was encountered during the migration of the project
fatal error C1189: #error: "No Target Architecture"
stay C++ - Add... To the preprocessor AMD64 Error reporting solution
Is it related to the processor type ?(A The computer amd, B The computer intel,C The computer intel Also failed )

2、 Use cantest Yes CAN Test the signal
Choose the device :USBCAN2, Set filtering to 500, Both channels can receive data
Personally feel CAN The card is OK , It's computers and CAN There is something wrong with the connection

What I want to achieve


Refer to the answer 1:

Ask the boss for a move , Stuck for days , Never solved

Refer to the answer 2:

copyright notice
author[CSDN Q & A],Please bring the original link to reprint, thank you.

Random recommended