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 _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
On 08/27/2011 05:54 AM, 宋喜佳 wrote:
> 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> A compiler doesn't need you to specify the include files on the command line. That's what the include search paths are for. You should likely have something more like. arm-none-linux-gnueabi-g++ -Wall $(pkg-config --cflags gstreamer-0.10) audio-player.cpp -o audio-player $(pkg-config --libs gstreamer-0.10) The question is unrelated to gstreamer, you would likely have been able to find the answer to this via google. _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
In reply to this post by 宋喜佳
Seems you made an error in include
-----Original Message----- From: gstreamer-devel-bounces+zheng.zhang=[hidden email] [mailto:gstreamer-devel-bounces+zheng.zhang=[hidden email]] On Behalf Of 宋喜佳 Sent: Saturday, August 27, 2011 7:55 PM To: [hidden email] Subject: How to compile .cpp file 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 _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Nice to meet you~
All Chinese, hah~ I guess you missed some header or libs and there is not complier 's buiness~ 2011/8/29 Zhang, Zheng <[hidden email]> Seems you made an error in include _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Free forum by Nabble | Edit this page |