小编use*_*964的帖子

xcode c/c++ linker error: undefined symbol

I did some search but my problem seems to be trivial so that no one asked.
I have a mixed c and c++ code.

In model.h, I have the following declaration:

void free_and_null (char **ptr);
Run Code Online (Sandbox Code Playgroud)

In model.cpp, I have the function body:

void free_and_null (char **ptr)
{
    if ( *ptr != NULL ) {
        free (*ptr);
        *ptr = NULL;
    }
} /* END free_and_null */
Run Code Online (Sandbox Code Playgroud)

In a solve.c file, I have the following :

#include "sort.h"
.....
    free_and_null …
Run Code Online (Sandbox Code Playgroud)

c c++ debugging macos xcode

1
推荐指数
1
解决办法
1916
查看次数

标签 统计

c ×1

c++ ×1

debugging ×1

macos ×1

xcode ×1