error in calling a non-predefined function


#1

platform:
OpenAT 3.02
GCC compiler
MS Visual C++ 6.0

#include "adl_global.h"


void my-func(void);

u32 wm_apmCustomStack [ 4096 ];
const u16 wm_apmCustomStackSize = sizeof ( wm_apmCustomStack );


void adl_main ( adl_InitType_e  InitType )
{

	my_func();

}

void my-func(void)
{
//do nothing
}

as seen in code I called a non - defined function, Compilation output is so stupid:

look at the error more closely:

no idea about the in which line the error is!

how can I fix this problem?

I can easily find the source of error here but I can’t do anything when code grows upto 3000 lines!

is there an setup in GCC or SDK at wmnew or wmmake options to show detailed error place?

Thanks in advance


#2

Hello,

You have a link error, please look into the gcc_Hello_World_32_err_lnk file. (the problem is probably the edlib libary)

tom


#3

I think tomalex didn’t understand exactly what I asked

look at my code please:

#include "adl_global.h"


void my-func(void);

u32 wm_apmCustomStack [ 4096 ];
const u16 wm_apmCustomStackSize = sizeof ( wm_apmCustomStack );


void adl_main ( adl_InitType_e  InitType )
{

   my_func();

}

void my-func(void)
{
//do nothing
}

I didn’t call anything related with the edLib, The problem is compiler does not give exact error place if I call a non-existed function. I know there will occur a link error but I need to know the line number of error!


#4

Hello,

Yes, not the edlib libary. That was available moreover:

(Libraries available in out directory :
gcc_eDLib_302.lib, gcc_wmadl_302.b03.lib, )

But if you would look into the the gcc_Hello_World_32_err_lnk you should see the answer for your question.

I don’t know how to setup the SDK to output directly the error on the compiler window.

tom


#5

Hi it looks like the declaration of this function is: void my-func(void);
and the call is: my_func();

notice that there is an underline on the second one…

best regards, Sérgio


#6

fernando u are very smart :smiley:
I know I called the wrong function to illustrate the problem!!!
What do you offer me if I had done the same mistake in a 4000 lines code, which utilizies many other libraries (created by me) ? I want the compiler to show exact errror line!!!

Tomalex, I couldn’t see any answer in .lnk file, I also searched other output files in project directory!

Thanks in advance


#7

Hello,

Please look at the appliname_err_lnk.temp file again.
Start inspecting the file from the end or search for ''link errors" expression and you should see the problem. (in case of your example undefined reference to “my_func” with the exact location)

tom


#8

EXCELLENT work tomalex :smiley:
it works


#9

What a shame! :blush: I should have payed more attention to the discussion. I have to say thowgh that my plataform is exatly the same as yours and the complier output was the folowwing:

--------------------Configuration: Rastel - Win32 Wismo_Target--------------------


Software Generation Toolkit

SGT_VER = v1.2.11
SGT_DIR = /cygdrive/C/OpenAT/Tools/SGT/v1.2.11
Scripts path for SGT :
/cygdrive/C/OpenAT/Tools/SGT/v1.2.11/script_sgt

Type help_sgt for a list of SGT commands


Check environment settings…

Launch a full library or binary process

… Compiling appli.c

appli.c:4: parse error before ‘-’ token
appli.c:17: parse error before ‘-’ token
make: *** [appli.o] Error 1

Build an X-MODEM binary  : 'gcc_Rastel_32.wpb.dwl'

… Convert gcc_Rastel_32.wpb in X-MODEM format …

genBin : Version v1a06 Copyright © WAVECOM
genBin : No Error

… Build gcc_Rastel_32.wpb.dwl …



Find errors occurred when using SGT

Analyze errors in Log files

WARNING : misc_status.log is incomplete. Check manually if any errors exist

Analyze errors in tmp files if they exists.


Libraries available in out directory :
gcc_eDLib_302.lib, gcc_wmadl_302.b03.lib,


End process.

Rastel - 3 error(s), 1 warning(s)

as you can see, there is an indication of the line, where the error is.

Sérgio