On Fri, 5 Feb 2010, sanjuan34 wrote:
> I have a 7350 with a TS-CAN1 on it. No problems loading the kernel
> module, but now that I'm starting to write code, I am having problems
> linking to libvca. I'm using precompiled lincan-7800.
>
>
> Here's the output from running make (run on the 7350):
>
> ts7000:/mnt/nfs/node_controller# make
> gcc -Wall -I/usr/include/lincan -lpthread -L /usr/lib/lincan -lvca main.o
> ParseCommand.o CreateTCPServerSocket.o AcceptTCPConnection.o
> HandleTCPClient.o TCPSocketServer.o DieWithError.o CANBus.o -o
> arm_nodecontroller
Where in this gcc invocation does it link to the library lincan?
-lvca links in the vca lib
-L /usr/lib/lincan tells it to look in the directory /usr/lib/lincan
to look for libraries specified by the '-l' option
All this is documented in the man page for gcc.
> CANBus.o: In function `CANInit':
> CANBus.c:(.text+0x2c): undefined reference to `vca_open_handle'
> collect2: ld returned 1 exit status
> make: *** [arm_nodecontroller] Error 1
>
> CANBus.c is pretty simple right now - I didn't make it very far before
> running into issues!
>
> /* CANBus.c */
> #include <stdio.h>
> /* lincan headers */
> #include <can_vca.h>
>
> struct canmsg_t canmsg;
>
> int CANInit(void)
> {
>
>
> vca_handle_t canhandle; //create a handle to the can device
> const char *candev = "/dev/can0";
> printf("Opening %s\n", candev);
>
> /* open the can device */
> if ( vca_open_handle(&canhandle, candev, 0, 0) != VCA_OK) {
> perror("open");
> exit(1);
> }
>
> }
>
>
>
>
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|