Fatal syntax error expected but const char found

Type identifier expected или что с процедурами Free Pascal Решение и ответ на вопрос 2537078

0 / 0 / 0

Регистрация: 18.08.2018

Сообщений: 11

1

24.11.2019, 05:13. Показов 4396. Ответов 2


Тема лабки: Динамические структуры данных
Задача: создать массив, состоящий из элементов, расчитаных по формуле x[i] = sin(i/(i^2 + 1)). Заполнение массива, вывод, а также подсчёт количества элементов (с выводом их на экран), имеющих значение выше 0, и тех, у которых значение ниже 0, в отдельных подпрограммахж
Когда run-ил, выскочили ошибки: «type identifier expected», «syntax error, «)» expected but «const char» found» на знаке «^» в 9-ой строчке. Думу думаю, да никак не вдумаю. Памагити

Pascal
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
program Lab_14;
const n = 22;
type
mas = array[1..n] of real;
var
x: ^mas;
p,q: integer;
procedure vvod(var x: ^mas; const n: integer); // Вот тут-то и ошибка
var 
i: integer;
k: real;
begin
k:=1;
for i:=1 to n do
begin
x^[i]:=sin(i/(sqr(i)+1));
end;
end;
procedure vyvod(var x: ^mas; const n: integer);
var i: integer;
begin
for i:=1 to n do
begin
write(x^[i]:5:4, ' ');
end;
end;
procedure pos(var x: ^mas; const n: integer; var p: integer);
var i: integer;
begin
p:=0;
for i:=1 to n do
begin
if(x^[i]>0) then
begin
p:=p+1;
end;
end;
end;
procedure neg(var x: ^mas; const n: integer; var q: integer);
var i: integer;
begin
q:=0;
begin
if(x^[i]<0) then
begin
q:=q+1;
end;
end;
end;
begin
new (x);
vvod(x, n);
vyvod(x,n);
writeln;
pos(x, n, p);
writeln('Quantity of positives: ', p);
neg(x, n, q);
writeln('Quantity of negatives: ', q);
dispose(x);
readln;
end.

… пожалуйста

__________________
Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь



