在过去的几个小时里,我一直在尝试为我在 Netbeans 中开发的 C++ 应用程序设置一个 cronjob。我在 Windows 机器上编程并使用 Ubuntu 服务器作为构建主机。它进行了设置,因此将文件放入分发文件夹中,我认为这是我必须执行的文件。我使用以下命令行执行它:
g++ program
之后它会弹出以下错误:
testproject: In function `_start':
(.text+0x0): multiple definition of `_start'
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/crt1.o:(.text+0x0):
first defined here
testproject: In function `_fini':
(.fini+0x0): multiple definition of `_fini'
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/crti.o:(.fini+0x0):
first defined here
testproject:(.rodata+0x0): multiple definition of `_IO_stdin_used'
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/crt1.o:(.rodata.cst4
+0x0): first defined here
testproject: In function `__data_start':
(.data+0x0): multiple definition of `__data_start'
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/crt1.o:(.data+0x0):
first defined here
testproject: In function `__data_start':
(.data+0x8): multiple definition of `__dso_handle'
/usr/lib/gcc/x86_64-linux-gnu/4.6/crtbegin.o:(.data+0x0): first defined here
testproject: In function `_init':
(.init+0x0): multiple definition of `_init'
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/crti.o:(.init+0x0):
first defined here
/usr/lib/gcc/x86_64-linux-gnu/4.6/crtend.o:(.dtors+0x0): multiple definition of
`__DTOR_END__'
testproject:(.dtors+0x8): first defined here
/usr/bin/ld: error in testproject(.eh_frame); no .eh_frame_hdr table will be cre
ated.
collect2: ld returned 1 exit status
但是,当我在 Netbeans 中单击运行时,它运行得很好。我需要运行哪个命令才能使其正常工作?