Hi,
You should add
#ifdef __cplusplus
extern "C" {
#endif
...
...
your function 1 's declaration
your function 2 's declaration
your function 3 's declaration
your function 4 's declaration
...
#ifdef __cplusplus
} ;
#endif
in your libs' header file which is compiled by gcc.
in C program , symbols including variable , function , is very simple in the
obj file. C compiler only add _ before the symbol . eg. Your function name is
MyFunc1(...), then in obj file , it's symbol is _Myfunc1.
in C++ program , c++ compiler need to discriminate the same function name in
classes , globle functions , member functions , son class , father class
....... So c++ compiler add more complex prefix in obj file. eg int
MyFunc1() 's symbol is _abcdMyfunc , int father::MyFunc(void) is _bcvdMyFunc ,
double father::MyFunc(void) is _jhgsdfjgMyFunc , int father::MyFunc(int , int ,
int) is _sjlkdghsjdkMyFunc , int son::MyFunc(void) is
_jsdfgh23745sjdg256MyFunc .............................
you can see the symbol name using arm_v5t_le-nm tool
obviously ,if you want to link C lib to your c++ program you should definitely
tell g++ compiler , you want to call a C function (MyFunc) , its symbol is
_MyFunc . That is why you should add extern "C" { }; in header file of
your C lib.
>Send Davinci-linux-open-source mailing list submissions to
> [email protected]
>
>To subscribe or unsubscribe via the World Wide Web, visit
> http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
>
>or, via email, send a message with subject or body 'help' to
> [EMAIL PROTECTED]
>
>You can reach the person managing the list at
> [EMAIL PROTECTED]
>
>When replying, please edit your Subject line so it is more specific
>than "Re: Contents of Davinci-linux-open-source digest..."
>
>
>Today's Topics:
>
> 1. How to use/LINK C++ functions with the Programme written in C
> in DVEVM (manas lenka)
> 2. RE: Memcpy lots of data (Joshua Hintze)
> 3. VISA API Error (amr ali)
> 4. OV5620 driver (wyudj)
>
>
>----------------------------------------------------------------------
>
>Message: 1
>Date: Sat, 14 Jun 2008 22:52:40 +0530 (IST)
>From: manas lenka <[EMAIL PROTECTED]>
>Subject: How to use/LINK C++ functions with the Programme written in C
> in DVEVM
>To: [email protected]
>Message-ID: <[EMAIL PROTECTED]>
>Content-Type: text/plain; charset="utf-8"
>
>Hi,
>I tried to link some C++ library functions with my own code written in C.
>The C++ libraries have been successfully cross-compiled�� by "arm_v5t_le-g++��
>-Wall".
>But when I am linking�� the C++ functions with my code in C( cors-compiled
>with arm_v5t_le-gcc )�� I am getting error.
>The command I used for linking is :
>________________________________________________________________
>/opt/mv_pro_4.0/montavista/pro/devkit/arm/v5t_le/bin/arm_v5t_le-g++ -g -O2 -W
>-lfreetype -lpng -ljpeg -lpthread -o release/decode release/audio.o
>release/ctrl.o release/display.o release/main.o release/speech.o release/ui.o
>release/video.o decode_config/linker.cmd
>/home/DVEVM-1.20/dvevm_1_20/demos/utils/lib/simplewidget.a
>/home/DVEVM-1.20/dvevm_1_20/demos/utils/lib/msp430lib.a
>/home/DVEVM-1.20/dvevm_1_20/demos/utils/lib/rszcopy.a
>/home/DVEVM-1.20/dvevm_1_20/demos/live/testProgs/loader_th.o
>/home/DVEVM-1.20/dvevm_1_20/demos/live/testProgs/openRTSP.o
>********************************************************
>But I am getting�� error as:
>��release/main.o(.text+0xcf8): In function `main':
>main.c: undefined reference to `loaderThrFxn'
>collect2: ld returned 1 exit status
>make: *** [release/decode] Error 1
>*****************************************************
>The void *loaderThrFxn(void *arg) is defined in the loader_th.cpp
>function(i.e�� in
>/home/DVEVM-1.20/dvevm_1_20/demos/live/testProgs/loader_th.o).
>
>Can any-body tell me why I am unable to link the function defined�� in .cpp
>file
>
>Any help will be highly appreciated.
>Thanks
>MANAS KUMAR
>
>
>
>
> Bollywood, fun, friendship, sports and more. You name it, we have it on
> http://in.promos.yahoo.com/groups/bestofyahoo/
>-------------- next part --------------
>An HTML attachment was scrubbed...
>URL:
>http://linux.omap.com/pipermail/davinci-linux-open-source/attachments/20080614/761103d0/attachment-0001.htm
>
>------------------------------
>
>Message: 2
>Date: Sat, 14 Jun 2008 16:07:04 -0500
>From: "Joshua Hintze" <[EMAIL PROTECTED]>
>Subject: RE: Memcpy lots of data
>To: "'Tonald DL'" <[EMAIL PROTECTED]>
>Cc: [email protected]
>Message-ID: <[EMAIL PROTECTED]>
>Content-Type: text/plain; charset="us-ascii"
>
>Yeah I agree it's pretty slow and with the EMIF bus speeds at 100 MHz it's
>definitely the bottle neck. However I believe the bus is 32 bits, so a very
>simple operation is to copy in blocks of 4 bytes. If the standard memcpy
>does a single byte at a time this cause a huge amount of bus bandwidth that
>need not be there.
>
>
>
>Do you have information on setting up DMA transfers on the linux side?
>
>
>
>Thanks,
>
>
>
>Josh
>
>
>
>
>
>From: Tonald DL [mailto:[EMAIL PROTECTED]
>Sent: Saturday, June 14, 2008 2:43 AM
>To: Joshua Hintze
>Cc: [email protected]
>Subject: Re: Memcpy lots of data
>
>
>
>Hi Josh,
>
>
>
> Use arm/DSP core to do that is quite slow, especially accessing external
>memory.
>
>
>
> If it's just copy data without and operation, you can use DMA to do that
>and let your arm handle others at the mean time.
>
>
>
>
>
>
>
>
>2008/6/14, Joshua Hintze <[EMAIL PROTECTED]>:
>
>Hey guys,
>
>
>
>I am copying a lot of data around in my application and I'm wondering if my
>memcpy (the ansi C one used in the arm_v5t_le-gcc compiler) is doing a byte
>by byte copy or larger copy.
>
>
>
>If it's already doing a quad or 4 byte copy, since that is what the bus size
>is, then great. If not does anybody have some good ideas on optimizing this?
>Write my own memcpy function in arm asm?
>
>
>
>Thanks,
>
>
>
>Josh
>
>
>
>
>
>
>_______________________________________________
>Davinci-linux-open-source mailing list
>[email protected]
>http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
>
>
>
>
>--
>-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>
>Best Regards
>Tonald DL
>WebSite: http://dhcodec.quikstream.com.au/
>
>-------------- next part --------------
>An HTML attachment was scrubbed...
>URL:
>http://linux.omap.com/pipermail/davinci-linux-open-source/attachments/20080614/66fda402/attachment-0001.htm
>
>------------------------------
>
>Message: 3
>Date: Sun, 15 Jun 2008 14:23:23 +0300
>From: amr ali <[EMAIL PROTECTED]>
>Subject: VISA API Error
>To: <[email protected]>
>Message-ID: <[EMAIL PROTECTED]>
>Content-Type: text/plain; charset="windows-1256"
>
>
>Hi,
>I am currently porting some open source algorithms to DM6446. I managed to
>successfully compile it on DSP. When I run the algorithm, I get the following
>message "visa.c:561: VISA_freeMsg: Assertion `visa->cmd[visa->cmdFreeIndex] ==
>((void *)0)' failed.". Why do I get this message?
>How to avoid it?
>BR,
>Amr Ali.
>_________________________________________________________________
>News, entertainment and everything you care about at Live.com. Get it now!
>http://www.live.com/getstarted.aspx
>-------------- next part --------------
>An HTML attachment was scrubbed...
>URL:
>http://linux.omap.com/pipermail/davinci-linux-open-source/attachments/20080615/dfb77c10/attachment-0001.htm
>
>------------------------------
>
>Message: 4
>Date: Sun, 15 Jun 2008 20:45:09 +0800 (CST)
>From: wyudj <[EMAIL PROTECTED]>
>Subject: OV5620 driver
>To: davinci-linux-open-source
> <[email protected]>
>Message-ID:
> <[EMAIL PROTECTED]>
>Content-Type: text/plain; charset="gbk"
>
>Hi,
>
>I want to connect OV5620 cmos sensor of OminiVision technologies with dm6446
>by DC4(digital video input interface of dm6446 EVM). I am currently trying to
>write a device driver for the OV5620. Does any one successfully interfaced the
>OV5620 or other sensors of OminiVision to dm6446?
>Please guide me.
>
>Regards
>dj
>-------------- next part --------------
>An HTML attachment was scrubbed...
>URL:
>http://linux.omap.com/pipermail/davinci-linux-open-source/attachments/20080615/7d09da6b/attachment-0001.htm
>
>------------------------------
>
>_______________________________________________
>Davinci-linux-open-source mailing list
>[email protected]
>http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
>
>
>End of Davinci-linux-open-source Digest, Vol 30, Issue 64
>*********************************************************
>
>
cs
[EMAIL PROTECTED]
2008-06-16
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source