Stream: Google Code-in

Topic: how compiling works


view this post on Zulip William Cook (Jan 07 2018 at 14:02):

Sorry I was asleep. I'm attempting to export the c++ files to JavaScript files.

view this post on Zulip William Cook (Jan 07 2018 at 14:15):

Or format them is a better word.

view this post on Zulip William Cook (Jan 07 2018 at 14:16):

It's not directly for a task. But I'm implementing the outcome on a task.

view this post on Zulip William Cook (Jan 07 2018 at 18:18):

@Sean Could u help me resolve this issue please.

view this post on Zulip William Cook (Jan 07 2018 at 18:19):

If you have time ofc :wink:

view this post on Zulip Rahil Malik (Jan 07 2018 at 18:20):

oops, sorry !

view this post on Zulip William Cook (Jan 07 2018 at 18:20):

pasted image

view this post on Zulip William Cook (Jan 07 2018 at 18:21):

That is the syntax of the command, when i execute it though it outputs the screenshot shown earlier in the msg history.

view this post on Zulip William Cook (Jan 07 2018 at 18:21):

pasted image

view this post on Zulip William Cook (Jan 07 2018 at 18:22):

That is the output of the command.

view this post on Zulip Sean (Jan 07 2018 at 18:35):

@Sean Could u help me resolve this issue please.

what you're trying to do is kind of a super advanced topic for a bit of code using Qt

view this post on Zulip Sean (Jan 07 2018 at 18:35):

on the surface, though, that's a simple header-not-found message from the compiler

view this post on Zulip Sean (Jan 07 2018 at 18:35):

which happens when you don't tell the compiler where headers are located

view this post on Zulip Sean (Jan 07 2018 at 18:36):

so ... tell the compiler where your header include directories are for Qt, and that error should go away

view this post on Zulip William Cook (Jan 07 2018 at 18:36):

So include the .h files also?

view this post on Zulip Sean (Jan 07 2018 at 18:37):

no...

view this post on Zulip Sean (Jan 07 2018 at 18:38):

how do you tell the compiler where your header include directories are?

view this post on Zulip William Cook (Jan 07 2018 at 18:38):

Im not using a compiler.

view this post on Zulip Sean (Jan 07 2018 at 18:38):

say I'm compiling some file.c

view this post on Zulip Sean (Jan 07 2018 at 18:38):

sure you are

view this post on Zulip William Cook (Jan 07 2018 at 18:38):

Ok im super confused lol.

view this post on Zulip Sean (Jan 07 2018 at 18:38):

sure you are ;)

view this post on Zulip vasugarg (Jan 07 2018 at 18:39):

@Sean i am kinda noob at this currently, so it would be helpful if you could tell me as what exactly was Cmake summary ?

view this post on Zulip Sean (Jan 07 2018 at 18:39):

@vasugarg please don't hijack topics -- make sure you post questions with the right subject ;)

view this post on Zulip Sean (Jan 07 2018 at 18:39):

otherwise it gets confusing

view this post on Zulip Sean (Jan 07 2018 at 18:39):

like this one being named (no topic)...

view this post on Zulip William Cook (Jan 07 2018 at 18:40):

pasted image

view this post on Zulip William Cook (Jan 07 2018 at 18:40):

So i need to reference the header files?

view this post on Zulip vasugarg (Jan 07 2018 at 18:40):

Ok @Sean

view this post on Zulip Sean (Jan 07 2018 at 18:41):

@William Cook no, and I have no idea what that paste is trying to show

view this post on Zulip Sean (Jan 07 2018 at 18:41):

@William Cook take a step back because you're missing some fundamental step

view this post on Zulip William Cook (Jan 07 2018 at 18:41):

Ok. Thanks

view this post on Zulip Sean (Jan 07 2018 at 18:42):

what is it that you're trying to do?

view this post on Zulip William Cook (Jan 07 2018 at 18:42):

Im trying to format cpp files as js files using clang++

view this post on Zulip William Cook (Jan 07 2018 at 18:44):

https://github.com/leaningtech/cheerp-meta/wiki/Getting-started

view this post on Zulip vasugarg (Jan 07 2018 at 18:45):

@Sean
http://brlcad.org/wiki/Compiling

view this post on Zulip Sean (Jan 07 2018 at 18:45):

you say "format cpp files", but clang++ is a compiler -- you're technically "compiling cpp files" and the output of that compilation is a transformation to javascript

view this post on Zulip Sean (Jan 07 2018 at 18:46):

wrong subject again :)

view this post on Zulip Sean (Jan 07 2018 at 18:46):

but now it kind of fits

view this post on Zulip William Cook (Jan 07 2018 at 18:46):

