Hello,
I am trying to incorporate the PCAN UDS library in my c++ project with Visual Studio 2017 but running against an issue.
I've downloaded the PCAN-UDS API & PCAN-ISO-TP API. The DLL files are in the executable folder and the LIB files are linked in the project settings under "Configuration Properties > Linker > Additional Library Directories"
However when starting the debugger I've got the issue that Visual Studio requires a PDB file for PCAN-ISO-TP which didn't come with the API ZIP.
What I've tried:
Enabled Just My Code -> Did not work, VS sees the imported PCAN DLL files as "User Code"
Set symbol files to load all modules unless excluded -> Added PCAN modules to list of exclusions, did not work.
Load only specified modules -> Did not work.
Ran the compiled executable -> Got error 0xc0000142
Versions:
Windows 10 Business v19045.2604
Visual Studio 2017 v15.9.49
Any pointers to get the debugger working?
PDB file not loaded
Re: PDB file not loaded
It seems to actually throw an exception which wants to access PCAN-ISO-TP
Unhandled exception at 0x00007FFC6FBBCD29 in 14_client_uds_and_can.exe: Microsoft C++ exception: std::runtime_error at memory location 0x00000064210FECF0. occurred
Unmodified example from the UDS API.
Unhandled exception at 0x00007FFC6FBBCD29 in 14_client_uds_and_can.exe: Microsoft C++ exception: std::runtime_error at memory location 0x00000064210FECF0. occurred
Unmodified example from the UDS API.
Re: PDB file not loaded
Trying to find the culprit, line 160 in 'client_uds_and_can.cpp'
> status = UDS_GetValue_2013(PCANTP_HANDLE_NONEBUS, PUDS_PARAMETER_API_VERSION, buffer, BUFFER_SIZE);
causes an exception, as well as the other functions below it (UDS_Initialize_2013, CreateThread)
> status = UDS_GetValue_2013(PCANTP_HANDLE_NONEBUS, PUDS_PARAMETER_API_VERSION, buffer, BUFFER_SIZE);
causes an exception, as well as the other functions below it (UDS_Initialize_2013, CreateThread)
Re: PDB file not loaded
Hello,
I am able to load and run any UDS sample project (also 14_client_uds_and_can) using our standard tool VS2022. Making a new c++ console project from scratch targeting the tools set for VS2017 works as well. I cannot find any issue on loading available samples or creating new projects that use the lib file for loading the APIs.
Not sure where your problem is, but I can say following:
PCAN-Basic: https://www.peak-system.com/PCAN-Basic.126.0.html?&L=1
PCAN-ISO-TP: https://www.peak-system.com/PCAN-ISO-TP ... .html?&L=1
PCAN-UDS: https://www.peak-system.com/PCAN-UDS-AP ... .html?&L=1
I have attached a simple c++ console project that load the PCAN-UDS lib and makes a call to UDS_Initialize, using the VS2017 tool set. This works for me. I hope this can helps you finding what is wrong in your project.
I am able to load and run any UDS sample project (also 14_client_uds_and_can) using our standard tool VS2022. Making a new c++ console project from scratch targeting the tools set for VS2017 works as well. I cannot find any issue on loading available samples or creating new projects that use the lib file for loading the APIs.
Not sure where your problem is, but I can say following:
- The PDB file (also known as symbol file), is only needed if you want to debug into the PCAN libraries. This is not supported and that is why they are also not delivered.
- For using the API files and debugging your own project, it is not needed to have the PDB files of the APIs.
- For accessing and using PCAN-UDS with a lib file, you need to
- add the PCAN-USB.lib file to your project (directly as a part of your project, or over the Linker properties).
- add the header files PCAN-UDS.h and PCAN-ISO-TP.h to your project
- copy the files PCAN-UDS.dll, PCAN-ISO-TP.dll (and eventually also PCANBasic.dll, if not installed) to the output folder of your project
- be sure that the project platform and lib/dll platform is the same, for instance, all of them are x64.
PCAN-Basic: https://www.peak-system.com/PCAN-Basic.126.0.html?&L=1
PCAN-ISO-TP: https://www.peak-system.com/PCAN-ISO-TP ... .html?&L=1
PCAN-UDS: https://www.peak-system.com/PCAN-UDS-AP ... .html?&L=1
I have attached a simple c++ console project that load the PCAN-UDS lib and makes a call to UDS_Initialize, using the VS2017 tool set. This works for me. I hope this can helps you finding what is wrong in your project.
- Attachments
-
- SimpleLoadTest.zip
- Simple call to UDS_Initialize
- (1022.15 KiB) Downloaded 1234 times
Best regards,
Keneth
Keneth
Re: PDB file not loaded
Thanks for the response, the attached project does indeed work, as well as when I copy functions from the example, I shall just ignore the supplied examples. Thanks again.