[Beremiz-devel] The IDE is on win32 , The RTE is on Linux, build failed

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[Beremiz-devel] The IDE is on win32 , The RTE is on Linux, build failed

klwanghao
HI Beremiz developers
 I`m new in Beremiz. 
 I want to build my project using win32 target , and I use Linux target platform.
 In other words,The IDE is on win32 , The RTE is on Linux
 the target type is "Win32" ,the IDE build succeed.

 the target type is "Linux" , the IDE build failed
 In IDE ,I select Compiler is "gcc" ,CFLAGS is "" , Linker is "gcc" , LDFLAGS is ""

 and then build , IDE prints the following 
................................................................................................
PLC:
   [CC]  plc_main.c -> plc_main.o
C:\Users\klwanghao\Desktop\BeremizExamples\base_tests\first_steps\build\plc_main.c: In function 'PLC_GetTime':
C:\Users\klwanghao\Desktop\BeremizExamples\base_tests\first_steps\build\plc_main.c:126:5: warning: implicit declaration of function 'clock_gettime' [-Wimplicit-function-declaration]
     clock_gettime(CLOCK_REALTIME, &tmp);
     ^~~~~~~~~~~~~
C:\Users\klwanghao\Desktop\BeremizExamples\base_tests\first_steps\build\plc_main.c:126:19: error: 'CLOCK_REALTIME' undeclared (first use in this function)
     clock_gettime(CLOCK_REALTIME, &tmp);
                   ^~~~~~~~~~~~~~
C:\Users\klwanghao\Desktop\BeremizExamples\base_tests\first_steps\build\plc_main.c:126:19: note: each undeclared identifier is reported only once for each function it appears in
C:\Users\klwanghao\Desktop\BeremizExamples\base_tests\first_steps\build\plc_main.c: At top level:
C:\Users\klwanghao\Desktop\BeremizExamples\base_tests\first_steps\build\plc_main.c:131:23: error: unknown type name 'sigval_t'
 void PLC_timer_notify(sigval_t val)
                       ^~~~~~~~
C:\Users\klwanghao\Desktop\BeremizExamples\base_tests\first_steps\build\plc_main.c:137:1: error: unknown type name 'timer_t'
 timer_t PLC_timer;
 ^~~~~~~
C:\Users\klwanghao\Desktop\BeremizExamples\base_tests\first_steps\build\plc_main.c: In function 'PLC_SetTimer':
C:\Users\klwanghao\Desktop\BeremizExamples\base_tests\first_steps\build\plc_main.c:141:23: error: storage size of 'timerValues' isn't known
     struct itimerspec timerValues;
                       ^~~~~~~~~~~
C:\Users\klwanghao\Desktop\BeremizExamples\base_tests\first_steps\build\plc_main.c:145:38: error: invalid application of 'sizeof' to incomplete type 'struct itimerspec'
     memset (&timerValues, 0, sizeof (struct itimerspec));
                                      ^~~~~~
C:\Users\klwanghao\Desktop\BeremizExamples\base_tests\first_steps\build\plc_main.c:161:5: warning: implicit declaration of function 'timer_settime' [-Wimplicit-function-declaration]
     timer_settime (PLC_timer, 0, &timerValues, NULL);
     ^~~~~~~~~~~~~
C:\Users\klwanghao\Desktop\BeremizExamples\base_tests\first_steps\build\plc_main.c: In function 'startPLC':
C:\Users\klwanghao\Desktop\BeremizExamples\base_tests\first_steps\build\plc_main.c:199:21: error: storage size of 'sigev' isn't known
     struct sigevent sigev;
                     ^~~~~
C:\Users\klwanghao\Desktop\BeremizExamples\base_tests\first_steps\build\plc_main.c:208:32: error: invalid application of 'sizeof' to incomplete type 'struct sigevent'
     memset (&sigev, 0, sizeof (struct sigevent));
                                ^~~~~~
C:\Users\klwanghao\Desktop\BeremizExamples\base_tests\first_steps\build\plc_main.c:210:26: error: 'SIGEV_THREAD' undeclared (first use in this function)
     sigev.sigev_notify = SIGEV_THREAD;
                          ^~~~~~~~~~~~
C:\Users\klwanghao\Desktop\BeremizExamples\base_tests\first_steps\build\plc_main.c:212:35: error: 'PLC_timer_notify' undeclared (first use in this function)
     sigev.sigev_notify_function = PLC_timer_notify;
                                   ^~~~~~~~~~~~~~~~
C:\Users\klwanghao\Desktop\BeremizExamples\base_tests\first_steps\build\plc_main.c:222:5: warning: implicit declaration of function 'timer_create' [-Wimplicit-function-declaration]
     timer_create (CLOCK_MONOTONIC, &sigev, &PLC_timer);
     ^~~~~~~~~~~~
C:\Users\klwanghao\Desktop\BeremizExamples\base_tests\first_steps\build\plc_main.c:222:19: error: 'CLOCK_MONOTONIC' undeclared (first use in this function)
     timer_create (CLOCK_MONOTONIC, &sigev, &PLC_timer);
                   ^~~~~~~~~~~~~~~
"gcc" -c "C:\Users\klwanghao\Desktop\BeremizExamples\base_tests\first_steps\build\plc_main.c" -o "C:\Users\klwanghao\Desktop\BeremizExamples\base_tests\first_steps\build\plc_main.o" -O2  -fPIC "-IE:\beremiz\matiec\lib\C" -Wno-unused-function
C:\Users\klwanghao\Desktop\BeremizExamples\base_tests\first_steps\build\plc_main.c: In function 'stopPLC':
退出伴随状态 1 (pid 52324)
C:\Users\klwanghao\Desktop\BeremizExamples\base_tests\first_steps\build\plc_main.c:259:5: warning: implicit declaration of function 'timer_delete' [-Wimplicit-function-declaration]
     timer_delete (PLC_timer);
     ^~~~~~~~~~~~
 plc_main.c 的C编译失败。
................................................................................................


 



 



 



 



 



 



_______________________________________________
Beremiz-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beremiz-devel
Reply | Threaded
Open this post in threaded view
|

Re: [Beremiz-devel] The IDE is on win32 , The RTE is on Linux, build failed

Georgy Komarov

Hi,

It seems like your gcc installation is broken because it doesn't see the glibc functions. Consider the gcc installation guides for your OS, or try other alternatives. For example, you can run gcc inside a Cygwin or WSL session.

22.01.2021 14:04, 王浩 пишет:
HI Beremiz developers
 I`m new in Beremiz. 
 I want to build my project using win32 target , and I use Linux target platform.
 In other words,The IDE is on win32 , The RTE is on Linux
 the target type is "Win32" ,the IDE build succeed.

 the target type is "Linux" , the IDE build failed
 In IDE ,I select Compiler is "gcc" ,CFLAGS is "" , Linker is "gcc" , LDFLAGS is ""

 and then build , IDE prints the following 
