mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-19 02:17:27 +08:00

Linkers always use object files explicitly specified on the command line regardless of where they appear. Move them to the front of the list of linked libraries in so that symbols required by the object files can be resolved by any library. Issue: #22149
25 lines
524 B
C
25 lines
524 B
C
#ifdef OBJA
|
|
# error "OBJA is defined, but should not be"
|
|
#endif
|
|
#ifndef OBJB
|
|
# error "OBJB is not defined, but should be"
|
|
#endif
|
|
#ifdef OBJC
|
|
# error "OBJC is defined, but should not be"
|
|
#endif
|
|
#ifndef OBJD
|
|
# error "OBJD is not defined, but should be"
|
|
#endif
|
|
#ifdef OBJE
|
|
# error "OBJE is defined, but should not be"
|
|
#endif
|
|
extern int a_obj(void);
|
|
extern int b_obj(void);
|
|
extern int c_obj(void);
|
|
extern int d_obj(void);
|
|
extern int e_lib(void);
|
|
int main(void)
|
|
{
|
|
return a_obj() + b_obj() + c_obj() + d_obj() + e_lib();
|
|
}
|