mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
[GH-ISSUE #110] error: use of undeclared identifier #56
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/ultimatepp#56
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @erusyd on GitHub (Oct 18, 2022).
Original GitHub issue: https://github.com/ultimatepp/ultimatepp/issues/110
Recent U++ shows errors when opening example codes. For example, when open the AddressBook example:

So what does it mean?
@mirek-fidler commented on GitHub (Oct 18, 2022):
Can you please specify the platform?
I am afraid there are still some problems in Linux with libclang, is this
Linux? If yes, what libclang version?
(Note that this seems to work in windows)
Mirek
On Tue, Oct 18, 2022 at 7:56 AM Song Yadong @.***>
wrote:
@erusyd commented on GitHub (Oct 18, 2022):
I use Linux Mint 20.3, libclang-10-dev (1:10.0.0-4ubuntu1).
@mirek-fidler commented on GitHub (Oct 26, 2022):
I believe this is now fixed in master. Please check.
@erusyd commented on GitHub (Oct 27, 2022):
It works OK now. Thanks.
@erusyd commented on GitHub (May 17, 2023):
It seems that this problem arises again in recent builds.
@erusyd commented on GitHub (May 17, 2023):
System info: Linux Mint 21.1 Cinnamon
@mirek-fidler commented on GitHub (May 17, 2023):
It works fine for me (latest ubuntu mate).
This kind of problem is usually a sign of broken includes. There is an option in Settings
which (among other things) adds a couple of menu items to Assist menu. Of these, "Current file parse errors" might be interesting to check, first place to look for something... Can you attach that here?
@erusyd commented on GitHub (May 18, 2023):
Fresh install, open AddressBook example:

It shows parse errors, but the build is OK. My Assist Settings is:

Build methods:

theide.log shows it uses llvm-15:
09:39:05:095 INFO LoadLibClang0(): libclang path: "/usr/lib/llvm-15/lib/libclang.so"
Where can I get "Current file parse errors"?
By the way, when I turn on "Assist diagnostics (verbose mode)" in Settings, tool bar only add vertical line occupation:

@mirek-fidler commented on GitHub (May 18, 2023):
Hi,
"Current file parse errors" are at the end of the "Assist" menu (when
Assist diagnostics is active).
What is your clang --version ? (Possibly there is incompatibility between
libclang and clang installed).
Mirek
On Thu, May 18, 2023 at 3:58 AM Song Yadong @.***>
wrote:
@erusyd commented on GitHub (May 18, 2023):
My clang --version is Ubuntu clang version 14.0.0-1ubuntu1. I have both llvm-14 and llvm-15 installed.
Current file parse errors:
ERROR: /../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/cstdint (52): no member named 'int_fast8_t' in the global namespace
NOTE: /home/syd/opt/upp/examples/AddressBook/AddressBook.cpp (1): in file included from /home/syd/opt/upp/examples/AddressBook/AddressBook.cpp:1:
NOTE: /home/syd/opt/upp/examples/AddressBook/AddressBook.cpp (4): in file included from /home/syd/opt/upp/examples/AddressBook/AddressBook.cpp:4:
NOTE: /home/syd/opt/upp/uppsrc/CtrlLib/CtrlLib.h (4): in file included from /home/syd/opt/upp/uppsrc/CtrlLib/CtrlLib.h:4:
NOTE: /home/syd/opt/upp/uppsrc/CtrlCore/CtrlCore.h (4): in file included from /home/syd/opt/upp/uppsrc/CtrlCore/CtrlCore.h:4:
NOTE: /home/syd/opt/upp/uppsrc/RichText/RichText.h (4): in file included from /home/syd/opt/upp/uppsrc/RichText/RichText.h:4:
NOTE: /home/syd/opt/upp/uppsrc/Draw/Draw.h (6): in file included from /home/syd/opt/upp/uppsrc/Draw/Draw.h:6:
NOTE: /home/syd/opt/upp/uppsrc/Core/Core.h (252): in file included from /home/syd/opt/upp/uppsrc/Core/Core.h:252:
NOTE: /../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/string (40): in file included from /../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/string:40:
NOTE: /../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/char_traits.h (731): in file included from /../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/char_traits.h:731:
ERROR: /../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/cstdint (53): no member named 'int_fast16_t' in the global namespace
ERROR: /../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/cstdint (54): no member named 'int_fast32_t' in the global namespace
ERROR: /../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/cstdint (55): no member named 'int_fast64_t' in the global namespace
ERROR: /../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/cstdint (57): no member named 'int_least8_t' in the global namespace
ERROR: /../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/cstdint (58): no member named 'int_least16_t' in the global namespace
ERROR: /../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/cstdint (59): no member named 'int_least32_t' in the global namespace
ERROR: /../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/cstdint (60): no member named 'int_least64_t' in the global namespace
ERROR: /../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/cstdint (62): no member named 'intmax_t' in the global namespace
ERROR: /../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/cstdint (70): no member named 'uint_fast8_t' in the global namespace
ERROR: /../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/cstdint (71): no member named 'uint_fast16_t' in the global namespace
ERROR: /../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/cstdint (72): no member named 'uint_fast32_t' in the global namespace
ERROR: /../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/cstdint (73): no member named 'uint_fast64_t' in the global namespace
ERROR: /../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/cstdint (75): no member named 'uint_least8_t' in the global namespace
ERROR: /../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/cstdint (76): no member named 'uint_least16_t' in the global namespace
ERROR: /../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/cstdint (77): no member named 'uint_least32_t' in the global namespace
ERROR: /../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/cstdint (78): no member named 'uint_least64_t' in the global namespace
ERROR: /../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/cstdint (80): no member named 'uintmax_t' in the global namespace
ERROR: /../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/cstdint (81): no member named 'uintptr_t' in the global namespace
ERROR: /home/syd/opt/upp/examples/AddressBook/AddressBook.lay (1): no type named 'Size' in namespace 'Upp'
NOTE: /home/syd/opt/upp/examples/AddressBook/AddressBook.cpp (10): in file included from /home/syd/opt/upp/examples/AddressBook/AddressBook.cpp:10:
NOTE: /home/syd/opt/upp/uppsrc/CtrlCore/lay.h (2): in file included from /home/syd/opt/upp/uppsrc/CtrlCore/lay.h:2:
NOTE: /home/syd/opt/upp/uppsrc/CtrlCore/lay0.h (22): in file included from /home/syd/opt/upp/uppsrc/CtrlCore/lay0.h:22:
NOTE: /home/syd/opt/upp/uppsrc/CtrlCore/lay0.h (17): expanded from macro 'LAYOUT'
ERROR: /home/syd/opt/upp/examples/AddressBook/AddressBook.lay (7): no type named 'Size' in namespace 'Upp'
NOTE: /home/syd/opt/upp/examples/AddressBook/AddressBook.cpp (10): in file included from /home/syd/opt/upp/examples/AddressBook/AddressBook.cpp:10:
NOTE: /home/syd/opt/upp/uppsrc/CtrlCore/lay.h (2): in file included from /home/syd/opt/upp/uppsrc/CtrlCore/lay.h:2:
NOTE: /home/syd/opt/upp/uppsrc/CtrlCore/lay0.h (22): in file included from /home/syd/opt/upp/uppsrc/CtrlCore/lay0.h:22:
NOTE: /home/syd/opt/upp/uppsrc/CtrlCore/lay0.h (17): expanded from macro 'LAYOUT'
ERROR: /home/syd/opt/upp/examples/AddressBook/AddressBook.lay (20): no type named 'Size' in namespace 'Upp'
NOTE: /home/syd/opt/upp/examples/AddressBook/AddressBook.cpp (10): in file included from /home/syd/opt/upp/examples/AddressBook/AddressBook.cpp:10:
NOTE: /home/syd/opt/upp/uppsrc/CtrlCore/lay.h (2): in file included from /home/syd/opt/upp/uppsrc/CtrlCore/lay.h:2:
NOTE: /home/syd/opt/upp/uppsrc/CtrlCore/lay0.h (22): in file included from /home/syd/opt/upp/uppsrc/CtrlCore/lay0.h:22:
NOTE: /home/syd/opt/upp/uppsrc/CtrlCore/lay0.h (17): expanded from macro 'LAYOUT'
ERROR: /home/syd/opt/upp/examples/AddressBook/AddressBook.cpp (41): use of undeclared identifier 'tab'
ERROR: /home/syd/opt/upp/examples/AddressBook/AddressBook.cpp (42): use of undeclared identifier 'tab'
ERROR: /home/syd/opt/upp/examples/AddressBook/AddressBook.cpp (46): use of undeclared identifier 'array'
ERROR: /home/syd/opt/upp/examples/AddressBook/AddressBook.cpp (47): use of undeclared identifier 'array'
ERROR: /home/syd/opt/upp/examples/AddressBook/AddressBook.cpp (48): use of undeclared identifier 'array'
ERROR: /home/syd/opt/upp/examples/AddressBook/AddressBook.cpp (49): use of undeclared identifier 'array'
ERROR: /home/syd/opt/upp/examples/AddressBook/AddressBook.cpp (68): use of undeclared identifier 'menu'
ERROR: /home/syd/opt/upp/examples/AddressBook/AddressBook.cpp (69): no viable conversion from '(lambda at /home/syd/opt/upp/examples/AddressBook/AddressBook.cpp:69:19)' to 'const Function<void (Upp::Bar &)>'
NOTE: /home/syd/opt/upp/uppsrc/Core/Function.h (56): candidate constructor [with F = (lambda at /home/syd/opt/upp/examples/AddressBook/AddressBook.cpp:69:19)]
NOTE: /home/syd/opt/upp/uppsrc/Core/Function.h (53): candidate constructor not viable: no known conversion from '(lambda at /home/syd/opt/upp/examples/AddressBook/AddressBook.cpp:69:19)' to 'Upp::CNULLer' for 1st argument
NOTE: /home/syd/opt/upp/uppsrc/Core/Function.h (54): candidate constructor not viable: no known conversion from '(lambda at /home/syd/opt/upp/examples/AddressBook/AddressBook.cpp:69:19)' to 'const Upp::Nuller &' for 1st argument
NOTE: /home/syd/opt/upp/uppsrc/Core/Function.h (58): candidate constructor not viable: no known conversion from '(lambda at /home/syd/opt/upp/examples/AddressBook/AddressBook.cpp:69:19)' to 'const Upp::Function<void (Upp::Bar &)> &' for 1st argument
NOTE: /home/syd/opt/upp/uppsrc/Core/Function.h (61): candidate constructor not viable: no known conversion from '(lambda at /home/syd/opt/upp/examples/AddressBook/AddressBook.cpp:69:19)' to 'Upp::Function<void (Upp::Bar &)> &&' for 1st argument
NOTE: /home/syd/opt/upp/uppsrc/CtrlLib/Bar.h (165): passing argument to parameter 'submenu' here
ERROR: /home/syd/opt/upp/examples/AddressBook/AddressBook.cpp (92): use of undeclared identifier 'array'
ERROR: /home/syd/opt/upp/examples/AddressBook/AddressBook.cpp (93): use of undeclared identifier 'array'
ERROR: /home/syd/opt/upp/examples/AddressBook/AddressBook.cpp (100): use of undeclared identifier 'array'
ERROR: /home/syd/opt/upp/examples/AddressBook/AddressBook.cpp (101): use of undeclared identifier 'array'
ERROR: /home/syd/opt/upp/examples/AddressBook/AddressBook.cpp (102): use of undeclared identifier 'array'
ERROR: /home/syd/opt/upp/examples/AddressBook/AddressBook.cpp (103): use of undeclared identifier 'array'
ERROR: /home/syd/opt/upp/examples/AddressBook/AddressBook.cpp (104): use of undeclared identifier 'array'
ERROR: /home/syd/opt/upp/examples/AddressBook/AddressBook.cpp (110): no viable conversion from 'const Upp::String' to 'const char *'
ERROR: (0): too many errors emitted, stopping now
@mirek-fidler commented on GitHub (May 18, 2023):
Well, I think this might be incompatibility between llvm 15 and clang 14
headers (we are using header paths as reported by clang, not sure there is
any other way).
Theide has --clangdir parameter. Can you try something like
theide --clangdir /usr/lib/llvm-14/lib
(possibly replace the path to llvm14 libclang.so)
Also, just to be sure, what does
llvm-config --libdir
say?
On Thu, May 18, 2023 at 10:26 AM Song Yadong @.***>
wrote:
@erusyd commented on GitHub (May 18, 2023):
theide --clangdir /usr/lib/llvm-14/lib works fine now.
@mirek-fidler commented on GitHub (May 18, 2023):
Perfect, now we know what is the issue.
I will try to change the initialisation code to prefer llvm that matches
clang --version. Please stay tuned for testing...
On Thu, May 18, 2023 at 2:58 PM Song Yadong @.***>
wrote:
@mirek-fidler commented on GitHub (May 19, 2023):
Can you try either master or
https://sourceforge.net/projects/upp/upload/upp/2023.1rc2/
?
(These should prefer libclang based on clang --version)
On Thu, May 18, 2023 at 3:03 PM Mirek Fidler @.***> wrote:
@erusyd commented on GitHub (May 19, 2023):
I use git clone of master, it works fine.