- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Now there are two static libraries: [lib1.a] [lib2.a]
lib1.a
int testfun(void)
{
return 1;
}
lib2.a
int testfun(void)
{
return 2;
}
main.h
extern int testfun(void);
main.c
#include "main.h"
int main(void)
{
volatile int a;
a = testfun();
return 0;
}
How to determine the value of [a] in the above code?
In other words, how to compile the specified static library in ModusToolbox.
Solved! Go to Solution.
- Labels:
-
ModusToolbox Bluetooth SDK
- Tags:
- modustoolbox 2.0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
The example that you provided should throw a linker error since you have two functions having the same names in two different files.
In the document https://www.cypress.com/file/520251/download
Page 36, section 4.5.1.5, There is an explanation on how you can include two different source files in a different component folder and then you can configure your makefile to use the one you require.
Best Regards,
Rakshith
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
The example that you provided should throw a linker error since you have two functions having the same names in two different files.
In the document https://www.cypress.com/file/520251/download
Page 36, section 4.5.1.5, There is an explanation on how you can include two different source files in a different component folder and then you can configure your makefile to use the one you require.
Best Regards,
Rakshith