News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Cant build "Hello World " example on MinGW C++

Started by 16BitBilly, January 30, 2015, 12:17:26 AM

Previous topic - Next topic

16BitBilly

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

-------------- 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

#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 ?



oBFusCATed

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!]

16BitBilly

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.

oBFusCATed

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!]

16BitBilly

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...

stahta01

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++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

BlueHazzard

1) Thank you for posting a full build log. there are only a few newcomer that make this correkt...

Quote from: 16BitBilly 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.
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/

QuoteI 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