View Single Post
  #1   Spotlight this post!  
Unread 24-01-2015, 17:55
playerzero playerzero is offline
Registered User
FRC #0167
 
Join Date: Jan 2014
Location: Iowa
Posts: 2
playerzero is an unknown quantity at this point
Eclipse C++ undefined reference to main

Hi,

My team (Team 167) is having a rather cryptic issue when attempting to compile our C++ program in Eclipse. The build console shows this:

16:51:03 **** Incremental Build of configuration Debug for project icrobotics-2015 ****
Info: Internal Builder is used for build
arm-frc-linux-gnueabi-g++ "-LC:\\Users\\Kazimier/wpilib/cpp/current/lib" -Wl,-rpath,/opt/GenlCam_v2_3/bin/Linux_armv7-a -o FRCUserProgram "src\\Team167Lib\\Vector3.o" "src\\Team167Lib\\SwerveDrive.o" "src\\Team167Lib\\SimpleJoystick.o" "src\\Team167Lib\\PneumaticPiston.o" "src\\Robot.o" "src\\ElevatorArms.o" "src\\Autonomous.o" -lwpi
c:/frc/bin/../lib/gcc/arm-frc-linux-gnueabi/4.9.1/../../../../arm-frc-linux-gnueabi/bin/ld.exe: warning: libstdc++.so.6, needed by C:\Users\Kazimier/wpilib/cpp/current/lib\libFRC_NetworkCommunication.so.1.5.0, not found (try using -rpath or -rpath-link)
c:/frc/bin/../../frc/usr/lib/crt1.o: In function `_start':
/builds/perforce/ThirdPartyExports/NIOpenEmbedded/trunk/2.0/objects/targettools/linuxU/armv7-a/gcc-4.7-oe/release/build/tmp-eglibc/work/armv7a-vfp-neon-nilrt-linux-gnueabi/eglibc/2.17-r4/eglibc-2.17/libc/csu/../ports/sysdeps/arm/start.S:119: undefined reference to `main'
collect2.exe: error: ld returned 1 exit status

16:51:06 Build Finished (took 2s.665ms)

The important part (I think) is:
c:/frc/bin/../../frc/usr/lib/crt1.o: In function `_start':
/builds/perforce/ThirdPartyExports/NIOpenEmbedded/trunk/2.0/objects/targettools/linuxU/armv7-a/gcc-4.7-oe/release/build/tmp-eglibc/work/armv7a-vfp-neon-nilrt-linux-gnueabi/eglibc/2.17-r4/eglibc-2.17/libc/csu/../ports/sysdeps/arm/start.S:119: undefined reference to `main'
collect2.exe: error: ld returned 1 exit status


I guess some program on which our code relies is trying to call a main method when it shouldn't. Supposedly the "-c" compile option can help with this, but it's already set in the g++ compiler options in Eclipse.

I'm kind of at a loss as to how to fix the issue. I'm wondering if I set up Eclipse wrong. Has anyone else experienced or managed to fix this error? Does anyone have any ideas as to how I might fix it or even what the specific problem is?

Thank you!
Reply With Quote