Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined reference to `main' in building phase #272

Closed
raphael10-collab opened this issue Jan 3, 2024 · 1 comment
Closed

undefined reference to `main' in building phase #272

raphael10-collab opened this issue Jan 3, 2024 · 1 comment

Comments

@raphael10-collab
Copy link

When building coreMQTT in Ubuntu 23.10 I get this error:

raphy@raohy:~/libpeer/dependencies/coreMQTT$ gcc -I source/include/ -DMQTT_DO_NOT_USE_CUSTOM_CONFIG -I source/interface/ source/core_mqtt.c source/core_mqtt_state.c source/core_mqtt_serializer.c -o coreMQTT
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x1b): undefined reference to `main'
collect2: error: ld returned 1 exit status

What am I doing wrong? How make it work?

@aggarg
Copy link
Member

aggarg commented Jan 3, 2024

You are trying to compile a library. The library is supposed to be used in an application and that is why it does not supply main.

You can look at these samples for learning how to use this library in an application - https://github.com/FreeRTOS/FreeRTOS/tree/main/FreeRTOS-Plus/Demo/coreMQTT_Windows_Simulator.

We want to keep all the discussions in one place and therefore, I'd request you to please open a forum issue if you have more questions - https://forums.freertos.org/.

@aggarg aggarg closed this as completed Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants