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' during building #169

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

undefined reference to `main' during building #169

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

Comments

@raphael10-collab
Copy link

I'm trying to build coreHTTP in Ubuntu 23.10 but I'm getting this error:

raphy@raohy:~/libpeer/dependencies/coreHTTP$ gcc -I source/include/ -I source/interface/ -I source/dependency/3rdparty/llhttp/build/ -DHTTP_DO_NOT_USE_CUSTOM_CONFIG source/dependency/3rdparty/llhttp/build/libllhttp.a  source/dependency/3rdparty/llhttp/src/native/api.c source/dependency/3rdparty/llhttp/src/native/http.c -o coreHTT
/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'
/usr/bin/ld: /tmp/cc5Ef6az.o: in function `llhttp_init':
api.c:(.text+0x1f): undefined reference to `llhttp__internal_init'
/usr/bin/ld: /tmp/cc5Ef6az.o: in function `llhttp_reset':
api.c:(.text+0x10f): undefined reference to `llhttp__internal_init'
/usr/bin/ld: /tmp/cc5Ef6az.o: in function `llhttp_execute':
api.c:(.text+0x178): undefined reference to `llhttp__internal_execute'
collect2: error: ld returned 1 exit status
raphy@raohy:~/libpeer/dependencies/coreHTTP$ 

What am I doing wrong? How to 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/coreHTTP_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