Yes Sean thats what im trying to do.

view this post on Zulip Sean (Jan 07 2018 at 18:47):

@William Cook so if you were to compile a file.cpp that had a #include "file.h", how does the compiler know where file.h is at?

view this post on Zulip vasugarg (Jan 07 2018 at 18:47):

So should i just do it in other one ?

view this post on Zulip vasugarg (Jan 07 2018 at 18:47):

General Help

view this post on Zulip vasugarg (Jan 07 2018 at 18:47):

?

view this post on Zulip Sean (Jan 07 2018 at 18:48):

@vasugarg it's fine either way now, but you need to be consistent so the conversation isn't fragmented across subjects

view this post on Zulip vasugarg (Jan 07 2018 at 18:48):

i thought this was related to compiling so . . .

view this post on Zulip vasugarg (Jan 07 2018 at 18:48):

sorry

view this post on Zulip Sean (Jan 07 2018 at 18:48):

it's fine, but you started the conversation somewhere esle

view this post on Zulip Sean (Jan 07 2018 at 18:48):

so imagine someone else reading this thread and seeing you paste a link to the compiling page

view this post on Zulip Sean (Jan 07 2018 at 18:48):

it makes no sense

view this post on Zulip vasugarg (Jan 07 2018 at 18:48):

i am actually having troubles with Zulips's ui

view this post on Zulip William Cook (Jan 07 2018 at 18:49):

Sean, so i need to move the QT library to the same file the cpp files are located?

view this post on Zulip Sean (Jan 07 2018 at 18:49):

@William Cook you already asked me that and the answer was no! :)

view this post on Zulip Sean (Jan 07 2018 at 18:49):

you've not answered my question

view this post on Zulip William Cook (Jan 07 2018 at 18:49):

I dont know the answer

view this post on Zulip Sean (Jan 07 2018 at 18:49):

how does the compiler know where headers are at?

view this post on Zulip Sean (Jan 07 2018 at 18:50):

so that's a very critical (and fundamental) piece of information that is getting in the way of you making progress

view this post on Zulip William Cook (Jan 07 2018 at 18:51):

Ok, I think i found an article with the answer

view this post on Zulip Sean (Jan 07 2018 at 18:51):

lets see it

view this post on Zulip William Cook (Jan 07 2018 at 18:51):

https://stackoverflow.com/questions/33780405/how-a-compiler-knows-from-a-header-file-that-a-source-file-exists-somewhere

view this post on Zulip Sean (Jan 07 2018 at 18:52):

so that page holds the answer

view this post on Zulip Sean (Jan 07 2018 at 18:52):

ironically the guy with 0 points has the better answer overall

view this post on Zulip Sean (Jan 07 2018 at 18:53):

see the response from "Cheers and hth. - Alf"

view this post on Zulip Sean (Jan 07 2018 at 18:53):

the checked response is okay, but missing some important points

view this post on Zulip William Cook (Jan 07 2018 at 18:53):

Ok sec, havent got that far lol

view this post on Zulip William Cook (Jan 07 2018 at 18:55):

So i could do -I <path>

view this post on Zulip William Cook (Jan 07 2018 at 18:55):

To include the qt library?

view this post on Zulip William Cook (Jan 07 2018 at 18:58):

@Sean

view this post on Zulip Sean (Jan 07 2018 at 19:01):

bingo ;)

view this post on Zulip Sean (Jan 07 2018 at 19:01):

-I is how you tell nearly all compilers where to find headers that are not in standard search locations

view this post on Zulip William Cook (Jan 07 2018 at 19:01):

Ok good, and where is the QT library located?

view this post on Zulip Sean (Jan 07 2018 at 19:01):

standard search locations include system directories like /usr/include and local directories (like your current directory)

view this post on Zulip Sean (Jan 07 2018 at 19:01):

you tell me

view this post on Zulip Sean (Jan 07 2018 at 19:01):

I didn't install it :)

view this post on Zulip Sean (Jan 07 2018 at 19:02):

there's probably another stack overflow asking that ;)

view this post on Zulip William Cook (Jan 07 2018 at 19:02):

Ok i think i got it, thank you so much :wink:

view this post on Zulip William Cook (Jan 07 2018 at 19:08):

pasted image

view this post on Zulip William Cook (Jan 07 2018 at 19:09):

Now it cant find these files even after including QT library.

view this post on Zulip William Cook (Jan 07 2018 at 19:10):

Do the files need to be contained in " instead of <>?

view this post on Zulip William Cook (Jan 07 2018 at 19:10):

Wait dont answer yet, i think i know

view this post on Zulip Mahdi (Jan 07 2018 at 19:10):

