codeapp
codeapp copied to clipboard
Trouble in separating functions and declarations.
After receiving your email that local C/C++ complier is available yesterday, I tried to finish my homework with it. But here are some problems.
When I tried to separate functions and declarations by writing them in separate documents (.h & .cpp), It appeared doesn’t work. From the command I guess it might be a link error, but I have no idea how to fix it.
Here are some pictures of this problem.



Hello. For multi-file program, you'll need to compile each file individually and link them together. In your case, you'll need to use the following commands.
clang++ main.cpp -c
clang++ func.cpp -c
clang++ main.o func.o
and use ./a.out to execute.
Let me know if it works.
Hello. For multi-file program, you'll need to compile each file individually and link them together. In your case, you'll need to use the following commands.
clang++ main.cpp -c clang++ func.cpp -c clang++ main.o func.oand use
./a.outto execute.Let me know if it works.
Thank you so much for it does work! But I wonder if you could make this app do this job automatically in the future? And I also find a small bug. When I typed words below and finished, the keyboard doesn't appear up in the document so I can't edit the document.
Great! I'm glad it worked. I will try to fix this problem in the next release.
Great! I'm glad it worked. I will try to fix this problem in the next release.
thank you so much
Hi, it seems I have the same issue coding in C. I would guess the commands are different than the one used for C++. Can you help me ?
Hi, it seems I have the same issue coding in C.
I would guess the commands are different than the one used for C++.
Can you help me ?
Replace clang++ with clang. Clang++ is for compiling C++ programs.
Thank you, I am getting these warnings.
Do you now what they are about ?
Actually, I just forgot to execute the program the way you showed. It is working just fine. Thanks a lot !