Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Linking, Precompiler, etc etc

Name: Anonymous 2006-09-27 20:33

Anyone know of a good tutorial I can look at to learn, basically, what the hell I need to do to make C++ projects compile?   I learned on VB and I also love C#, but C++ is just messing with me.

It's not the syntax or anything that's difficult, it's just all the hoops you've got to jump through to make the damn thing go.

No matter what, I can't compile anyone else's projects in microsoft C++.  All the project settings, the linker, and WHAT THE FUCK IS A PRECOMPILED HEADER DIRECTIVE? Ambiguous error messages that could apply to hundreads of possible problems according to google (API Entry Point must be Defined?  WTF?) Someone out there must understand all that crap that goes on up above the actual program itself, I mean, people write these things.  So, where can I go to learn this secret knowledge?

Name: Anonymous 2006-09-27 20:41

get gcc problem solved.

Name: Anonymous 2006-09-27 22:00

>>2
you being serial?

Name: Anonymous 2006-09-27 22:30

Getting shit compiled in windows is no fun, even with (or maybe because of) an IDE.

Also, headers get #included into files, and thus are recompiled often despite never changing. Precompiled headers 'solve' this problem.

Name: Anonymous 2006-09-27 22:52

>>4
Will GCC really solve this problem then?  I know that, for some reason, it makes executables about a meg larger than executables produced by Visual Studio, but I know that visual studio seems to link to libraries unneccesarily.  I still cannot figure out by what magical process some of my programs require uuid.lib (which didn't come with VC++2005 express for some incredibly stupid reason) and other's don't.

Name: Anonymous 2006-09-27 23:05

>>5
Yes and no. I prefer the mingw (gcc-derived) toolchain over VC++, because most of these utilities expose what's going on underneath a lot better. I think the *nix way of doing things is a saner, and I find gcc's warning and error output useful.

Despite that, it's still not a cakewalk, particularly if you're chumming it up with win32-specific code. Development in Windows just isn't any fun.

You shouldn't notice that much difference in sizes, BTW. You must be thinking of cygwin, but most people using gcc in windows use mingw and derivatives. The projects I do vary between 150-500kb compiled.

Name: Anonymous 2006-09-28 1:04

>>6
So, what should I download?  SHould I get an IDE?  I really don't want to spend hours mucking around with downloading distribution binaries and stuff, I just want something that will work relatively well out of the box.  Some sort of drag and drop compiler would be nice...  But whatever would work, just give your best suggestions.

Name: Anonymous 2006-09-28 3:55

>>7
If you want an all-in-one distro, Code::Blocks is a start: http://prdownloads.sourceforge.net/codeblocks/codeblocks-1.0rc2_mingw.exe?download If you want to install additional libraries, click on Plugins -> Dev-C++ Devpack installer/updater

I'll warn you up-front though: starting your own project is a lot simpler than loading other people's. If you're a beginner at C or C++, you should not be poking at other people's projects.

Also remember that #including an include is not enough for a library. You need to tell the linker to include the appropriate library as well (project -> build options -> linker -> link libraries).

Name: Anonymous 2006-09-28 7:16

#including an include is not enough for a library
Not OP here, just BTW: This is a major design flaw. C should have had a way to specify required libraries and certain compilation options (which compilers may understand or not, but should attempt to not clash) in the source code (overrideable with compiler switches).

Name: Anonymous 2006-09-29 0:01

I'm really starting to think I should just stick with C#...

Name: Anonymous 2006-09-29 1:19

"javac -classpath . file.java"
"java -classpath . file"

geez

Name: Anonymous 2006-09-29 2:54

>>9
Pragmata. In Visual C++

#pragma comment(lib, "foo.lib")
#pragma optimize("t", on)

should be equivalent to linking again foo and passing /Ot to the compiler. Google indicates that this use of #pragma isn't unique to VC++. (Unfortunately, even the idiotic comment/lib pragma isn't unique.)

Name: Anonymous 2006-09-29 12:40

>>12
Does GCC support it?

Name: Anonymous 2006-09-29 17:38

>>13
Not AFAICT.

Name: Anonymous 2006-09-29 18:05

>>14
Problem.

Name: Anonymous 2006-09-30 13:38 (sage)

gcc sucks, gcc's optimization sucks, gcc's precompiled header support sucks, gcc's compilation speed sucks, gcc gives too many unnecessary warnings, gcc doesn't support useful pragmas, gcc doesn't support msvc's superior asm syntax, gcc sucks.

Name: Anonymous 2006-09-30 14:29

>>16
>gcc is awesome and i'm a script language user

fixed

Name: Anonymous 2006-09-30 19:14

>>16
GCC's optimization rocks. Warnings are great too; if your code produces too many warnings you fail. Pragma support sucks indeed. It's not "MSVC" syntax, it's Intel syntax and it's indeed superior, I don't know what are the GCC hippies thinking by supporting AT&T's piece of shit syntax. GCC overall rocks.

Name: Anonymous 2006-09-30 19:49

>>18
You can use a hybrid AT&T/Intel syntax with recent version of gas if you pass -masm=intel to GCC. It still has the %'s all over the place but at least the instructions have the right names and operands are in the right order.

Name: Anonymous 2006-10-01 21:20

GCC's optimization rocks.
It's so/so. You can't expect a portable compiler to do as well as Intel's.

if your code produces too many warnings you fail.
Yes indeed. Actually, it fails if it produces any warnings at all. If anything, -Wall isn't strict enough.

it's Intel syntax and it's indeed superior
Totally true. AT&T = complete lose. I swear they did that on purpose to keep people from using assembly.

Name: Anonymous 2006-10-02 3:48

>>20
Out of the free compilers, GCC's optimization is the only one that can, at least, be compared to Intel's, so I'm happy with it.

Name: Anonymous 2007-07-27 20:39 ID:wvTll2eF

Get the evaluation version of Visual Studio 2005, then use the special hack to get it to run forever.

Name: Anonymous 2007-07-27 21:06 ID:Heaven

>>22
Agree. OP should gb2/VB/.

Name: Anonymous 2007-07-27 22:48 ID:4JwkQVIC

Have you considered a functional language such as Haskell? Haskell can produce stand-alone binaries, and is generally easire to learn then C++

Name: Anonymous 2007-07-27 22:54 ID:cpQlyd3e

LLVM does a better job at optimization than GCC, although at the current time it's using the GCC front-end.

However, steps are being taken (by Apple?) to replace that front end with something faster and more flexible. I forget what it's called, but the compile-time of the current version supposedly rapes GCC (not hard, admittedly).

Name: Anonymous 2007-07-27 22:55 ID:cpQlyd3e

Ah, it's called "Clang": http://lists.cs.uiuc.edu/pipermail/llvmdev/2007-July/009817.html

Take a look at the presentation.

Name: Anonymous 2007-07-28 1:26 ID:Heaven

VERY VERY OLD THREAD

Name: Anonymous 2007-07-28 7:32 ID:6LLlQkh4

>>9

It's not a flaw in the design, it's just out of the design's scope.

Name: Anonymous 2007-07-28 7:48 ID:Heaven

>>27
Yeah, some troll has been reviving old threads.
Oh well, what do you expect? If there's some way to mess it up, they'll do it.

Name: Anonymous 2007-07-28 8:10 ID:4DHPXdIz

>>27
WELCOME TO THE PAST BITCH, FUCKING BUMp?

Name: Anonymous 2007-07-28 8:21 ID:Heaven

>>30
...and that's a 13 year old memer. Which is what 13 year olds do, cuz they can't do much else.

Name: Anonymous 2009-01-14 14:24

One word : the Forced Indentation Of Code

Name: Anonymous 2010-11-28 1:40

Name: Anonymous 2010-12-28 1:48

Name: Anonymous 2011-02-04 14:07

Name: Sgt.Kabu�耊kiman熿 2012-05-28 20:16

Bringing /prog/ back to its people
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List