Compiler not finding CM3 C function definitions

Post your C and C++ discussions here
Post Reply
Martin Chisnall
Newbie
Posts: 0
Joined: Tue Dec 06, 2016 9:53 pm

Compiler not finding CM3 C function definitions

Post by Martin Chisnall »

I am trying to write my own application in C for PLCM3, and learning C at the same time!
I am using your sample C console code using Code Blocks IDE and GCC compiler.
the compiler complains that all the references to the PLCM3 functions are undefined, for example:
undefined reference to `_imp__PLCM3OpenUnit@8
The code has the following include line at the top:
#include "C:\program Files\Pico Technology\SDK\inc\PLCM3Api.h"
and the compiler linker includes paths to PicoStatus.h and PLCM3Api.h
What am I doing wrong / missing please?
(what, if anything, do I do with the PLCM3.dll?)
I am on a windows 10 64bit machine.
thank you.

Hitesh

Re: Compiler not finding CM3 C function definitions

Post by Hitesh »

Hi Martin,

Are you building a 32-bit or 64-bit application?

You might need to include the plcm3.lib file which is located in the C:\program Files\Pico Technology\SDK\lib\ folder for the 64-bit drivers or C:\Program Files (x86)\Pico Technology\SDK\lib for 32-bit applications.

Regards,

Martin Chisnall
Newbie
Posts: 0
Joined: Tue Dec 06, 2016 9:53 pm

Re: Compiler not finding CM3 C function definitions

Post by Martin Chisnall »

Hi Hitesh,
Thank you for your quick and accurate response.
I did indeed have a mix of 32 and 64 bit includes and files going on!
All compiling OK now, but now the code is working I have another question which I will post under a new thread 'g_status = PLCM3OpenUnit'
Martin

Post Reply