- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello i am using NIOS2 SBT 11.0sp1 and i am trying make a new project with existing source code.
When i select new project & bsp from template choosing hello world everything compiles and work. When i select new project & bsp from template choosing blank project and then adding my header files (properties -> application properties-> application libraries and inclues) and my source code (properties -> c/c++ builder path -> c/c++ source code) i get an undefined reference to main error pointing to the alt_main file in the bsp/hal/src folder Any suggestions?Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please refer to Nios II Developer's Handbook, page 6-37 and following,
namely the section named "Boot Sequence and Entry Point". alt_main() is the standard entry point for a raw Nios application, while main() is the entry point for a HAL based application. In the latter, an alt_main function is automatically generated which provides system initialization and calls your application main(). If you don't use any template, you must define the entry point function: void alt_main(void)- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Cris72 thanks for the help.
However i still get the same error. My .c file is the generated by the "hello world" template. Is really just a printf with hello world. I tried to change the main to alt_main but the error persists.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok now it works... even setting the path i have to click on the file and select "ADD TO NIOS2 BUILD".
Isnt there an easier way? I have to do this to every path? Adding the library AND setting it as a nios2 build library.. seriously?
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page