Sublime Forum

Setup problem

#1


Please help me to solve this problem…

0 Likes

#2

The linker should not be trying to link your text file; best guess would be that you triggered the build command while the cursor was inside of the input.txt file.

0 Likes

#3

So what should I do?

0 Likes

#4

Make sure the input focus is in your source file before you run the build command and see if that has any effect.

0 Likes

#5

This happened…Pls tell where is the issue? I need to fix this badly:(

0 Likes

#6

Short answer: I think you need to add -mconsole as a flag to mingw32.

Long answer: The microsoft linker (link.exe) can link executables in two ways. One way is to link it into a console application, and another way is to link it into a GUI application. When linked into a console application, the main function is assumed to exist. When linked into a GUI application, the WinMain function is instead used as entrypoint for the program. To select the console variant, you must pass /SUBSYSTEM:CONSOLE to link.exe, and to select the GUI variant, you must pass /SUBSYSTEM:WINDOWS to link.exe. I think that last flag may be the default if omitted. By searching a bit on stackoverflow I learned that apparently the equivalent flag for mingw32 is -mconsole.

0 Likes

#7

How to do that? I am beginner actually

0 Likes

#8

Try to first compile your main.cpp in the terminal. If you can succesfully compile it in the terminal, then write a build system to automate that task. build systems reference, and another reference, and even a YouTube video on build systems.

To get it to compile in the terminal you will likely need to invoke something like mingw32.exe path\to\main.cpp -mconsole

1 Like

#9

OK, thanks:)

0 Likes

#10

I am not getting things:(

0 Likes

#11

Try g++ instead of gcc ?

0 Likes

#12

ok, now this happened…
Capture3

0 Likes

#13

You should watch this video. It seems like you don’t completely understand what the g++ and gcc command line programs actually do.

0 Likes