外部库使用和工程相同的编译工具及参数,如下:
但是在调用API的时候会如下报错:
请问出现这种情况是还有哪些编译参数没有同步导致的吗?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi Currin,
To assign your query to an expert, can you please provide more information:
1.. compiler tool, and OS
2. external library or APIs
If the APIs are compiled with different attributes, for example RW or RO static data is allowed to be addressed absolutely, you will get error if your project only allow PC-relative addressing. I am not an expert of compiler/linker.
Hi QJ Wang,
1. The compiler tool i used is ti-cgt-armllvm_3.2.0.LTS inside ccs1250, and my OS is Windows10.
2. The external library or APIs are some Back-end algorithm we custom write. The compile param is as same as mmw project like picture above.
Thanks for your reply.
Hi -- The values used for those build attributes are correct with respect to what the tiarmclang compiler supports by default; you would only expect to see incompatibility errors if your project was being built to expect PC-relative addressing, as QJ states. This would be the case if your project was being built with "-fpic" to enable position independent code, but "-fpic" is not included in the list of options you provide. Can you double-check the build of your project to make sure that "-fpic" is never included in the list of build options?
Also, do you see the same errors if you remove "-flto" from the compile and link step?
Thanks!
Hi Alan,
I have checked the compile params, the -fpic option was indeed added. When I remove this option the program compiled success and run fine.
Thanks!