This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

warning: no suitable entry-point found; setting to 0

I'm getting this error when I compile and link an application with the cl6x compiler.  I can compile the application perfectly fine using codesourcery's gcc.  Here's what happens when I try to build the code

 

/opt/TI/C6000CGT7.3.0B3/bin/cl6x  -O2  -g -c   -I/opt/TI/C6000CGT7.3.0B3/include --obj_extension=.o --abi=eabi  -I./VAGenerated -I./LayoutSupport/Include -I./Drivers -I./Drivers/Audio -I../VisualDSP_213xx/Include -I../LinearAcoustic_Modules/Include -I/home/sharkllama/Projects/BolomSummer2011/Linux/Standard_Modules/StandardPack/Include -I/home/sharkllama/Projects/BolomSummer2011/Linux/Standard_Modules/ControlRatePack/Include -I/home/sharkllama/Projects/BolomSummer2011/Linux/LinearAcoustic_Modules/Include  main.c -o main.o

>> WARNING: object file specified, but linking not enabled

[main.c]

"main.c", line 57: warning: incompatible redefinition of macro "MAX" (declared at line 54 of "Basic.h")

"main.c", line 58: warning: incompatible redefinition of macro "MIN" (declared at line 50 of "Basic.h")

"main.c", line 121: warning: variable "i" was declared but never referenced

"main.c", line 121: warning: variable "n" was declared but never referenced

"main.c", line 122: warning: variable "inputBuffer" was declared but never referenced

"main.c", line 122: warning: variable "outputBuffer" was declared but never referenced

"main.c", line 120: warning: function "main" was declared but never referenced

/opt/TI/C6000CGT7.3.0B3/bin/cl6x  -O2  -g -c   -I/opt/TI/C6000CGT7.3.0B3/include --obj_extension=.o --abi=eabi  -I./VAGenerated -I./LayoutSupport/Include -I./Drivers -I./Drivers/Audio -I../VisualDSP_213xx/Include -I../LinearAcoustic_Modules/Include -I/home/sharkllama/Projects/BolomSummer2011/Linux/Standard_Modules/StandardPack/Include -I/home/sharkllama/Projects/BolomSummer2011/Linux/Standard_Modules/ControlRatePack/Include -I/home/sharkllama/Projects/BolomSummer2011/Linux/LinearAcoustic_Modules/Include  preset.c -o preset.o

>> WARNING: object file specified, but linking not enabled

[preset.c]

"../VisualDSP_213xx/Include/builtins.h", line 3: warning: unrecognized #pragma

"preset.c", line 36: warning: unrecognized preprocessing directive

"preset.c", line 41: warning: unrecognized preprocessing directive

