How to compile .cpp file

宋喜佳 songxijia2009 at gmail.com
Sat Aug 27 04:54:30 PDT 2011


Hi friends,
  I have wrte a simple application with c++, but now I do not know how
to compile it. when I use gcc, a error comes out. Just like:

[linux-devkit]:~/myTest_host/audio-player> arm-none-linux-gnueabi-gcc
-Wall $(pkg-config --cflags --libs gstreamer-0.10) audio-player.cpp
audio-player.h -lz
audio-player.h:6: error: expected '=', ',', ';', 'asm' or
'__attribute__' before 'AudioPlayer'
[linux-devkit]:~/myTest_host/audio-player>

when I change to g++ ,another error occurred, just like:

[linux-devkit]:~/myTest_host/audio-player> arm-none-linux-gnueabi-g++
-Wall $(pkg-config --cflags --libs gstreamer-0.10) audio-player.cpp
audio-player.h -lz
/root/CodeSourcery/Sourcery_G++_Lite/bin/../arm-none-linux-gnueabi/libc/usr/lib/crt1.o:
In function `_start':
init.c:(.text+0x30): undefined reference to `main'
collect2: ld returned 1 exit status
[linux-devkit]:~/myTest_host/audio-player>


Please help me to compile a .cpp file !
thanks!

--
     致
礼

联系人:宋喜佳
办公室座机:0431-84627053-8336
手机:15044157175
QQ:870578087


More information about the gstreamer-devel mailing list