Adding Scramnet Libraries into QNX 6.3 IDE

Please help. I have a very simple program that is in QNX C, and I’m having problems linking Scramnet libraries to it. I have one library that I’m trying to include (libhw), and a header file to go with it (scr.h). I’ve included the include directory, and the library directory in the compiler and linker, but I still get an error. Can anyone shed some light on this?

#include <stdlib.h>
#include <stdio.h>
//#include “scr.h”
#include “temp1.h”

int main(int argc, char *argv[]) {
int temp2;
temp2 = scr_dfltr_mm(5);
temp2 = huinya(1);
printf("%i \n" , temp2);
printf(“Welcome to the Momentics IDE\n”);
return EXIT_SUCCESS;
}

make -k all --file=/workspace/EugeneProject/QMakefile16265.tmp
make -j 1 -Cx86 -fMakefile all
make[1]: Entering directory /workspace/EugeneProject/x86' make -j 1 -Co -fMakefile all make[2]: Entering directory /workspace/EugeneProject/x86/o’
/usr/qnx630/host/qnx6/x86//usr/bin/qcc -V3.3.5,gcc_ntox86 -c -Wc,-Wall -Wc,-Wno-parentheses -O -DNDEBUG -I. -I/workspace/EugeneProject/x86/o -I/workspace/EugeneProject/x86 -I/workspace/EugeneProject -I/workspace/EugeneProject/usr/scramnet/inc -I/usr/qnx630/target/qnx6/usr/include /workspace/EugeneProject/EugeneProject.c
/workspace/EugeneProject/EugeneProject.c: In function main': /workspace/EugeneProject/EugeneProject.c:10: warning: implicit declaration of function scr_dfltr_mm’
/bin/rm -f /workspace/EugeneProject/x86/o/EugeneProject
/usr/qnx630/host/qnx6/x86//usr/bin/qcc -V3.3.5,gcc_ntox86 -o/workspace/EugeneProject/x86/o/EugeneProject EugeneProject.o temp1.o -L. -L/usr/scramnet/lib -L/usr/qnx630/target/qnx6/x86/lib/gcc/3.3.5 -L/usr/qnx630/target/qnx6/x86/lib -L/usr/qnx630/target/qnx6/x86/usr/lib -lc -llibhw
/usr/qnx630/host/qnx6/x86//usr/bin/i386-pc-nto-qnx6.3.0-ld: cannot find -llibhw
cc: /usr/qnx630/host/qnx6/x86//usr/bin/i386-pc-nto-qnx6.3.0-ld error 1
make[2]: *** [/workspace/EugeneProject/x86/o/EugeneProject] Error 1
make[2]: Leaving directory /workspace/EugeneProject/x86/o' make[2]: Target all’ not remade because of errors.
make[1]: [all] Error 2 (ignored)
make -j 1 -Co-g -fMakefile all
make[2]: Entering directory /workspace/EugeneProject/x86/o-g' /usr/qnx630/host/qnx6/x86//usr/bin/qcc -V3.3.5,gcc_ntox86 -c -Wc,-Wall -Wc,-Wno-parentheses -I. -I/workspace/EugeneProject/x86/o -I/workspace/EugeneProject/x86/o-g -I/workspace/EugeneProject/x86 -I/workspace/EugeneProject -I/workspace/EugeneProject/usr/scramnet/inc -I/usr/qnx630/target/qnx6/usr/include -g -DVARIANT_g /workspace/EugeneProject/EugeneProject.c /workspace/EugeneProject/EugeneProject.c: In function main’:
/workspace/EugeneProject/EugeneProject.c:10: warning: implicit declaration of function scr_dfltr_mm' /bin/rm -f /workspace/EugeneProject/x86/o-g/EugeneProject_g /usr/qnx630/host/qnx6/x86//usr/bin/qcc -V3.3.5,gcc_ntox86 -o/workspace/EugeneProject/x86/o-g/EugeneProject_g EugeneProject.o temp1.o -L. -L/usr/scramnet/lib -L/usr/qnx630/target/qnx6/x86/lib/gcc/3.3.5 -L/usr/qnx630/target/qnx6/x86/lib -L/usr/qnx630/target/qnx6/x86/usr/lib -lc -llibhw -g /usr/qnx630/host/qnx6/x86//usr/bin/i386-pc-nto-qnx6.3.0-ld: cannot find -llibhw cc: /usr/qnx630/host/qnx6/x86//usr/bin/i386-pc-nto-qnx6.3.0-ld error 1 make[2]: *** [/workspace/EugeneProject/x86/o-g/EugeneProject_g] Error 1 make[2]: Leaving directory /workspace/EugeneProject/x86/o-g’
make[1]: Leaving directory /workspace/EugeneProject/x86' make[2]: Target all’ not remade because of errors.
make[1]: [all] Error 2 (ignored)

/workspace/EugeneProject/EugeneProject.c
/workspace/EugeneProject/EugeneProject.c: In function main': /workspace/EugeneProject/EugeneProject.c:10: warning: implicit declaration of function scr_dfltr_mm’

I suspect you are not including the header #include <> in the C file. Or that perticular function has a typo.

As for the library, try specifying -lhw instead of -llibhw.

Thanks. I’ve checked the include file and it is there. I will try -lhw, however the library name is libhw. Thanks again for looking at this

the library name should be libhw.a. the *cc front end will add lib prefix and .a suffix (I have not idea what is the rationnal behind this)

In the header file add a #error hello just beside the prototype of the fonction. If when compiling you are not getting any error it’s because for some reason that header file is not included or some portion of it are commented or ifdefed out.

Because it’s kool! (that’s the best I can come up with anyway :slight_smile:

Thanks. That did include the library files. Its the weardest thing I’ve ever seen. For some reason I’m still getting errors inside the library files. Thanks for your help mario.

You must be very young then :wink:

True