Im not using a compiler.

This made my day.

view this post on Zulip William Cook (Jan 07 2018 at 19:11):

I'm a noob lol

view this post on Zulip Sean (Jan 07 2018 at 19:11):

just FYI ... it's almost always useless to paste error messages without pasting the command or action that preceded the errors --- i.e., what YOU did that resulted in an error

view this post on Zulip Sean (Jan 07 2018 at 19:12):

seeing error is only magic / mystery / a problem because you've not yet learned or tried to read what they're telling you

view this post on Zulip William Cook (Jan 07 2018 at 19:12):

Oh ok

view this post on Zulip Sean (Jan 07 2018 at 19:12):

but focusing on the error without reading what it says and without relating that to what you did means you won't learn

view this post on Zulip William Cook (Jan 07 2018 at 19:12):

Im sorry.

view this post on Zulip Sean (Jan 07 2018 at 19:13):

don't be sorry ... just trying to help you learn how to learn what all these things mean

view this post on Zulip William Cook (Jan 07 2018 at 19:13):

Oh ok, thank you.

view this post on Zulip Sean (Jan 07 2018 at 19:13):

we've nearly all been there at some point

view this post on Zulip Mahdi (Jan 07 2018 at 19:13):

It's all good to be a noob -- we all get better. But I do think what you're trying to do is really difficult and that you might learn more if you start off with some other task

view this post on Zulip William Cook (Jan 07 2018 at 19:14):

This isn't directly a task

view this post on Zulip Sean (Jan 07 2018 at 19:14):

the point is to learn, though -- when you see an error -- google it at a minimum, or ask stack overflow and READ ... lots and lots of reading

view this post on Zulip Mahdi (Jan 07 2018 at 19:14):

I meant task in a general sense sorry

view this post on Zulip Sean (Jan 07 2018 at 19:14):

yeah, you're not going to suddenly show a qt GUI in the browser

view this post on Zulip Sean (Jan 07 2018 at 19:15):

that's not how this all works ;)

view this post on Zulip William Cook (Jan 07 2018 at 19:15):

Ok lol

view this post on Zulip William Cook (Jan 07 2018 at 19:46):

pasted image

view this post on Zulip William Cook (Jan 07 2018 at 19:46):

I googled it but cant find it

view this post on Zulip William Cook (Jan 07 2018 at 19:48):

Wait, im stupid

view this post on Zulip William Cook (Jan 07 2018 at 19:48):

I got it lool

view this post on Zulip Mahdi (Jan 07 2018 at 19:49):

What did you do?

view this post on Zulip Rahil Malik (Jan 07 2018 at 19:49):

nah, man don't say that :laughing:

Wait, im stupid

view this post on Zulip William Cook (Jan 07 2018 at 19:49):

Having trouble finding the files that are listed in that screenshot

view this post on Zulip Mahdi (Jan 07 2018 at 19:49):

No I mean what did you do to resolve it lol

view this post on Zulip William Cook (Jan 07 2018 at 19:50):

I didnt, i thought i did lol

view this post on Zulip Sean (Jan 07 2018 at 19:50):

looks like you need some more -I paths

view this post on Zulip William Cook (Jan 07 2018 at 19:50):

I know sean, im trying to find the paths to list though xD

view this post on Zulip Sean (Jan 07 2018 at 19:50):

though <cmath> is a system header -- so that's probably related to the translation capabilities

view this post on Zulip William Cook (Jan 07 2018 at 19:51):

Oh ok

view this post on Zulip Rahil Malik (Jan 07 2018 at 19:51):

@Sean , if you are free , can you review my task at google Code-in .But its totally up t0 you ;)

view this post on Zulip Sean (Jan 07 2018 at 19:51):

you're hijacking a task :P

view this post on Zulip Sean (Jan 07 2018 at 19:51):

and tasks are always reviewed in order

view this post on Zulip Sean (Jan 07 2018 at 19:51):

i've had to say that a surprising number of times this year :)

view this post on Zulip William Cook (Jan 07 2018 at 19:52):

Lol

view this post on Zulip Mahdi (Jan 07 2018 at 19:52):

Zulip allows for bots right? You could make a task for a student to make a bot that says that whenever they ask for a task to be reviewed :)

view this post on Zulip Rahil Malik (Jan 07 2018 at 19:53):

Actually, Only 8 days are left for this competition & I have my exams going on too, so i have made some tasks in advance :)

view this post on Zulip Mahdi (Jan 07 2018 at 19:55):

@Sean is it still anyone's game at this point?

view this post on Zulip Sean (Jan 07 2018 at 19:56):

