It's UWAweek 42 (2nd semester, week 12)

help2002

This forum is provided to promote discussion amongst students enrolled in CITS2002 Systems Programming.
Please consider offering answers and suggestions to help other students! And if you fix a problem by following a suggestion here, it would be great if other interested students could see a short "Great, fixed it!"  followup message.
Displaying the 10 articles in this topic
Showing 10 of 738 articles.
Currently 177 other people reading this forum.


 UWA week 38 (2nd semester, week 8) ↓
SVG not supported

Login to reply

👍?
helpful
9:58pm Thu 19th Sep, Prem P.

hello my code creates the converted file and when I compile it manually it works. But when I automate it, its not working.


SVG not supported

Login to reply

👍?
helpful
10:21pm Thu 19th Sep, Joshua N.

"Prem Patel" <23*7*2*1@s*u*e*t*u*a*e*u*a*> wrote:
> hello my code creates the converted file and when I compile it manually it works. But when I automate it, its not working.
Could be anything. Need more information. A common error is people don't pass the correct path to the file in execv or system. So, they try to compile a file that "doesn't exit" and so compilation fails.


SVG not supported

Login to reply

👍?
helpful
10:56pm Thu 19th Sep, Prem P.

its giving me this error: Undefined symbols for architecture arm64: "_printsum", referenced from: _main in translated_code-70c787.o ld: symbol(s) not found for architecture arm64 But the thing is when I am manually doing it, its giving the outputs.


SVG not supported

Login to reply

👍?
helpful
6:54am Fri 20th Sep, Joshua N.

"Prem Patel" <23*7*2*1@s*u*e*t*u*a*e*u*a*> wrote:
> its giving me this error: Undefined symbols for architecture arm64: > "_printsum", referenced from: > _main in translated_code-70c787.o > ld: symbol(s) not found for architecture arm64 > > But the thing is when I am manually doing it, its giving the outputs.
Are you compiling on Linux or mac? Do you mean manually compiling and running the file or do you mean manually just running the file?


SVG not supported

Login to reply

👍?
helpful
6:58am Fri 20th Sep, Joshua N.

"Prem Patel" <23*7*2*1@s*u*e*t*u*a*e*u*a*> wrote:
> hello my code creates the converted file and when I compile it manually it works. But when I automate it, its not working.
Perhaps you're not using the right command to compile it? Is the command exactly the same as what you are writing to the terminal?


SVG not supported

Login to reply

👍?
helpful
6:58am Fri 20th Sep, Joshua N.

"Prem Patel" <23*7*2*1@s*u*e*t*u*a*e*u*a*> wrote:
> its giving me this error: Undefined symbols for architecture arm64: > "_printsum", referenced from: > _main in translated_code-70c787.o > ld: symbol(s) not found for architecture arm64 > > But the thing is when I am manually doing it, its giving the outputs.
Wait ".o" is an object file not an executable. You aren't compiling it correctly.


SVG not supported

Login to reply

👍?
helpful
7:10am Fri 20th Sep, Prem P.

I’ve put the same thing which I was using to compile manually so like cc -o final translated_code.c translated_code1.c


SVG not supported

Login to reply

👍?
helpful
7:26am Fri 20th Sep, Joshua N.

"Prem Patel" <23*7*2*1@s*u*e*t*u*a*e*u*a*> wrote:
> I’ve put the same thing which I was using to compile manually so like cc -o final translated_code.c translated_code1.c
Firstly, remember that you need to submit 1 c source file. So, you need to merge these files together. The error you are getting usually mean you are trying to compile an object file. In other words a file with the ".o" extension. Object files are used when compiling multiple files together. If you want to compile two files together you need to "include" the other file in the main file. Usually the easiest way is to define a header file and then use a make file. However, you can't submit a header file or the second file or a make file so you need to merge the files together. This will fix the issue. I would describe how to compile two separate files, but I don't want people doing that since it goes against the requirement of the project. Just write one file to the other and compile a single file.


SVG not supported

Login to reply

👍?
helpful
10:33am Fri 20th Sep, Prem P.

I have made a function which combines it, and it works but when I add it to the actual code, it is giving an error with one of the files. Another question is, I won't use the old way to compile but I don't understand why I wasnt working when I made the system write the execution. But when I wrote it in the terminal it works.


SVG not supported

Login to reply

👍?
helpful
12:18pm Fri 20th Sep, Joshua N.

"Prem Patel" <23*7*2*1@s*u*e*t*u*a*e*u*a*> wrote:
> I have made a function which combines it, and it works but when I add it to the actual code, it is giving an error with one of the files. Another question is, I won't use the old way to compile but I don't understand why I wasnt working when I made the system write the execution. But when I wrote it in the terminal it works.
I can't be 100% sure. If I had to guess it would have something to do with the compiler you are using. E.g. mac vs linux. gcc is more particular wants things done a certain why. I think clang is more lenient. Or in other words I think you are using different compiler for the manual compiling vs the automatic compiling. So, in other words the one that works figures out what you mean and the other one that doesn't wants you to explicitly state what you want.

The University of Western Australia

Computer Science and Software Engineering

CRICOS Code: 00126G
Written by [email protected]
Powered by history
Feedback always welcome - it makes our software better!
Last modified  8:08AM Aug 25 2024
Privacy policy