Hello Misi, Now, I can able to compile the program but the sad part is not able to execute :(
[timadm@aial00447 include]$ gcc -c -DAR_STRICT_ANSI -D_REENTRANT -malign-double -I/apps/tim/ar/api/include -L/apps/tim/ar/api/lib/libari81_build001_lx64.so -L/apps/tim/ar/api/lib/libar_lx64.so -L/apps/tim/ar/api/lib/libarxmlutil_lx64.so -L/apps/tim/ar/api/lib/libicudatabmc_lx64.so -L/apps/tim/ar/api/lib/libicui18nbmc_lx64.so -L/apps/tim/ar/api/lib/libicuucbmc_lx64.so -ldl -lnsl -lpthread SchemaCount.c -o SchemaCount [timadm@aial00447 include]$ chmod a+x SchemaCount [timadm@aial00447 include]$ ./SchemaCount -bash: ./SchemaCount: cannot execute binary file Any thoughts? Thanks & regards, Gopi Anbazhagan -----Original Message----- From: Action Request System discussion list(ARSList) [mailto:[email protected]] On Behalf Of Misi Mladoniczky Sent: Thursday, December 05, 2013 8:18 PM To: [email protected] Subject: Re: Compiling and linking C-API on HP-UX 64-bit system Hi, Thanks for trying to assist. I have no problems compiling. And I have no problems linking in Linux either, this is purely a HP-UX problem. It seems you have missed to include the -lar_lx64. I think the -m32 should be removed, and you should add -DAR_STRICT_ANSI -D_REENTRANT -malign-double. Best Regards - Misi, RRR AB, http://rrr.se > Hello Misi, > > I tried to compile your sample program in my environment (RHEL 6.4 with ARS8.1 > P2 applied) and got the below errors > > [timadm@aial00447 include]$ gcc -m32 -L/apps/tim/ar/lib > -I/apps/tim/ar/api/include -L/apps/tim/ar/api/lib -ldl -lnsl -lpthread > SchemaCount.c -o SchemaCount > /tmp/ccYYNBGq.o: In function `main': > SchemaCount.c:(.text+0x17e): undefined reference to `ARInitialization' > SchemaCount.c:(.text+0x1b7): undefined reference to `FreeARStatusList' > SchemaCount.c:(.text+0x1e8): undefined reference to `ARSetServerPort' > SchemaCount.c:(.text+0x221): undefined reference to `FreeARStatusList' > SchemaCount.c:(.text+0x265): undefined reference to `ARGetListSchema' > SchemaCount.c:(.text+0x29e): undefined reference to `FreeARStatusList' > SchemaCount.c:(.text+0x2c7): undefined reference to `FreeARNameList' > SchemaCount.c:(.text+0x2db): undefined reference to `ARTermination' > SchemaCount.c:(.text+0x314): undefined reference to `FreeARStatusList' > collect2: ld returned 1 exit status > > Not sure about this error. I am keep compiling with different option. > > Any comments ? > > Thanks & regards, > Gopi Anbazhagan > > -----Original Message----- > From: Action Request System discussion list(ARSList) > [mailto:[email protected]] On Behalf Of Misi Mladoniczky > Sent: Thursday, December 05, 2013 5:16 PM > To: [email protected] > Subject: Compiling and linking C-API on HP-UX 64-bit system > > Hi, > > I am a fair programmer, but not a very good compiler/linker I guess... > > I am having trouble compiling a simple C-program on HP-UX 11.31 64-bit OS. > > I have tried both with 8.1.0 and 8.0.0 API with exactly the same result. > > I am not 100% sure that the environment I have been handed is up to par, but I > am unable to figure out exactly where the problem is at. > > The only thing I have been able to get working is to link with the 32-bit > version named libar_hpia32.sl using the built in aCC (not the gcc). The > libarhpia64 always gives me an error of "ld: Mismatched ABI for -lar_hpia64, > found api800hpuxitanium/lib/libar_hpia64.sl". > > I have created a small test program that just logs in and gets count of > schemas (forms) from the server. > > Is something wrong with the OS, gcc or the libar_hpia64 I have in AR version > 8.0.0 and 8.1.0 downloaded from https://www.rrr.se/cgi/index?pg=arapi? How > should I get further on this? > > # uname -a > HP-UX horus B.11.31 U ia64 2206824034 unlimited-user license > > # gcc -v > Using built-in specs. > Target: ia64-hp-hpux11.31 > Configured with: ../src/configure --enable-languages=c,c++ > --prefix=/usr/local/ia64 --with-local-prefix=/usr/local/ia64 --with-gnu-as > --with-as=/usr/local/ia64/bin/as --with-ld=/usr/ccs/bin/ld --disable-shared > --disable-nls > Thread model: single > gcc version 4.2.4 > > # export LD_LIBRARY_PATH=api800hpuxitanium/bin:api800hpuxitanium/lib > > # aCC -O -DAR_STRICT_ANSI -I api800hpuxitanium/include -L > api800hpuxitanium/lib -L api800hpuxitanium/bin -lar_hpia64 -lpthread -lnsl > -lcurses rrrtest.c -o rrrtest > ld: Mismatched ABI for -lar_hpia64, found > api800hpuxitanium/lib/libar_hpia64.sl > Fatal error. > > # aCC -O -DAR_STRICT_ANSI -I api800hpuxitanium/include -L > api800hpuxitanium/lib -L api800hpuxitanium/bin -lar_hpia32 -lpthread -lnsl > -lcurses rrrtest.c -o rrrtest > # ./rrrtest > numschemas=399 > > # gcc -O -DAR_STRICT_ANSI -I api800hpuxitanium/include -L > api800hpuxitanium/lib -L api800hpuxitanium/bin -lar_hpia64 -lpthread -lnsl > -lcurses rrrtest.c -o rrrtest > ld: Mismatched ABI for -lar_hpia64, found > api800hpuxitanium/lib/libar_hpia64.sl > Fatal error. > collect2: ld returned 1 exit status > > # gcc -O -DAR_STRICT_ANSI -I api800hpuxitanium/include -L > api800hpuxitanium/lib -L api800hpuxitanium/bin -lar_hpia32 -lpthread -lnsl > -lcurses rrrtest.c -o rrrtest > ld: (Warning) Unsatisfied symbol "_Kpow" in file > api800hpuxitanium/bin/libicuucbmc_hpia32.sl.32 > ld: (Warning) Unsatisfied symbol "__cxa_vec_new2" in file > api800hpuxitanium/bin/libicuucbmc_hpia32.sl.32 > ld: (Warning) Unsatisfied symbol "operator delete[](void*)" in file > api800hpuxitanium/lib/libar_hpia32.sl > ld: (Warning) Unsatisfied symbol "__cxa_pure_virtual" in file > api800hpuxitanium/bin/libicuucbmc_hpia32.sl.32 > ld: (Warning) Unsatisfied symbol "operator delete(void*)" in file > api800hpuxitanium/lib/libar_hpia32.sl > ld: (Warning) Unsatisfied symbol "operator new[](unsigned long)" in file > api800hpuxitanium/lib/libar_hpia32.sl > ld: (Warning) Unsatisfied symbol "vtable for > __cxxabiv1::__vmi_class_type_info" in file > api800hpuxitanium/bin/libicuucbmc_hpia32.sl.32 > ld: (Warning) Unsatisfied symbol "_fmod" in file > api800hpuxitanium/bin/libicuucbmc_hpia32.sl.32 > ld: (Warning) Unsatisfied symbol "vtable for __cxxabiv1::__class_type_info" in > file api800hpuxitanium/bin/libicuucbmc_hpia32.sl.32 > ld: (Warning) Unsatisfied symbol "_pow" in file > api800hpuxitanium/bin/libicuucbmc_hpia32.sl.32 > ld: (Warning) Unsatisfied symbol "__cxa_finalize" in file > api800hpuxitanium/lib/libar_hpia32.sl > ld: (Warning) Unsatisfied symbol "vtable for __cxxabiv1::__si_class_type_info" > in file api800hpuxitanium/bin/libicuucbmc_hpia32.sl.32 > ld: (Warning) Unsatisfied symbol "_Unwind_Resume" in file > api800hpuxitanium/lib/libar_hpia32.sl > ld: (Warning) Unsatisfied symbol "__cxa_vec_delete2" in file > api800hpuxitanium/bin/libicuucbmc_hpia32.sl.32 > ld: (Warning) Unsatisfied symbol "__cxa_atexit" in file > api800hpuxitanium/lib/libar_hpia32.sl > ld: (Warning) Unsatisfied symbol "__cxa_personality_routine" in file > api800hpuxitanium/lib/libar_hpia32.sl > ld: (Warning) Unsatisfied symbol "__cxa_vec_dtor" in file > api800hpuxitanium/bin/libicui18nbmc_hpia32.sl.32 > ld: (Warning) Unsatisfied symbol "__cxa_vec_ctor" in file > api800hpuxitanium/bin/libicui18nbmc_hpia32.sl.32 > 18 warnings. > > /* rrrtest.c */ > #include <stdio.h> > #include <string.h> > > #include <ar.h> > #include <arextern.h> > #include <arfree.h> > > void statusprint(char *function, ARStatusList *status) > { > unsigned int i; > printf("%s(), status.numItems = %d\n", function, status->numItems); > for(i = 0; i < status->numItems; ++i) > { > printf(" type=%d, num=%d, text=%s, append=%s\n", > status->statusList[i].messageType, > status->statusList[i].messageNum, > status->statusList[i].messageText ? > status->statusList[i].messageText : "NULL", > status->statusList[i].appendedText ? > status->statusList[i].appendedText : "NULL"); > } > } > > main() > { > ARControlStruct control; > ARStatusList status; > ARNameList schemalist; > int ret; > > memset(&control, '\0', sizeof(ARControlStruct)); > strcpy(control.server, "testserver"); > strcpy(control.user, "Demo"); > strcpy(control.password, ""); > > ret = ARInitialization(&control, &status); > if(ret > AR_RETURN_OK) statusprint("ARInitialization", &status); > FreeARStatusList(&status, FALSE); > > /* seting tcp-port */ > ret = ARSetServerPort(&control, control.server, 1040, 0, &status); > if(ret > AR_RETURN_OK) statusprint("ARSetServerPort", &status); > FreeARStatusList(&status, FALSE); > > ret = ARGetListSchema(&control, 0, > AR_LIST_SCHEMA_ALL|AR_HIDDEN_INCREMENT, NULL, NULL, NULL, &schemalist, > &status); > if(ret > AR_RETURN_OK) statusprint("ARGetListSchema", &status); > FreeARStatusList(&status, FALSE); > printf("numschemas=%d\n", schemalist.numItems); > FreeARNameList(&schemalist, FALSE); > > ret = ARTermination(&control, &status); > if(ret > AR_RETURN_OK) statusprint("ARTermination", &status); > FreeARStatusList(&status, FALSE); > } > > Best Regards - Misi, RRR AB, http://www.rrr.se (ARSList MVP 2011) > > Ask the Remedy Licensing Experts (Best R.O.I. Award at WWRUG10/11/12/13): > * RRR|License - Not enough Remedy licenses? Save money by optimizing. > * RRR|Log - Performance issues or elusive bugs? Analyze your Remedy logs. > Find these products, and many free tools and utilities, at http://rrr.se. > > _______________________________________________________________________________ > UNSUBSCRIBE or access ARSlist Archives at www.arslist.org > "Where the Answers Are, and have been for 20 years" > > _______________________________________________________________________________ > UNSUBSCRIBE or access ARSlist Archives at www.arslist.org > "Where the Answers Are, and have been for 20 years" > _______________________________________________________________________________ UNSUBSCRIBE or access ARSlist Archives at www.arslist.org "Where the Answers Are, and have been for 20 years" _______________________________________________________________________________ UNSUBSCRIBE or access ARSlist Archives at www.arslist.org "Where the Answers Are, and have been for 20 years"

