0

I am developing a project using FreeRTOS. I need TCP functions which I include from FreeRTOS+TCP. This is the relevant part of my code:

#include "FreeRTOS.h"
#include "FreeRTOS_IP.h"
#include "FreeRTOS_Sockets.h"

void tcp_send_task() {
    FreeRTOS_IPInit(NULL, NULL, NULL, NULL, NULL);
}

And I get the following error in main.obj:

LNK2019 unresolved symbol _FreeRTOSIPInit in function _tcp_send_task 

I followed the instructions in the following link: https://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/TCP_Networking_Tutorial_Adding_Source_Files.html

In Project -> Properties -> C/C++ -> Other include Drectories I have the following paths:

..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\portable\NetworkInterface\WinPCap;
..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP;
..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\portable\Compiler\MSVC;
..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\portable\BufferManagement;
..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include;
..\..\Source\include;
..\..\Source\portable\MSVC-MingW;
..\Common\Include;
..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-Trace\Include;
.\Trace_Recorder_Configuration;
.;%(AdditionalIncludeDirectories)

All the necessary .h and .c files are in the include paths, but I think the function declaration is found, but not the definition.

I also tried adding the .c file path to Properties -> Configuration -> Linker -> Additional Library Directories, but it didn't solve the problem.

Pedro
  • 11
  • 3
  • 1
    Does this help? [What is an undefined reference/unresolved external symbol error and how do I fix it?](https://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix) – pmacfarlane Jul 11 '23 at 08:51
  • None of these solutions seems to solve the issue in my case – Pedro Jul 11 '23 at 10:03
  • Can you post the command that generates this error? – Mathieu Jul 11 '23 at 13:03
  • /OUT:".\Debug/RTOSDemo.exe" /MANIFEST /NXCOMPAT /PDB:".\Debug/WIN32.pdb" /DYNAMICBASE "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "odbc32.lib" "odbccp32.lib" /DEBUG /MACHINE:X86 /SAFESEH:NO /INCREMENTAL /PGD:".\Debug\RTOSDemo.pgd" /SUBSYSTEM:CONSOLE /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /ManifestFile:".\Debug\RTOSDemo.exe.intermediate.manifest" /LTCGOUT:".\Debug\RTOSDemo.iobj" /ERRORREPORT:PROMPT /ILK:".\Debug\RTOSDemo.ilk" /NOLOGO /VERBOSE /TLBID:1 – Pedro Jul 11 '23 at 14:06
  • This is what I see in Properties->Linker->Command Line – Pedro Jul 11 '23 at 14:06
  • I am not using the command line directly – Pedro Jul 11 '23 at 14:07
  • And this is what I see in Properties->C/C++->Command Line : – Pedro Jul 11 '23 at 14:08
  • /ifcOutput ".\Debug\" /GS /analyze- /Wall /wd"4574" /wd"4820" /wd"4668" /wd"4255" /wd"4710" /Zc:wchar_t /I"..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\portable\NetworkInterface\WinPCap" /I"..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP" /I"..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\portable\Compiler\MSVC" /I"..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\portable\BufferManagement" /I" – Pedro Jul 11 '23 at 14:08
  • ..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include" /I"..\..\Source\include" /I"..\..\Source\portable\MSVC-MingW" /I"..\Common\Include" /I"..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-Trace\Include" /I".\Trace_Recorder_Configuration" /I"." /ZI /Gm /Ox /Ob2 /Fd".\Debug/" /Zc:inline /fp:precise /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_WIN32_WINNT=0x0601" /D "WINVER=0x400" /D "_CRT_SECURE_NO_WARNINGS" /D "_VC80_UPGRADE=0x0600" /D "_MBCS" /translateInclude /errorReport:prompt /WX- /Zc:forScope /Gd /Oy- /MTd /FC /Fa".\Debug/" /EHsc /nologo /Fo".\Debug/" /Ot /Fp".\Debug/WIN32.pch" – Pedro Jul 11 '23 at 14:09
  • /diagnostics:column – Pedro Jul 11 '23 at 14:09

0 Answers0