/opt/TI/C6000CGT7.3.0B3/bin/ar6x -r ./platformFileIO.lib ./Lib/*.o

  ==>  building archive './platformFileIO.lib'

ranlib ./platformFileIO.a

Building target: platform_file_io

/opt/TI/C6000CGT7.3.0B3/bin/cl6x  -g   --run_linker --output_file=platform_file_io  main.o DoControlCode.o preset.o   --library=platformFileIO.lib --library=/opt/TI/C6000CGT7.3.0B3/lib/rts6600_elf.lib 

<Linking>

warning: no suitable entry-point found; setting to 0

 

 

So, I'm at a loss on how to explain this.  I've declared a static void main() function that is never referenced, and thus the linker does not have any idea where to being executing the code.  Has anyone else encountered this issue?

Thanks, 

-Brant

  • Brant,

    You may have gotten a quicker and more accurate or complete answer if this were posted to the TI C/C++ Compiler Forum rather than to a silicon/hardware forum. This thread will be moved there shortly.

    It looks like you wrote the command lines that are used above. Is that correct? You would not get the first warnings about object files from a CCS-generated build, unless there is something strange and new with the CodeGen tools you are using. If you applied gcc syntax to the TI tools, you might expect different behavior. And the warnings should give you a good idea as to where the problem is, such as "-o main.o".

    Are you trying to do your own Linux port onto a C66x? Or is this from an example Linux port to the device you are using?

    Regards,
    RandyP

  • You assume the TI compiler abides by the command line conventions of Unix-style compiler such as gcc.  It does not.  

    For instance, the option -o is not used to specify the name of the output object file.  Instead, it indicates the use of optimization at the default level of 2.  That is, it is equivalent to the -O2 you are already using.  That is why you get the Warning.  Just drop the "-o main.o" part of those compile commands.

    If you want to build for a C6600 device, then you need to add the compile option -mv6600.

    To get the link command to work, add --rom_model after the option --run_linker.  That option, among other things, tells the linker to abide by C linking conventions, one of which is that the symbol c_int00 is the entry point.  That symbol is defined by the boot routine found in the compiler RTS library.  Consult the compiler book for more information on --rom_model.

    Thanks and regards,

    -George

     

  • Hi George, 

      Thanks the helpful hints.  I've ran into another issue after modifying my makefile as you suggested.  Here's what I'm dealing with now:

    Building target: platform_file_io

    /opt/TI/C6000CGT7.3.0B3/bin/cl6x     --run_linker --rom_model --output_file=platform_file_io  main.o DoControlCode.o preset.o   --library=platformFileIO.lib --library=/opt/TI/C6000CGT7.3.0B3/lib/rts6600_elf.lib 

    <Linking>

     

     undefined first referenced                                          

      symbol       in file                                               

     --------- ----------------                                          

     main      /opt/TI/C6000CGT7.3.0B3/lib/rts6600_elf.lib<args_main.obj>

     

    error: unresolved symbols remain

    error: errors encountered during linking; "platform_file_io" not built

    Main is definitely declared in the main.o object file.  Am I using the right rts library?  
    Still Confused, 
    -Brant

  • Let's see if main.o really does define the symbol "main".  Use the names utility nm6x.  You should see output similar to this

    C:\dir>nm6x -g main.o | find "main"
    00000000 D __TI_DW.debug_info.main.c.7bffc833b8
    00000000 D __TI_DW.debug_info.main.c.867fef9779
    00000000 T main
    

    That "T" means main is a global symbol defined in main.o.  

    Thanks and regards,

    -George

  • Wow, 

      Thanks George!  Here's the output of  nm6x -g main.o 

     

     

    sharkllama@quaaludes:~/Projects/BolomSummer2011/Linux/Platform_FileIO$ nm6x -g main.o 

    00000000 D AMFMaster

    00000000 U Layout1

    00000000 D __TI_DW.debug_info.$base_types.818fdb3f7357fc6614ab072ea683b469

    00000000 D __TI_DW.debug_info.../LinearAcoustic_Modules/Include/AMF_AGC.h.755dcbaba301a0593be767a7cff0f385

    00000000 D __TI_DW.debug_info.../LinearAcoustic_Modules/Include/AMF_AMXControl.h.7deda821d45ac05c1c4d9d225331a65f

    00000000 D __TI_DW.debug_info.../LinearAcoustic_Modules/Include/AMF_DcBlocker.h.49690aac9070f365ba74b61cfccb4a4b

    00000000 D __TI_DW.debug_info.../LinearAcoustic_Modules/Include/AMF_GetPeak.h.811781c3d5021093f68b752db252db3f

    00000000 D __TI_DW.debug_info.../LinearAcoustic_Modules/Include/AMF_InAgcFilter.h.70e7e4088c9f88389c5d90fa41c7ca49

    00000000 D __TI_DW.debug_info.../LinearAcoustic_Modules/Include/AMF_InputAGC.h.9e9551af3affa50c63d0461c2c82aa43

    00000000 D __TI_DW.debug_info.../LinearAcoustic_Modules/Include/AMF_NatlFloat.h.f4a0fc1ffa71e29f20e6a3d0b201b366

    00000000 D __TI_DW.debug_info.../LinearAcoustic_Modules/Include/AMF_PEQ.h.c097258d6e4a640caacc1714c00a7af0

    00000000 D __TI_DW.debug_info.../LinearAcoustic_Modules/Include/AMF_SoftClipper.h.1cf72054e97bba7ebbdb08ae9038e165

    00000000 D __TI_DW.debug_info../LayoutSupport/Include/AMF_Copier.h.f4c787a5e06145be46e5683b93770d33

    00000000 D __TI_DW.debug_info../LayoutSupport/Include/AMF_Copier_C.h.52a4dd84787382ba87dfa091aef1d9fb

    00000000 D __TI_DW.debug_info../LayoutSupport/Include/AMF_Copier_S.h.6b7ba5f5495085e5fa48f239db5f20cb

    00000000 D __TI_DW.debug_info../LayoutSupport/Include/AudioProcessing.h.12f337f29dad03df7d980fc42816aa06

    00000000 D __TI_DW.debug_info../LayoutSupport/Include/Layout.h.43b92b9f459fe09394ba49b636bcd632

    00000000 D __TI_DW.debug_info../LayoutSupport/Include/Tuning.h.74a092e6676cf1c6c0a574b2b672455a

    00000000 D __TI_DW.debug_info../LayoutSupport/Include/Tuning_Defines.h.c0d3b0d40e6a1fd8f50283c9bb84be10

    00000000 D __TI_DW.debug_info./home/sharkllama/Projects/BolomSummer2011/Linux/Standard_Modules/StandardPack/Include/AMF_Adder2x1.h.f38f1ca36935723e9ed3c70cd73711c7

    00000000 D __TI_DW.debug_info./home/sharkllama/Projects/BolomSummer2011/Linux/Standard_Modules/StandardPack/Include/AMF_Biquad.h.5e834cf8a34de56c18b8485939a5658a

    00000000 D __TI_DW.debug_info./home/sharkllama/Projects/BolomSummer2011/Linux/Standard_Modules/StandardPack/Include/AMF_BiquadSmoothed.h.03a58cea8f9f5a4f14707bfb10b5a0d1

    00000000 D __TI_DW.debug_info./home/sharkllama/Projects/BolomSummer2011/Linux/Standard_Modules/StandardPack/Include/AMF_MixerNxM.h.a8b152e533d06a22b8ab44bf11c89c73

    00000000 D __TI_DW.debug_info./home/sharkllama/Projects/BolomSummer2011/Linux/Standard_Modules/StandardPack/Include/AMF_MuxNx1.h.7d1425f9c446fb5130f7c6d0724567c7

    00000000 D __TI_DW.debug_info./home/sharkllama/Projects/BolomSummer2011/Linux/Standard_Modules/StandardPack/Include/AMF_PeakHold.h.c4dcca4123308710f568eb28c7b24976

    00000000 D __TI_DW.debug_info./home/sharkllama/Projects/BolomSummer2011/Linux/Standard_Modules/StandardPack/Include/AMF_Scaler.h.d8e666958a37945af0355bc88ace5ef1

    00000000 D __TI_DW.debug_info./opt/TI/C6000CGT7.3.0B3/include/signal.h.48df66c1340df1573a4691072c08bdbc

    00000000 D __TI_DW.debug_info./opt/TI/C6000CGT7.3.0B3/include/stdarg.h.2769502f4cc899dfd6220bd21d127714

    00000000 D __TI_DW.debug_info./opt/TI/C6000CGT7.3.0B3/include/stdbool.h.94fcdbd5fbc385ecc5057b316e8842a8

    00000000 D __TI_DW.debug_info./opt/TI/C6000CGT7.3.0B3/include/stdio.h.0db9b716e10a0d3d6b2487cd3f7f5361

    00000000 D __TI_DW.debug_info./opt/TI/C6000CGT7.3.0B3/include/stdlib.h.0c4ce5ea22a4cfff9d86e6ff4bacd063

    00000000 D __TI_DW.debug_info./opt/TI/C6000CGT7.3.0B3/include/string.h.bea18fefa213b9f24b945b26b2254747

    00000000 D __TI_DW.debug_info./opt/TI/C6000CGT7.3.0B3/include/yvals.h.fa7b56e1ee35168c1c4a6c5afcc1e2be

    00000000 D __TI_DW.debug_info.AudioIOModes.h.e548915e2599dabdcc918f16b99483d3

    00000000 D __TI_DW.debug_info.main.c.2b1fb07eded729d18598acbefc6a32ba

    00000000 D __TI_DW.debug_info.main.c.613732f39b465cd4d91608121e56279a

    00000000 D __TI_DW.debug_info.main.c.97d9298440b6515110f27d0be848e7b5

    00000000 D __TI_DW.debug_info.main.c.f9bbb13ae79ab08064ab6fe116452fc2

    00000000 D layouts

    And here's my main function declaration from main.c
    static void main( int argc, char *argv[] ){}
    I'm at a loss here George, I get a couple of warnings when I compile main.c, the only one which seems relevant is the following:
    "main.c", line 120: warning: function "main" was declared but never referenced
    How can I get the global symbol for this function defined in main.o?
    Thanks, 
    -Brant

     

  • In C, main should not be declared static.

  • Wow, 

       It was that simple.  That is an artifact of my Java programming.  Thanks for your help everyone!

    -Brant