OpenClovis / SAFplus-Availability-Scalability-Platform

Middleware that provides libraries, GUI, and code generator to design multi-node (clustered) applications that are highly available, redundant, and scalable. Provides sub-second node and application fault detection and failover, and useful application libraries including distributed hash tables (checkpoint), event, logging, and communications. Implements SA-Forum APIs where applicable. Used anywhere reliability is a must -- like telecom, wireless, defense and enterprise computing. Download stable release with installer from: ftp.openclovis.com
www.openclovis.com
GNU General Public License v2.0
19 stars 13 forks source link

SAFplus linking object failed with GCC 4.6.3 #86

Closed hoangle closed 11 years ago

hoangle commented 11 years ago

Step to reproduce:

  1. Create a simple SAFplus model
  2. At main.c, add a line using variable gClnsMaxNoEntries at src/config/clASPCfg.c int main(int argc, char *argv[]) { printf("%d\n", gClnsMaxNoEntries);

    }

  3. At Makefile's source app, modify EXTRA_CPPFLAGS := -lClConfig
  4. Make the model, the result as following: make[3]: Nothing to be done for `libs'. /opt/clovis/6.1/sdk/src/SAFplus/../SAFplus/mk/preface.mk:90: Not using the chassis manager CC $(TARGET)/x8664/linux-3.2.14/obj/src/app/SAFcomp/main.o main.c: In function ‘int main(int, char*)’: main.c:93:20: error: ‘gClnsMaxNoEntries’ was not declared in this scope make[3]: _\ [/home/hoangle/workspace_oc1/testUDP/target/x86_64/linux-3.2.14/obj/src/app/SAFcomp/main.o] Error 1

Root cause: With new gcc (i.e 4.6.3) the old style linking: gcc -L -llib -o object is replaced by new style: gcc -o object -L -llib

However, at our make-common.mk is still using old styple, then cause the issue.

hoangle commented 11 years ago

The issue is not valid. If user using other libs, should using EXTRA_LDLIBS instead of EXTRA_CPPFLAGS like example: EXTRA_LDLIBS += -lClConfig