0



    msm.ru

    Нравится ресурс?

    Помоги проекту!

    >
    Дата следующего дня

    • Подписаться на тему
    • Сообщить другу
    • Скачать/распечатать тему



    Сообщ.
    #1

    ,
    30.10.10, 06:57

      Пишу программу, опрeдeляющую дaту слeдующeго дня. Ceгoдняшняя дата вводится с клавиатуры.
      d, m, y — сeгoдня.
      d1, m1, y1 — завтра.

      ExpandedWrap disabled

        var

        d, m, y, d1, m1, y1, r: integer;

        last: boolean;

        BEGIN

        {Ввод данных добавлю позже}

           last:=false;

           case m of

           4, 6, 9, 11: if d=30

                then last:=true;

           2: if d=28

                then begin

                  r:=y mod 4;

                  if r <> 0 then

                        last:=true;

                        end;

                        else if d=31 then last=true;

                        end;

                  if last then begin

                     d:=1;

                     if m=12 then

                                begin

                                 m:=1;

                                 y1:=y+1;

                                 end

                                 else m1:=m+1;

                                 end

                                 else d1:=d+1;

                                 END.

      Free Pascal v2.4.0 при компиляции выдает ошибку: «Error Illegal expression». Помогите исправить. В алгоритме нет ошибок?


      Polinom2686



      Сообщ.
      #2

      ,
      30.10.10, 09:25

        Senior Member

        ****

        Рейтинг (т): 13

        ExpandedWrap disabled

          Var

          d, m, y, d1, m1, y1, r: integer;

          last: boolean;

          BEGIN

          {Ввод данных добавлю позже}

          last:=false;

          case m of

           4, 6, 9, 11: if d=30

                           then last:=true;

           2: if d=28

                 then begin

                       r:=y mod 4;

                       if r <> 0

                          then last:=true;

                      end;

           else if d=31

                   then last=true; // тут ошибка

          end;

          if last

             then begin

                   d:=1;

                   if m=12

                   then begin

                         m:=1;

                         y1:=y+1;

                        end

                   else m1:=m+1;

                  end

             else d1:=d+1;

          END.


        Yagami



        Сообщ.
        #3

        ,
        30.10.10, 09:59

          Polinom2686
          Спасибо! Невнимательность :wall:
          Можно решить задачу используя перечислимые и интервальные типы?

          Guru

          volvo877



          Сообщ.
          #4

          ,
          30.10.10, 10:19

            Moderator

            *******

            Рейтинг (т): 878

            Цитата Yagami @ 30.10.10, 09:59

            Можно решить задачу используя перечислимые и интервальные типы?

            Разумеется. Для дней достаточно интервала 1..31, для месяцев — 1..12 (или вообще сделать перечислимый тип Jan, Feb, …, Dec), совсем не обязательно использовать Integer.

            P.S.

            Цитата Polinom2686 @ 30.10.10, 09:25

            ExpandedWrap disabled

                           r:=y mod 4;

                           if r <> 0

                              then last:=true;

            Этого недостаточно, чтобы определить високосность года: Является-ли год високосный ? (сообщение #580679)


            Polinom2686



            Сообщ.
            #5

            ,
            30.10.10, 10:26

              Senior Member

              ****

              Рейтинг (т): 13

              Yagami, ты смотри на сообщения компилятора, он показывает место ошибки.


              Yagami



              Сообщ.
              #6

              ,
              31.10.10, 06:14

                volvo877

                ExpandedWrap disabled

                  var

                  y, y1, r: integer;

                  d, d1: 1..31;

                  m, m1: 1..12;

                  last: boolean;

                  BEGIN

                   Writeln(‘Ввод даты: ‘);

                     read(d);

                     last:=false;

                        case m of

                         4, 6, 9, 11: if d=30

                                         then last:=true;

                         2: if d=28

                               then begin

                                     r := (y mod 4) = 0) and

                                  not (((n mod 100) = 0) and ((n mod 400) <> 0)

                                              then last:=true;

                                    end;

                         else if d=31

                                 then last:=true;

                        end;

                        if last

                           then begin

                                 d:=1;

                                 if m=12

                                 then begin

                                       m:=1;

                                       y1:=y+1;

                                      end

                                 else m1:=m+1;

                                end

                           else d1:=d+1;

                  END.

                Компилятор сообщает об ошибке: «(26,35) Error: Incompatible types: got «Boolean» expected «SmallInt».»
                Как исправить?

                Guru

                volvo877



                Сообщ.
                #7

                ,
                31.10.10, 06:29

                  Moderator

                  *******

                  Рейтинг (т): 878

                  ExpandedWrap disabled

                    if ((y mod 4) = 0) and

                           not (((y mod 100) = 0) and ((y mod 400) <> 0)) then last := true;

                  Красным выделены места ошибок. По ссылке же было правильное написание, ЗАЧЕМ понадобилось убирать скобки?


                  Yagami



                  Сообщ.
                  #8

                  ,
                  31.10.10, 06:39

                    volvo877
                    Незачем. Отвлекся на телефонный звонок.

                    Сообщение отредактировано: Yagami — 31.10.10, 07:39


                    Yagami



                    Сообщ.
                    #9

                    ,
                    03.11.10, 10:28

                      Дописал проверку введенных данных, опять появились ошибки.

                      ExpandedWrap disabled

                        BEGIN

                         Write(‘Введите день, месяц, год, разделяя пробелами: ‘);

                         {$I-}

                           read(d, m, y);

                         {$I+}

                          if IOResult <> 0 then

                             begin

                            writeln(‘Вы не ввели три числа. Повторите ввод.’);

                            reset(input);

                            readln;

                             exit;

                           end;

                           if (d<1) or (d>31) then

                               begin

                             writeln(‘Ошибка ввода. Введите день (1-31)’);

                             reset(input);

                             readln;

                             exit;

                            end;

                            if (m<1) or (m>12) then

                                begin

                                writeln(‘Ошибка ввода. Введите месяц (1-12)’);

                                readln;

                                exit;

                            end;

                            if y<1 then

                                begin

                                writeln(‘Ошибка ввода. Год не долшен быть меньше 1.’);

                                reset(input);

                                readln;

                                exit;

                            end;

                      (74,20) Fatal: Syntax error, «)» expected but «const char» found

                      Сообщение отредактировано: Yagami — 03.11.10, 10:30

                      Guru

                      volvo877



                      Сообщ.
                      #10

                      ,
                      03.11.10, 10:32

                        Moderator

                        *******

                        Рейтинг (т): 878

                        Телепаты в отпуске. Либо приводи код полностью, либо ищи ошибки сам. В приведенном фрагменте всего 32 строки, какая из них 74-я?


                        Yagami



                        Сообщ.
                        #11

                        ,
                        03.11.10, 10:35

                          ExpandedWrap disabled

                            program NextDay;

                            uses crt;

                            var

                            y, y1, r: integer;

                            d, d1: 1..31;

                            m, m1: 1..12;

                            last: boolean;

                            BEGIN

                             Write(‘Введите день, месяц, год, разделяя пробелами: ‘);

                             {$I-}

                               read(d, m, y);

                             {$I+}

                              if IOResult <> 0 then

                                 begin

                                writeln(‘Вы не ввели три числа. Повторите ввод.’);

                                reset(input);

                                readln;

                                 exit;

                               end;

                               if (d<1) or (d>31) then

                                   begin

                                 writeln(‘Ошибка ввода. Введите день (1-31)’);

                                 reset(input);

                                 readln;

                                 exit;

                                end;

                                if (m<1) or (m>12) then

                                    begin

                                    writeln(‘Ошибка ввода. Введите месяц (1-12)’);

                                    readln;

                                    exit;

                                end;

                                if y<1 then

                                    begin

                                    writeln(‘Ошибка ввода. Год не долшен быть меньше 1.’);

                                    reset(input);

                                    readln;

                                    exit;

                                end;

                               last:=false;

                                  case m of

                                   4, 6, 9, 11: if d=30

                                                   then last:=true;

                                   2: if d=28

                                         then begin

                                                     if ((y mod 4) = 0) and

                                         not (((y mod 100) = 0) and ((y mod 400) <> 0))

                                                        then last:=true;

                                              end;

                                   else if d=31

                                           then last:=true;

                                  end;

                                  if last

                                     then begin

                                           d:=1;

                                           if m=12

                                           then begin

                                                 m:=1;

                                                 y1:=y+1;

                                                end

                                           else m1:=m+1;

                                          end

                                     else d1:=d+1;

                                     writeln(‘Следующий день: ‘);

                                     writeln(d1′,’, m1′,’, y1′,’);

                            END.

                          Сообщение отредактировано: Yagami — 03.11.10, 10:38

                          Guru

                          volvo877



                          Сообщ.
                          #12

                          ,
                          03.11.10, 10:45

                            Moderator

                            *******

                            Рейтинг (т): 878

                            Цитата Yagami @ 03.11.10, 10:35

                            writeln(d1, ‘,’, m1, ‘,’, y1);

                            У тебя этих запятых (разделяющих строки и числа) не было, были только строковые литералы для вывода запятой на экран.


                            Yagami



                            Сообщ.
                            #13

                            ,
                            03.11.10, 11:04

                              Исправил, спасибо. Почему-то выводит только день, а месяц и год — 0, 0.
                              Например:
                              Ввод: 10 2 1999
                              Вывод: 11,0,0

                              Guru

                              volvo877



                              Сообщ.
                              #14

                              ,
                              03.11.10, 11:48

                                Moderator

                                *******

                                Рейтинг (т): 878

                                Потому что:

                                Цитата

                                ExpandedWrap disabled

                                        if last

                                           then begin

                                                 d:=1;

                                                 if m=12

                                                 then begin

                                                       m:=1;

                                                       y1:=y+1;

                                                      end

                                                 else m1:=m+1;

                                                end

                                           else d1:=d+1;

                                И что? Ну, допустим, при Last = true в Y1 что-то хотя бы теоретически может записаться (правда произойдет это только если месяц = декабрь, и должен меняться год, но хоть когда-то). Но если Last = False — то даже теоретически этого не произойдет. У тебя по Else просто нет кода, изменяющего Y1 и M1.

                                Выходов 2:
                                1) либо в самом начале присвоить Y1 := Y; M1 := M; D1 := D, и дальше все оставить без изменений, как сейчас есть, если данные должны измениться, они изменятся, нет — останутся те, что ты ввел (это может быть нужно в случае, если ты не хочешь портить начальную дату)
                                2) либо работать вообще без Y1, M1, D1. То есть, изменять прямо Y, M, D и печатать их же.

                                Выбирать тебе.


                                Yagami



                                Сообщ.
                                #15

                                ,
                                03.11.10, 16:42

                                  volvo877
                                  Поправил, вроде.

                                  Сообщение отредактировано: Yagami — 14.11.10, 20:06

                                  0 пользователей читают эту тему (0 гостей и 0 скрытых пользователей)

                                  0 пользователей:

                                  • Предыдущая тема
                                  • Pascal
                                  • Следующая тема

                                  Рейтинг@Mail.ru

                                  [ Script execution time: 0,0449 ]   [ 15 queries used ]   [ Generated: 12.02.23, 18:39 GMT ]  

                                  Topic: FPC 3.2.0 or Higher on OpenBSD and Solaris  (Read 9158 times)

                                  Hi all.
                                  Is anyone willing to help me test some codes in the following compilers and OSes?
                                  FPC 3.2.0 or trunk, OpenBSD and Solaris.
                                  Thanks a lot. Anticipating your responses.  ;) ;)


                                  Logged


                                  julkas

                                  @Xor-el can you give more details about your code? Hardware requirements if any. VM or host OS? Thanks.


                                  Logged


                                  @Xor-el can you give more details about your code? Hardware requirements if any. VM or host OS? Thanks.

                                  @julkas, first of all, thanks for replying. I was starting to think that no one was willing to help.

                                  well, the code in question is just Unit Tests for a Library I have been working on for sometime.

                                  below are the supported operating systems.

                                  Windows => Tested Compiler => FPC and Delphi => Test Level => Very Extensive  :)

                                  Linux => Tested Compiler => FPC => Test Level => Very Extensive  :) (No access to Delphi Linux Compiler)

                                  Android => Tested Compiler => Delphi => Test Level => Very Extensive  :) (No access to FPC Android Compiler)

                                  Raspberry PI => Tested Compiler => FPC => Test Level => Very Limited

                                  Mac OS X => Tested Compiler => FPC and Delphi => Test Level => Very Limited

                                  iOS => Tested Compiler => Delphi => Test Level => Very Limited

                                  FreeBSD, NetBSD, OpenBSD, DragonBSD => Tested Compiler => FPC => Test Level => Untested (No access to the specified Oses)

                                  Solaris => Tested Compiler => FPC => Test Level => Untested (No access to the specified Os)

                                  Hardware/ software Requirements, none to be exact just a modern version of these operating systems.

                                  Compiler versions needed: FPC 3.2.0 or greater.

                                  you can find the library and it’s respective unit tests here

                                  https://github.com/Xor-el/CryptoLib4Pascal

                                  It’s dependencies can be found in the README.

                                  It will be very much appreciated if anyone can help run tests on those operating systems where limited or no testing has been done.

                                  « Last Edit: July 05, 2019, 03:03:54 am by Xor-el »


                                  Logged


                                  julkas

                                  Hardware/ software Requirements, none to be exact just a modern version of these operating systems.

                                  So, testing in VM (e.g OpenBSD on Windows 8 host) is OK?


                                  Logged


                                  Hardware/ software Requirements, none to be exact just a modern version of these operating systems.

                                  So, testing in VM (e.g OpenBSD on Windows 8 host) is OK?

                                  Yes, very ok.


                                  Logged



                                  Logged


                                  julkas

                                  I am planning make tests on FreeBSD 12 VM first.
                                  I will provide additional information about VM and Host CPU, Memory, …
                                  Regards.

                                  Testing requirements:
                                  Compiler — FPC 3.2.0
                                  Software deps — HashLib4Pascal, SimpleBaseLib4Pascal.
                                  Please confirm.

                                  « Last Edit: July 06, 2019, 10:56:52 am by julkas »


                                  Logged


                                  Testing requirements:
                                  Compiler — FPC 3.2.0
                                  Software deps — HashLib4Pascal, SimpleBaseLib4Pascal.
                                  Please confirm.

                                  yes and thanks once again.  :)


                                  Logged


                                  julkas

                                  Xor-el I cloned your repos from GitHub

                                  1. root@freebsd:~/bench# ls -al

                                  2. total 20

                                  3. drwxr-xr-x  5 root  wheel  512 Jul  8 09:01 .

                                  4. drwxr-xr-x  7 root  wheel  512 Jul  8 08:56 ..

                                  5. drwxr-xr-x  7 root  wheel  512 Jul  8 09:01 CryptoLib4Pascal

                                  6. drwxr-xr-x  7 root  wheel  512 Jul  8 09:00 HashLib4Pascal

                                  7. drwxr-xr-x  7 root  wheel  512 Jul  8 09:00 SimpleBaseLib4Pascal

                                  Output from FPC

                                  1. root@freebsd:~# fpc fpt.pas

                                  2. Free Pascal Compiler version 3.2.0-beta [2019/06/19] for x86_64

                                  3. Copyright (c) 1993-2018 by Florian Klaempfl and others

                                  4. Target OS: FreeBSD for x86-64

                                  5. Compiling fpt.pas

                                  6. Linking fpt

                                  7. 5 lines compiled, 0.2 sec

                                  Output from dmesg

                                  1. Copyright (c) 1992-2018 The FreeBSD Project.

                                  2. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994

                                  3.         The Regents of the University of California. All rights reserved.

                                  4. FreeBSD is a registered trademark of The FreeBSD Foundation.

                                  5. FreeBSD 12.0-RELEASE r341666 GENERIC amd64

                                  6. FreeBSD clang version 6.0.1 (tags/RELEASE_601/final 335540) (based on LLVM 6.0.1)

                                  7. VT(vga): text 80×25

                                  8. Hyper-V Version: 6.3.9600 [SP19]

                                  9.   Features=0xe7f<VPRUNTIME,TMREFCNT,SYNIC,SYNTM,APIC,HYPERCALL,VPINDEX,REFTSC,IDLE,TMFREQ>

                                  10.   PM Features=0x0 [C2]

                                  11.   Features3=0x17b2<DEBUG,XMMHC,IDLE,NUMA,TMFREQ,SYNCMC,CRASH,NPIEP>

                                  12. Timecounter «Hyper-V» frequency 10000000 Hz quality 2000

                                  13. CPU: Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz (3591.69-MHz K8-class CPU)

                                  14.   Origin=»GenuineIntel»  Id=0x306c3  Family=0x6  Model=0x3c  Stepping=3

                                  15.   Features=0xf83fbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,MMX,FXSR,SSE,SSE2,SS>

                                  16.   Features2=0xfeda3203<SSE3,PCLMULQDQ,SSSE3,FMA,CX16,PCID,SSE4.1,SSE4.2,MOVBE,POPCNT,AESNI,XSAVE,OSXSAVE,AVX,F16C,RDRAND,HV>

                                  17.   AMD Features=0x20100800<SYSCALL,NX,LM>

                                  18.   AMD Features2=0x21<LAHF,ABM>

                                  19.   Structured Extended Features=0x27a9<FSGSBASE,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,NFPUSG>

                                  20.   XSAVE Features=0x1<XSAVEOPT>

                                  21. Hypervisor: Origin = «Microsoft Hv»

                                  22. real memory  = 4294967296 (4096 MB)

                                  23. avail memory = 4123271168 (3932 MB)

                                  give me further instructions, please.


                                  Logged


                                  give me further instructions, please.

                                  Guess you should try to run the tests (CryptoLib4Pascal/CryptoLib.Tests) like FreePascal.Tests/CryptoLibConsole.lpr


                                  Logged


                                  « Last Edit: July 08, 2019, 02:27:28 pm by Xor-el »


                                  Logged


                                  julkas

                                  Hello @Xor-el
                                  I have compilation error. Here is compiler output. Any idea ?

                                  1. Free Pascal Compiler version 3.2.0-beta [2019/06/19] for x86_64

                                  2. Copyright (c) 1993-2018 by Florian Klaempfl and others

                                  3. Target OS: FreeBSD for x86-64

                                  4. Compiling CryptoLibConsole.lpr

                                  5. Compiling /root/bench/CryptoLib4Pascal/CryptoLib.Tests/src/Asn1/Asn1SequenceParserTests.pas

                                  6. Compiling /root/bench/CryptoLib4Pascal/CryptoLib/src/Math/ClpBigInteger.pas

                                  7. Compiling /root/bench/CryptoLib4Pascal/CryptoLib/src/Security/ClpSecureRandom.pas

                                  8. Compiling /root/bench/CryptoLib4Pascal/CryptoLib/src/Security/ClpDigestUtilities.pas

                                  9. Compiling /root/bench/CryptoLib4Pascal/CryptoLib/src/Asn1/Pkcs/ClpPkcsObjectIdentifiers.pas

                                  10. Compiling /root/bench/CryptoLib4Pascal/CryptoLib/src/Asn1/ClpAsn1Objects.pas

                                  11. Compiling /root/bench/CryptoLib4Pascal/CryptoLib/src/Utils/Encoders/ClpEncoders.pas

                                  12. Compiling /root/bench/SimpleBaseLib4Pascal/SimpleBaseLib/src/Bases/SbpBase16.pas

                                  13. Compiling /root/bench/SimpleBaseLib4Pascal/SimpleBaseLib/src/Utils/SbpSimpleBaseLibTypes.pas

                                  14. Compiling /root/bench/SimpleBaseLib4Pascal/SimpleBaseLib/src/Utils/SbpUtilities.pas

                                  15. Writing Resource String Table file: SbpBase16.rsj

                                  16. Compiling /root/bench/SimpleBaseLib4Pascal/SimpleBaseLib/src/Bases/SbpBase58.pas

                                  17. Compiling /root/bench/SimpleBaseLib4Pascal/SimpleBaseLib/src/Bases/SbpBase58Alphabet.pas

                                  18. Compiling /root/bench/SimpleBaseLib4Pascal/SimpleBaseLib/src/Bases/SbpEncodingAlphabet.pas

                                  19. Compiling /root/bench/SimpleBaseLib4Pascal/SimpleBaseLib/src/Interfaces/SbpIEncodingAlphabet.pas

                                  20. Writing Resource String Table file: SbpEncodingAlphabet.rsj

                                  21. Compiling /root/bench/SimpleBaseLib4Pascal/SimpleBaseLib/src/Interfaces/SbpIBase58Alphabet.pas

                                  22. Compiling /root/bench/SimpleBaseLib4Pascal/SimpleBaseLib/src/Interfaces/SbpIBase58.pas

                                  23. Writing Resource String Table file: SbpBase58.rsj

                                  24. Compiling /root/bench/SimpleBaseLib4Pascal/SimpleBaseLib/src/Bases/SbpBase64.pas

                                  25. Compiling /root/bench/SimpleBaseLib4Pascal/SimpleBaseLib/src/Utils/SbpBits.pas

                                  26. Compiling /root/bench/SimpleBaseLib4Pascal/SimpleBaseLib/src/Bases/SbpBase64Alphabet.pas

                                  27. Compiling /root/bench/SimpleBaseLib4Pascal/SimpleBaseLib/src/Interfaces/SbpIBase64Alphabet.pas

                                  28. Compiling /root/bench/SimpleBaseLib4Pascal/SimpleBaseLib/src/Interfaces/SbpIBase64.pas

                                  29. Writing Resource String Table file: SbpBase64.rsj

                                  30. Compiling /root/bench/CryptoLib4Pascal/CryptoLib/src/Utils/ClpStringUtils.pas

                                  31. Compiling /root/bench/CryptoLib4Pascal/CryptoLib/src/Utils/ClpConverters.pas

                                  32. Compiling /root/bench/CryptoLib4Pascal/CryptoLib/src/Utils/ClpBitConverter.pas

                                  33. Writing Resource String Table file: ClpConverters.rsj

                                  34. Compiling /root/bench/CryptoLib4Pascal/CryptoLib/src/Interfaces/ClpIAsn1Objects.pas

                                  35. Compiling /root/bench/CryptoLib4Pascal/CryptoLib/src/Asn1/ClpOidTokenizer.pas

                                  36. Compiling /root/bench/CryptoLib4Pascal/CryptoLib/src/Interfaces/ClpIOidTokenizer.pas

                                  37. Writing Resource String Table file: ClpAsn1Objects.rsj

                                  38. Compiling /root/bench/CryptoLib4Pascal/CryptoLib/src/Asn1/RossStandart/ClpRosstandartObjectIdentifiers.pas

                                  39. Compiling /root/bench/CryptoLib4Pascal/CryptoLib/src/Asn1/Oiw/ClpOiwObjectIdentifiers.pas

                                  40. Compiling /root/bench/CryptoLib4Pascal/CryptoLib/src/Asn1/Nist/ClpNistObjectIdentifiers.pas

                                  41. Compiling /root/bench/CryptoLib4Pascal/CryptoLib/src/Asn1/Misc/ClpMiscObjectIdentifiers.pas

                                  42. Compiling /root/bench/CryptoLib4Pascal/CryptoLib/src/Asn1/TeleTrust/ClpTeleTrusTObjectIdentifiers.pas

                                  43. Compiling /root/bench/CryptoLib4Pascal/CryptoLib/src/Asn1/CryptoPro/ClpCryptoProObjectIdentifiers.pas

                                  44. Writing Resource String Table file: ClpDigestUtilities.rsj

                                  45. Compiling /root/bench/CryptoLib4Pascal/CryptoLib/src/Crypto/Prng/ClpCryptoApiRandomGenerator.pas

                                  46. Compiling /root/bench/CryptoLib4Pascal/CryptoLib/src/Interfaces/ClpIRandomNumberGenerator.pas

                                  47. Compiling /root/bench/CryptoLib4Pascal/CryptoLib/src/Utils/Rng/ClpRandomNumberGenerator.pas

                                  48. Compiling /root/bench/CryptoLib4Pascal/CryptoLib/src/Utils/Randoms/ClpOSRandom.pas

                                  49. ClpOSRandom.pas(328,1) Fatal: Syntax error, «IMPLEMENTATION» expected but «const char» found

                                  50. Fatal: Compilation aborted

                                  51. Error: /usr/local/bin/ppcx64 returned an error exitcode


                                  Logged


                                  Hello @Xor-el
                                  I have compilation error. Here is compiler output. Any idea ?

                                  1. Free Pascal Compiler version 3.2.0-beta [2019/06/19] for x86_64

                                  2. Copyright (c) 1993-2018 by Florian Klaempfl and others

                                  3. Target OS: FreeBSD for x86-64

                                  4. Compiling CryptoLibConsole.lpr

                                  5. Compiling /root/bench/CryptoLib4Pascal/CryptoLib.Tests/src/Asn1/Asn1SequenceParserTests.pas

                                  6. Compiling /root/bench/CryptoLib4Pascal/CryptoLib/src/Math/ClpBigInteger.pas

                                  7. Compiling /root/bench/CryptoLib4Pascal/CryptoLib/src/Security/ClpSecureRandom.pas

                                  8. Compiling /root/bench/CryptoLib4Pascal/CryptoLib/src/Security/ClpDigestUtilities.pas

                                  9. Compiling /root/bench/CryptoLib4Pascal/CryptoLib/src/Asn1/Pkcs/ClpPkcsObjectIdentifiers.pas

                                  10. Compiling /root/bench/CryptoLib4Pascal/CryptoLib/src/Asn1/ClpAsn1Objects.pas

                                  11. Compiling /root/bench/CryptoLib4Pascal/CryptoLib/src/Utils/Encoders/ClpEncoders.pas

                                  12. Compiling /root/bench/SimpleBaseLib4Pascal/SimpleBaseLib/src/Bases/SbpBase16.pas

                                  13. Compiling /root/bench/SimpleBaseLib4Pascal/SimpleBaseLib/src/Utils/SbpSimpleBaseLibTypes.pas

                                  14. Compiling /root/bench/SimpleBaseLib4Pascal/SimpleBaseLib/src/Utils/SbpUtilities.pas

                                  15. Writing Resource String Table file: SbpBase16.rsj

                                  16. Compiling /root/bench/SimpleBaseLib4Pascal/SimpleBaseLib/src/Bases/SbpBase58.pas

                                  17. Compiling /root/bench/SimpleBaseLib4Pascal/SimpleBaseLib/src/Bases/SbpBase58Alphabet.pas

                                  18. Compiling /root/bench/SimpleBaseLib4Pascal/SimpleBaseLib/src/Bases/SbpEncodingAlphabet.pas

                                  19. Compiling /root/bench/SimpleBaseLib4Pascal/SimpleBaseLib/src/Interfaces/SbpIEncodingAlphabet.pas

                                  20. Writing Resource String Table file: SbpEncodingAlphabet.rsj

                                  21. Compiling /root/bench/SimpleBaseLib4Pascal/SimpleBaseLib/src/Interfaces/SbpIBase58Alphabet.pas

                                  22. Compiling /root/bench/SimpleBaseLib4Pascal/SimpleBaseLib/src/Interfaces/SbpIBase58.pas

                                  23. Writing Resource String Table file: SbpBase58.rsj

                                  24. Compiling /root/bench/SimpleBaseLib4Pascal/SimpleBaseLib/src/Bases/SbpBase64.pas

                                  25. Compiling /root/bench/SimpleBaseLib4Pascal/SimpleBaseLib/src/Utils/SbpBits.pas

                                  26. Compiling /root/bench/SimpleBaseLib4Pascal/SimpleBaseLib/src/Bases/SbpBase64Alphabet.pas

                                  27. Compiling /root/bench/SimpleBaseLib4Pascal/SimpleBaseLib/src/Interfaces/SbpIBase64Alphabet.pas

                                  28. Compiling /root/bench/SimpleBaseLib4Pascal/SimpleBaseLib/src/Interfaces/SbpIBase64.pas

                                  29. Writing Resource String Table file: SbpBase64.rsj

                                  30. Compiling /root/bench/CryptoLib4Pascal/CryptoLib/src/Utils/ClpStringUtils.pas

                                  31. Compiling /root/bench/CryptoLib4Pascal/CryptoLib/src/Utils/ClpConverters.pas

                                  32. Compiling /root/bench/CryptoLib4Pascal/CryptoLib/src/Utils/ClpBitConverter.pas

                                  33. Writing Resource String Table file: ClpConverters.rsj

                                  34. Compiling /root/bench/CryptoLib4Pascal/CryptoLib/src/Interfaces/ClpIAsn1Objects.pas

                                  35. Compiling /root/bench/CryptoLib4Pascal/CryptoLib/src/Asn1/ClpOidTokenizer.pas

                                  36. Compiling /root/bench/CryptoLib4Pascal/CryptoLib/src/Interfaces/ClpIOidTokenizer.pas

                                  37. Writing Resource String Table file: ClpAsn1Objects.rsj

                                  38. Compiling /root/bench/CryptoLib4Pascal/CryptoLib/src/Asn1/RossStandart/ClpRosstandartObjectIdentifiers.pas

                                  39. Compiling /root/bench/CryptoLib4Pascal/CryptoLib/src/Asn1/Oiw/ClpOiwObjectIdentifiers.pas

                                  40. Compiling /root/bench/CryptoLib4Pascal/CryptoLib/src/Asn1/Nist/ClpNistObjectIdentifiers.pas

                                  41. Compiling /root/bench/CryptoLib4Pascal/CryptoLib/src/Asn1/Misc/ClpMiscObjectIdentifiers.pas

                                  42. Compiling /root/bench/CryptoLib4Pascal/CryptoLib/src/Asn1/TeleTrust/ClpTeleTrusTObjectIdentifiers.pas

                                  43. Compiling /root/bench/CryptoLib4Pascal/CryptoLib/src/Asn1/CryptoPro/ClpCryptoProObjectIdentifiers.pas

                                  44. Writing Resource String Table file: ClpDigestUtilities.rsj

                                  45. Compiling /root/bench/CryptoLib4Pascal/CryptoLib/src/Crypto/Prng/ClpCryptoApiRandomGenerator.pas

                                  46. Compiling /root/bench/CryptoLib4Pascal/CryptoLib/src/Interfaces/ClpIRandomNumberGenerator.pas

                                  47. Compiling /root/bench/CryptoLib4Pascal/CryptoLib/src/Utils/Rng/ClpRandomNumberGenerator.pas

                                  48. Compiling /root/bench/CryptoLib4Pascal/CryptoLib/src/Utils/Randoms/ClpOSRandom.pas

                                  49. ClpOSRandom.pas(328,1) Fatal: Syntax error, «IMPLEMENTATION» expected but «const char» found

                                  50. Fatal: Compilation aborted

                                  51. Error: /usr/local/bin/ppcx64 returned an error exitcode

                                  Hi @julkas, I just pushed a fix for the compilation error you are getting.
                                  can you please pull the CryptoLib4Pascal Repo again or in your current source file, replace line 328, currently this

                                  1. procedure arc4random_buf(bytes: PByte; count: LongWord); cdecl;

                                  2. external; ‘c’ name ‘arc4random_buf’;

                                   with this

                                  1. procedure arc4random_buf(bytes: PByte; count: LongWord); cdecl;

                                  2. external ‘c’ name ‘arc4random_buf’;

                                  thanks.


                                  Logged


                                  julkas

                                  Compiler output after pull. May be {$mode …} is missing ?

                                  1. Compiling /root/bench/CryptoLib4Pascal/CryptoLib.Tests/src/CryptoLibTestBase.pas

                                  2. CryptoLibTestBase.pas(23,24) Error: Identifier not found «class»

                                  3. CryptoLibTestBase.pas(23,30) Error: Error in type definition

                                  4. CryptoLibTestBase.pas(23,30) Fatal: Syntax error, «;» expected but «identifier ABSTRACT» found

                                  5. Fatal: Compilation aborted

                                  6. Error: /usr/local/bin/ppcx64 returned an error exitcode

                                  « Last Edit: July 09, 2019, 10:22:00 am by julkas »


                                  Logged


                                  Compiler output after pull.

                                  1. Compiling /root/bench/CryptoLib4Pascal/CryptoLib.Tests/src/CryptoLibTestBase.pas

                                  2. CryptoLibTestBase.pas(23,24) Error: Identifier not found «class»

                                  3. CryptoLibTestBase.pas(23,30) Error: Error in type definition

                                  4. CryptoLibTestBase.pas(23,30) Fatal: Syntax error, «;» expected but «identifier ABSTRACT» found

                                  5. Fatal: Compilation aborted

                                  6. Error: /usr/local/bin/ppcx64 returned an error exitcode

                                  Will look into the error you are getting now but can you please confirm that the CryptoLib4PascalPackage.lpk compiles fine?


                                  Logged


                                  Понравилась статья? Поделить с друзьями:

                                  Читайте также:

                                • Fatal syntax error begin expected but end of file found lazarus
                                • Fatal string manager failed to initialize properly как исправить ошибку
                                • Fatal string manager failed to initialize properly red alert 2 ошибка fatal
                                • Fatal simulation error encountered proteus 8
                                • Fatal server error ee xf86openconsole switching vt failed

                                • 0 0 голоса
                                  Рейтинг статьи
                                  Подписаться
                                  Уведомить о
                                  guest

                                  0 комментариев
                                  Старые
                                  Новые Популярные
                                  Межтекстовые Отзывы
                                  Посмотреть все комментарии