................................................................................................
PLC:
   [CC]  plc_main.c -> plc_main.o
C:\Users\klwanghao\Desktop\BeremizExamples\base_tests\first_steps\build\plc_main.c: In function 'PLC_GetTime':
C:\Users\klwanghao\Desktop\BeremizExamples\base_tests\first_steps\build\plc_main.c:126:5: warning: implicit declaration of function 'clock_gettime' [-Wimplicit-function-declaration]
     clock_gettime(CLOCK_REALTIME, &tmp);
     ^~~~~~~~~~~~~
C:\Users\klwanghao\Desktop\BeremizExamples\base_tests\first_steps\build\plc_main.c:126:19: error: 'CLOCK_REALTIME' undeclared (first use in this function)
     clock_gettime(CLOCK_REALTIME, &tmp);
                   ^~~~~~~~~~~~~~
C:\Users\klwanghao\Desktop\BeremizExamples\base_tests\first_steps\build\plc_main.c:126:19: note: each undeclared identifier is reported only once for each function it appears in
C:\Users\klwanghao\Desktop\BeremizExamples\base_tests\first_steps\build\plc_main.c: At top level:
C:\Users\klwanghao\Desktop\BeremizExamples\base_tests\first_steps\build\plc_main.c:131:23: error: unknown type name 'sigval_t'
 void PLC_timer_notify(sigval_t val)
                       ^~~~~~~~
C:\Users\klwanghao\Desktop\BeremizExamples\base_tests\first_steps\build\plc_main.c:137:1: error: unknown type name 'timer_t'
 timer_t PLC_timer;
 ^~~~~~~
C:\Users\klwanghao\Desktop\BeremizExamples\base_tests\first_steps\build\plc_main.c: In function 'PLC_SetTimer':
C:\Users\klwanghao\Desktop\BeremizExamples\base_tests\first_steps\build\plc_main.c:141:23: error: storage size of 'timerValues' isn't known
     struct itimerspec timerValues;
                       ^~~~~~~~~~~
