Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Linker Errors in Hello World program
Linker Errors in Hello World program [message #1065007] Sun, 23 June 2013 03:32 Go to next message
Thomas S is currently offline Thomas S
Messages: 1
Registered: June 2013
Junior Member
hi
just installed CDT into eclipse juno
I also installed MinGW

I have problems building the standard C++ Hello World program
(C programs are working fine)

Console output:

05:15:44 **** Incremental Build of configuration Debug for project test ****
Info: Internal Builder is used for build
g++ -o test.exe "src\\test.o"
/mingw/lib/libmingwex.a(pformat.o):pformat.c:(.text+0x3f4): undefined reference to `__chkstk_ms'
/mingw/lib/libmingwex.a(pformat.o):pformat.c:(.text+0x66f): undefined reference to `__chkstk_ms'
/mingw/lib/libmingwex.a(pformat.o):pformat.c:(.text+0xa94): undefined reference to `__chkstk_ms'
/mingw/lib/libmingwex.a(pformat.o):pformat.c:(.text+0x13df): undefined reference to `__chkstk_ms'
C:\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bin\ld.exe: /mingw/lib/libmingwex.a(pformat.o): bad reloc address 0x34 in section `.rdata'
C:\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bin\ld.exe: final link failed: Invalid operation
collect2: ld returned 1 exit status

05:15:44 Build Finished (took 467ms)
Re: Linker Errors in Hello World program [message #1103289 is a reply to message #1065007] Fri, 06 September 2013 15:28 Go to previous messageGo to next message
Cliff A is currently offline Cliff A
Messages: 1
Registered: September 2013
Junior Member
I am having almost the exact same problem in Eclipse Helios. Any solutions?
Re: Linker Errors in Hello World program [message #1103456 is a reply to message #1103289] Fri, 06 September 2013 20:25 Go to previous messageGo to next message
CGO SenseiC is currently offline CGO SenseiC
Messages: 16
Registered: July 2011
Junior Member
I would first double-check to make sure you have the MinGW bin folder added in the PATH environment variable (though I have to believe you have it defined, otherwise the C/C++ compiler wouldn't work.

Next look at the log file (right-click on your C/C++ project and at the bottom click on Properties. Twirl down C/C++ Build and click on Logging. Make sure that you have "Enable build logging checked and then copy the path for the Log file location so you can paste it into Windows Explorer to view the folder contents). Odds are if you've used the defaults for everything then the logs get written in C:\Users\{YOUR-USERNAME}\workspace\.metadata\.plugins\org.eclipse.cdt.ui\ and you will find a file called global-build.log and for each project a {your-project-name}.log file.

If that doesn't help, you can boost the "chatter" in the log by adding the 'verbose' option to the linker. Just below the "Logging" (above) you will see Settings. Click on that, then under MinGW C++ Linker click on Miscellaneous. In the right-hand side at the top you'll see the field for Linker flags and enter: --verbose (Note: that has TWO hyphens/dashes.

Finally... when you created your project, did you make sure you selected MinGW GCC in the Toolchains (right-hand pane from where you select the Hello World C++ Project)?

SenseiC bows out
Re: Linker Errors in Hello World program [message #1106494 is a reply to message #1103456] Wed, 11 September 2013 06:59 Go to previous message
Axel Mueller is currently offline Axel Mueller
Messages: 1952
Registered: July 2009
Senior Member
Google was very helpful Smile
http://stackoverflow.com/questions/18649173/how-to-solve-undefined-reference-to-chkstk-ms-on-mingwingw


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Previous Topic:Separate folders for .h and .cpp files?
Next Topic:make error 127 with beaglebone angstrom release
Goto Forum:
  


Current Time: Sat Sep 20 02:00:07 GMT 2014

Powered by FUDForum. Page generated in 0.23337 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software