I try not to pay attention to that until the end, focus on being usefully productive

view this post on Zulip Sean (Jan 07 2018 at 19:56):

I think there's at least a half dozen contending really well

view this post on Zulip William Cook (Jan 07 2018 at 19:56):

Me maybe lol

view this post on Zulip William Cook (Jan 07 2018 at 19:57):

Jk ive been practically useless

view this post on Zulip William Cook (Jan 07 2018 at 19:59):

I really want to figure out how to do this

view this post on Zulip William Cook (Jan 07 2018 at 19:59):

I mean my overall goal, not this individual goal lol

view this post on Zulip Mahdi (Jan 07 2018 at 20:00):

What exactly are you doing though? From what I understood you essentially want to create an interpreter

view this post on Zulip William Cook (Jan 07 2018 at 20:00):

No, im wanting to make an interactive demo of LibreCAD to put on the site

view this post on Zulip Mahdi (Jan 07 2018 at 20:01):

Are you using Qtwebkit?

view this post on Zulip William Cook (Jan 07 2018 at 20:02):

No, I was trying to use cheerp in order to compile the c++ files as javascript files but its not working correctly

view this post on Zulip William Cook (Jan 07 2018 at 20:03):

I've investigated multiple options, such as cloud basing LibreCAD and running it from their, ive tried using a windows emulator on the site, ive tried converting the c++ to webassembly, etc

view this post on Zulip William Cook (Jan 07 2018 at 20:06):

Im also working though alot of hardship, my cousin took his own life on christmas, my aunt died of copd on the same day, and on top of all of that my dad has been given only a few weeks to live. Im stressing out nonetheless.

view this post on Zulip Sean (Jan 07 2018 at 20:07):

i'm sorry to hear all that

view this post on Zulip Mahdi (Jan 07 2018 at 20:08):

We're here for you man

view this post on Zulip William Cook (Jan 07 2018 at 20:08):

Its fine : )

view this post on Zulip William Cook (Jan 07 2018 at 20:08):

Coding is my escape, only problem is im bad at it lol

view this post on Zulip Sean (Jan 07 2018 at 20:08):

view this post on Zulip Mahdi (Jan 07 2018 at 20:09):

I used to be bad at coding.

view this post on Zulip Rahil Malik (Jan 07 2018 at 20:09):

No, you are not , everybody develops and you are already progressing great

view this post on Zulip Mahdi (Jan 07 2018 at 20:09):

Now I'm escaping, too.

view this post on Zulip William Cook (Jan 07 2018 at 20:09):

Im finished with the site, im just waiting to submit it till last minute so i have a chance to try and implement the program demo

view this post on Zulip Sean (Jan 07 2018 at 20:10):

@William Cook I can't imagine the stress of all that, but if you need help, you should ask for it, ask to see a professional -- there are people that can help

view this post on Zulip William Cook (Jan 07 2018 at 20:10):

U mean a doctor?

view this post on Zulip Mahdi (Jan 07 2018 at 20:10):

Probably a therapist

view this post on Zulip William Cook (Jan 07 2018 at 20:11):

Eh, they only put me on medicine, the only time they actually talk is when i was hospitilized.

view this post on Zulip William Cook (Jan 07 2018 at 20:15):

Ok this is my final attempt using emscripten.

view this post on Zulip William Cook (Jan 08 2018 at 08:26):

(deleted)

view this post on Zulip William Cook (Jan 08 2018 at 10:06):

pasted image

view this post on Zulip William Cook (Jan 08 2018 at 10:07):

Im stuck, i included qt libraries and the h files

view this post on Zulip William Cook (Jan 08 2018 at 10:15):

Wait, i might have got it

view this post on Zulip William Cook (Jan 08 2018 at 10:43):

pasted image

view this post on Zulip William Cook (Jan 08 2018 at 18:48):

Hi @Sean

view this post on Zulip Naseef (Jan 11 2018 at 06:39):

Is Clang very different from GCC? Can we compile same program on any compiler without code changes? Is there any performance differences between Clang and GCC?

view this post on Zulip Naseef (Jan 11 2018 at 06:44):

I'm going to build BRL-CAD with clang. I know there is a task about this, But I feel bad for doing too many compiling tasks. So I'm doing this on my own. :D

view this post on Zulip Naseef (Jan 11 2018 at 07:59):

Clang is surprisingly fast! It took me about 1.5 hours to build BRL-CAD with GCC, But just 32 mins and 2 seconds with Clang.

view this post on Zulip Sean (Jan 12 2018 at 16:59):

those two compilers are very similar in behavior, but implemented very differently.


Last updated: Oct 09 2024 at 00:44 UTC