C:\Users\klwanghao\Desktop\BeremizExamples\base_tests\first_steps\build\plc_main.c:145:38: error: invalid application of 'sizeof' to incomplete type 'struct itimerspec'
     memset (&timerValues, 0, sizeof (struct itimerspec));
                                      ^~~~~~
C:\Users\klwanghao\Desktop\BeremizExamples\base_tests\first_steps\build\plc_main.c:161:5: warning: implicit declaration of function 'timer_settime' [-Wimplicit-function-declaration]
     timer_settime (PLC_timer, 0, &timerValues, NULL);
     ^~~~~~~~~~~~~
C:\Users\klwanghao\Desktop\BeremizExamples\base_tests\first_steps\build\plc_main.c: In function 'startPLC':
C:\Users\klwanghao\Desktop\BeremizExamples\base_tests\first_steps\build\plc_main.c:199:21: error: storage size of 'sigev' isn't known
     struct sigevent sigev;
                     ^~~~~
C:\Users\klwanghao\Desktop\BeremizExamples\base_tests\first_steps\build\plc_main.c:208:32: error: invalid application of 'sizeof' to incomplete type 'struct sigevent'
     memset (&sigev, 0, sizeof (struct sigevent));
                                ^~~~~~
C:\Users\klwanghao\Desktop\BeremizExamples\base_tests\first_steps\build\plc_main.c:210:26: error: 'SIGEV_THREAD' undeclared (first use in this function)
     sigev.sigev_notify = SIGEV_THREAD;
                          ^~~~~~~~~~~~
C:\Users\klwanghao\Desktop\BeremizExamples\base_tests\first_steps\build\plc_main.c:212:35: error: 'PLC_timer_notify' undeclared (first use in this function)
     sigev.sigev_notify_function = PLC_timer_notify;
                                   ^~~~~~~~~~~~~~~~
C:\Users\klwanghao\Desktop\BeremizExamples\base_tests\first_steps\build\plc_main.c:222:5: warning: implicit declaration of function 'timer_create' [-Wimplicit-function-declaration]
     timer_create (CLOCK_MONOTONIC, &sigev, &PLC_timer);
     ^~~~~~~~~~~~
C:\Users\klwanghao\Desktop\BeremizExamples\base_tests\first_steps\build\plc_main.c:222:19: error: 'CLOCK_MONOTONIC' undeclared (first use in this function)
     timer_create (CLOCK_MONOTONIC, &sigev, &PLC_timer);
                   ^~~~~~~~~~~~~~~
"gcc" -c "C:\Users\klwanghao\Desktop\BeremizExamples\base_tests\first_steps\build\plc_main.c" -o "C:\Users\klwanghao\Desktop\BeremizExamples\base_tests\first_steps\build\plc_main.o" -O2  -fPIC "-IE:\beremiz\matiec\lib\C" -Wno-unused-function
C:\Users\klwanghao\Desktop\BeremizExamples\base_tests\first_steps\build\plc_main.c: In function 'stopPLC':
退出伴随状态 1 (pid 52324)
C:\Users\klwanghao\Desktop\BeremizExamples\base_tests\first_steps\build\plc_main.c:259:5: warning: implicit declaration of function 'timer_delete' [-Wimplicit-function-declaration]
     timer_delete (PLC_timer);
     ^~~~~~~~~~~~
 plc_main.c 的C编译失败。
................................................................................................


 



 



 



 



 



 



_______________________________________________
Beremiz-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beremiz-devel
-- 
Best regards,
Georgiy Komarov


_______________________________________________
Beremiz-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beremiz-devel

OpenPGP_0x195B8622FE88ED46.asc (690 bytes) Download Attachment
OpenPGP_signature (243 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Beremiz-devel] The IDE is on win32 , The RTE is on Linux, build failed

klwanghao
 Hi ,thank you .
 My partner has got the result 。
 Cygmin must be installed. Because it contains librt.
  In IDE,the target type is "Linux" , and select Compiler is
"x86_64-pc-cygwin-gcc" ,CFLAGS is "" , Linker is "x86_64-pc-cygwin-gcc" ,
LDFLAGS is ""



--
Sent from: http://beremiz-devel.2374573.n4.nabble.com/


_______________________________________________
Beremiz-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beremiz-devel