c++ - Error: expected constructor, destructor, or type conversion before '(' token 2 -


i see common error, didn't see response quite fit. trying compile simple c++ application using dec-c++ under win 10. code included chinese usb i/o module, , need recompile prompts , comments in english. first part easy, google translate, project won't compile, giving subject error.

the errors output when compiling included function called main.cpp. offending function below.

i sure appreciate here!

dave

#ifndef _mc100_h #define _mc100_h extern "c"{  // 2013-3-27  #ifndef winapi #define winapi              __stdcall #endif  #define mc100_porta         0 #define mc100_portb         1 #define mc100_portc         2  // error v here, in _declspec lines _declspec(dllimport) int winapi mc100_scan_device(void); _declspec(dllimport) int winapi mc100_open(int id); _declspec(dllimport) int winapi mc100_close(int id); _declspec(dllimport) int winapi mc100_set_pin(int id, int pin); _declspec(dllimport) int winapi mc100_clear_pin(int id, int pin); _declspec(dllimport) int winapi mc100_check_pin(int id, int pin); _declspec(dllimport) int winapi mc100_set_push_pull(int id, int port, int value); _declspec(dllimport) int winapi mc100_set_pull_up(int id, int port, int value); _declspec(dllimport) int winapi mc100_read_port(int id, int port); _declspec(dllimport) int winapi mc100_write_port(int id, int port, int value); _declspec(dllimport) int winapi mc100_spi_send(int id, unsigned char * buffer, int length); _declspec(dllimport) int winapi mc100_spi_transmit(int id, unsigned char * buffer, int length);  } #endif 

_declspec old spelling of microsoft extension __declspec. telling linker symbols imported library. compiler doesn't appear support it. can either edit source remove it, or add define (#define _declspec(x)) either in code or on command line remove it.


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -