Linking to RTCS problem (MQX 4.1, C++)

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Linking to RTCS problem (MQX 4.1, C++)

跳至解决方案
1,270 次查看
michael_wahler
Contributor III

Hi everyone,

I would like to send and receive UDP (or TCP) packets with a C++ application. Since I have not found any other documentation for the networking API, I am copy-pasting parts of the HTTP server example to my C++ code.

The first problem I am running into is that the linker cannot find ipcfg_init_device. Since this symbol is defined in ipcfg.h, which is part of RTCS, I added rtcs.a in the C/C++ Build Settings->Tool Settings->ARM Ltd Windows GCC C++ Linker->Miscellaneous->Other objects. However, this did not help.

My questions are

  • What is the correct way of linking with RTCS?
  • Are there any good examples for simple TCP/UDP communication with MQX 4.1?

Kind regards

Michael

标签 (1)
标记 (5)
0 项奖励
回复
1 解答
1,055 次查看
Martin_
NXP Employee
NXP Employee

For the linking RTCS from a C++ source code, make sure you put RTCS include files into extern "C" brackets. Example:

extern "C" {

#include "ipcfg.h"

....

...

}

在原帖中查看解决方案

0 项奖励
回复
2 回复数
1,056 次查看
Martin_
NXP Employee
NXP Employee

For the linking RTCS from a C++ source code, make sure you put RTCS include files into extern "C" brackets. Example:

extern "C" {

#include "ipcfg.h"

....

...

}

0 项奖励
回复
1,055 次查看
michael_wahler
Contributor III

Thanks! This does the trick.

0 项奖励
回复