Author Topic: Cant build "Hello World " example on MinGW C++  (Read 3232 times)

Offline 16BitBilly

  • Multiple posting newcomer
  • *
  • Posts: 13
Cant build "Hello World " example on MinGW C++
« on: January 30, 2015, 12:17:26 am »
I am on windows 7. I downloaded the latest codeblocks-13.12mingw-setup.exe. Now the problem is I cant get my minimalist C++ application to run.
This is what my compiler configuration looks like. The image is attached.However when I attempt to build my c++ application I get the following error

Code
-------------- Build: Debug in GNU64Test (compiler: GNU GCC Compiler)---------------

mingw32-g++.exe -Wall -std=c++98  -c C:\Users\Hsheikh\GNU64Test\main.cpp -o obj\Debug\main.o
C:\Users\Hsheikh\AppData\Local\Temp\ccGfntu5.s: Assembler messages:
C:\Users\Hsheikh\AppData\Local\Temp\ccGfntu5.s:2: Error: junk at end of line, first unrecognized character is `,'
Process terminated with status 1 (0 minute(s), 0 second(s))
1 error(s), 0 warning(s) (0 minute(s), 0 second(s))

This is my c++ code

Code
#include <iostream>

int main()
{
  std::cout << "Hello";
}


Any suggestions on why I might be getting that error ? Do I need to add linker settings or something else ?


« Last Edit: January 30, 2015, 12:19:57 am by 16BitBilly »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13222
    • Travis build status
Re: Cant build "Hello World " example on MinGW C++
« Reply #1 on: January 30, 2015, 12:21:14 am »
Have you tried searching the internet?

http://mingw.5.n7.nabble.com/junk-at-end-of-assembler-file-td70.html what about this.

I suspect your compiler installation is broken somehow.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline 16BitBilly

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: Cant build "Hello World " example on MinGW C++
« Reply #2 on: January 30, 2015, 12:38:46 am »
I am not sure if it could be broken ? I installed the latest version of codeblocks which also installs the Mingw development compiler for you.
From the link you mentioned it seems like the assembler is older than what is required. I still dont understand how I could resolve this issue.
I am sorry if I missed it in the link.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13222
    • Travis build status
Re: Cant build "Hello World " example on MinGW C++
« Reply #3 on: January 30, 2015, 12:41:43 am »
Try uninstalling. Then check if everything is removed correctly (no mingw folder on any partition) and reinstall.

Can't help much... I'm not running windows...

And search the internet, I won't do it for you second time!
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline 16BitBilly

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: Cant build "Hello World " example on MinGW C++
« Reply #4 on: January 30, 2015, 12:44:45 am »
I did uninstall and ran everything. I am not expecting you to do it for me. Apart from the fact that you are merely pointing out the basics and being rude about it.  Why would you answer a windows question anyway then...

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7108
    • My Best Post
Re: Cant build "Hello World " example on MinGW C++
« Reply #5 on: January 30, 2015, 01:04:25 am »
I started work on Steps to solve MinGW GCC issues in CB.
https://github.com/stahta01/stahta01.github.io/blob/master/CodeBlocks/CB_Trouble_Shooting/CodeBlocks%20MinGW%20GCC%20Troubleshooting.txt

Too tired and I have paying work I am behind on that I will be doing in a little bit.
Maybe the directions will help you.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2951
Re: Cant build "Hello World " example on MinGW C++
« Reply #6 on: January 30, 2015, 02:03:53 am »
1) Thank you for posting a full build log. there are only a few newcomer that make this correkt...

I am not sure if it could be broken ? I installed the latest version of codeblocks which also installs the Mingw development compiler for you.
From the link you mentioned it seems like the assembler is older than what is required. I still dont understand how I could resolve this issue.
I am sorry if I missed it in the link.
2) The simplest way to solve a problem  is to copy and paste the error message to google and look if someone else had also this problem... And it seems that there are plenty other people with the same errors
ex. [1] http://www.gamedev.net/topic/487830-mingw-assemblerlinker-error/

Quote
I am not sure if it could be broken?
A possibility is that your anti virus blocked the compiler installation (because a compiler makes exe like a virus does, so the haptic is sometimes a bit too aggressive).
But more probable is that you have a older compiler installation in your path like it is mentioned in [1]


@stahta01: good idea

greetings