MOD54415 Compiler "undefined for this scope"

Discussion to talk about software related topics only.
jediengineer
Posts: 192
Joined: Mon Dec 17, 2012 6:24 am

Re: MOD54415 Compiler "undefined for this scope"

Post by jediengineer »

I think I get it -so what's the easiest way to pass upkt? isn't that a method? I know how to pass variables, but extending a method is a little foreign to me.
User avatar
dciliske
Posts: 624
Joined: Mon Feb 06, 2012 9:37 am
Location: San Diego, CA
Contact:

Re: MOD54415 Compiler "undefined for this scope"

Post by dciliske »

The declaration of a function/method contains information about it and what it does.

Let's examine the definition for UdpReaderMain

Code: Select all

void UdpReaderMain(void * pd)
What does this line tell us? The first 'void' (the one before) 'UdpReaderMain' is the return type. It tells us (and the compiler) what type of data the function returns (if it returns any). In the case of 'void', the function returns nothing. The next segment 'UdpReaderMain' tells us the name of the function we're defining. Finally the chunk inside the parenthesis tells us what arguments the function takes. In this case it takes a single argument which is a pointer to a void type, aka any type.

Now, to pass the 'upkt' as an argument, you'll need to add to the definition of the DataHandler 'UDPPacket upkt' as an argument, and change your invocation to pass 'upkt'.
Dan Ciliske
Project Engineer
Netburner, Inc
User avatar
tod
Posts: 587
Joined: Sat Apr 26, 2008 8:27 am
Location: Southern California
Contact:

Re: MOD54415 Compiler "undefined for this scope"

Post by tod »

I'll just cut and paste code into this window instead.
Please don't. If it's really large and you're company blocks gist, then work for another company. Seriously, if you you're blocked then attaching a file is a better alternative.
jediengineer
Posts: 192
Joined: Mon Dec 17, 2012 6:24 am

Re: MOD54415 Compiler "undefined for this scope"

Post by jediengineer »

Dciliske - thanks for the info - that was a great help! I actually was able to get everything to work! Many thanks!!

Tod - I appreciate the candor, and no disrespect intended, but quitting my job because of a security policy is not exactly a solution. But I know you meant well, and thanks for the help! I did however, after a lengthy discussion with IT and my boss, got them to unblock gist on my computer and will try to remember to use it when I can.
Post Reply