Part Number: MCU-PLUS-SDK-AM273X
Hi team,
I am compiling a simple cpp program (given below) involving the "complex" in it.
#include <iostream>
#include <complex>
int main() {
std::complex<double> num1(2.0, 3.0);
std::complex<double> num2(4.0, -1.0);
std::cout << "num1: " << num1 << std::endl;
std::cout << "num2: " << num2 << std::endl;
std::cout << "num1 + num2: " << num1 + num2 << std::endl;
std::cout << "num1 - num2: " << num1 - num2 << std::endl;
std::cout << "num1 * num2: " << num1 * num2 << std::endl;
std::cout << "num1 / num2: " << num1 / num2 << std::endl;
return 0;
}
I have compiled it with 2 different commands,
Command 1:
/home/kowshik/ti/ti-cgt-armllvm_2.1.2.LTS/bin/tiarmclang -DOPENCV_ALLOCATOR_STATS_COUNTER_TYPE=int -DOPENCV_DISABLE_THREAD_SUPPORT=1 -DOPENCV_HAVE_FILESYSTEM_SUPPORT=0 -D_USE_MATH_DEFINES -D__OPENCV_BUILD=1 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/kowshik/Desktop/opencv_porting/opencv_with_tiarmclang/build -I/home/kowshik/Desktop/opencv_porting/opencv_with_tiarmclang/modules/core/include -I/home/kowshik/Desktop/opencv_porting/opencv_with_tiarmclang/build/modules/core -I/home/kowshik/Desktop/opencv_porting/opencv_with_tiarmclang/3rdparty/zlib -I/home/kowshik/Desktop/opencv_porting/opencv_with_tiarmclang/build/3rdparty/zlib -w --specs=nosys.specs -frtti -fshort-enums -fshort-wchar -Wno-unknown-warning-option -Wno-unused-command-line-argument -Wno-suggest-override -mfpu=vfpv3-d16 -Wno-narrowing -fno-pie -fno-pic -fpermissive -mcpu=cortex-r5 -mthumb -mfloat-abi=hard --std=c++11 -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winconsistent-missing-override -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -Wno-deprecated-enum-enum-conversion -Wno-deprecated-anon-enum-enum-conversion -fdiagnostics-show-option -Qunused-arguments -ffunction-sections -fdata-sections -fvisibility=hidden -fvisibility-inlines-hidden -Ofast -DNDEBUG -fPIC -std=c++11 -o /home/kowshik/Desktop/armclang_error/properly_compiled.obj -c /home/kowshik/Desktop/armclang_error/hi.cpp
When the above command is used the compile is successful and the obj file is created. However when the command-2 is used with a little addition of path to a bunch of header files as I attached, I get the error shown below
Command -2
/home/kowshik/ti/ti-cgt-armllvm_2.1.2.LTS/bin/tiarmclang -DOPENCV_ALLOCATOR_STATS_COUNTER_TYPE=int -DOPENCV_DISABLE_THREAD_SUPPORT=1 -DOPENCV_HAVE_FILESYSTEM_SUPPORT=0 -D_USE_MATH_DEFINES -D__OPENCV_BUILD=1 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/kowshik/Desktop/opencv_porting/opencv_with_tiarmclang/build -I/home/kowshik/Desktop/opencv_porting/opencv_with_tiarmclang/modules/core/include -I/home/kowshik/Desktop/opencv_porting/opencv_with_tiarmclang/build/modules/core -I/home/kowshik/Desktop/opencv_porting/opencv_with_tiarmclang/3rdparty/zlib -I/home/kowshik/Desktop/opencv_porting/opencv_with_tiarmclang/build/3rdparty/zlib -w --specs=nosys.specs -frtti -fshort-enums -fshort-wchar -Wno-unknown-warning-option -Wno-unused-command-line-argument -Wno-suggest-override -mfpu=vfpv3-d16 -Wno-narrowing -fno-pie -fno-pic -fpermissive -mcpu=cortex-r5 -mthumb -mfloat-abi=hard --std=c++11 -I/home/kowshik/Desktop/armclang_error/fake_root/include -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winconsistent-missing-override -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -Wno-deprecated-enum-enum-conversion -Wno-deprecated-anon-enum-enum-conversion -fdiagnostics-show-option -Qunused-arguments -ffunction-sections -fdata-sections -fvisibility=hidden -fvisibility-inlines-hidden -Ofast -DNDEBUG -fPIC -std=c++11 -o /home/kowshik/Desktop/armclang_error/hi.cpp.obj -c /home/kowshik/Desktop/armclang_error/hi.cpp
The only change from command-1 and command-2 is the highlighted folder inclusion. I immediately get the below error,
Error Occurred
/home/kowshik/ti/ti-cgt-armllvm_2.1.2.LTS/include/c++/v1/__locale:136:20: error: use of undeclared identifier 'LC_COLLATE_MASK'
collate = LC_COLLATE_MASK,
^
/home/kowshik/ti/ti-cgt-armllvm_2.1.2.LTS/include/c++/v1/__locale:137:20: error: use of undeclared identifier 'LC_CTYPE_MASK'
ctype = LC_CTYPE_MASK,
^
/home/kowshik/ti/ti-cgt-armllvm_2.1.2.LTS/include/c++/v1/__locale:138:20: error: use of undeclared identifier 'LC_MONETARY_MASK'
monetary = LC_MONETARY_MASK,
^
/home/kowshik/ti/ti-cgt-armllvm_2.1.2.LTS/include/c++/v1/__locale:139:20: error: use of undeclared identifier 'LC_NUMERIC_MASK'
numeric = LC_NUMERIC_MASK,
^
/home/kowshik/ti/ti-cgt-armllvm_2.1.2.LTS/include/c++/v1/__locale:140:20: error: use of undeclared identifier 'LC_TIME_MASK'
time = LC_TIME_MASK,
^
/home/kowshik/ti/ti-cgt-armllvm_2.1.2.LTS/include/c++/v1/__locale:141:20: error: use of undeclared identifier 'LC_MESSAGES_MASK'
messages = LC_MESSAGES_MASK,
^
/home/kowshik/ti/ti-cgt-armllvm_2.1.2.LTS/include/c++/v1/__locale:356:5: error: unknown type name 'locale_t'; did you mean 'locale'?
locale_t __l;
^
/home/kowshik/ti/ti-cgt-armllvm_2.1.2.LTS/include/c++/v1/__locale:125:24: note: 'locale' declared here
class _LIBCPP_TYPE_VIS locale
^
/home/kowshik/ti/ti-cgt-armllvm_2.1.2.LTS/include/c++/v1/__locale:376:5: error: unknown type name 'locale_t'; did you mean 'locale'?
locale_t __l;
^
/home/kowshik/ti/ti-cgt-armllvm_2.1.2.LTS/include/c++/v1/__locale:125:24: note: 'locale' declared here
class _LIBCPP_TYPE_VIS locale
^
/home/kowshik/ti/ti-cgt-armllvm_2.1.2.LTS/include/c++/v1/__locale:796:5: error: unknown type name 'locale_t'; did you mean 'locale'?
locale_t __l;
^
/home/kowshik/ti/ti-cgt-armllvm_2.1.2.LTS/include/c++/v1/__locale:125:24: note: 'locale' declared here
class _LIBCPP_TYPE_VIS locale
^
/home/kowshik/ti/ti-cgt-armllvm_2.1.2.LTS/include/c++/v1/__locale:815:5: error: unknown type name 'locale_t'; did you mean 'locale'?
locale_t __l;
^
/home/kowshik/ti/ti-cgt-armllvm_2.1.2.LTS/include/c++/v1/__locale:125:24: note: 'locale' declared here
class _LIBCPP_TYPE_VIS locale
^
/home/kowshik/ti/ti-cgt-armllvm_2.1.2.LTS/include/c++/v1/__locale:1049:5: error: unknown type name 'locale_t'; did you mean 'locale'?
locale_t __l;
^
/home/kowshik/ti/ti-cgt-armllvm_2.1.2.LTS/include/c++/v1/__locale:125:24: note: 'locale' declared here
class _LIBCPP_TYPE_VIS locale
^
11 errors generated.
I am attaching the files I am using, simply unzip these and run the above commands and to analyze the issue more deeply.
I also came across this article where it says about how to submit a compiler use-case. I have also done this and I am attaching this file as well.
pre-processed output after adding the "-E -C" flags --> cv_armclang_pre_processed_output.txt
Files I've used for this test -->https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/908/armclang_5F00_error.7z
