Я пытаюсь запустить код на vscode на Mac OS Catalina 10.15.2. < /p>
Я получаю эту ошибку по этой функции. < /p>
$ g++ main.cpp
Undefined symbols for architecture x86_64:
"nalea(int)", referenced from:_main in main-508a59.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
< /code>
Это основной файл, который я использую - < /p>
#include
#include "proba.h"
#include "constantes.h"
#include "affichage.h"
int main(){
int a = nalea(60);
std::cout
#include // pour rand()
#include // pour fprintf()
#include // pour floor()
#include "proba.h" // types et déclaration des fonctions
int nalea( int max)
{
return (int)floor(rand()*((float)max)/RAND_MAX );
}
< /code>
Это proba.h Header File < /p>
int nalea(int max);
< /code>
Пожалуйста, помогите мне, я новичок в C ++ .... < /p>
Подробнее здесь: https://stackoverflow.com/questions/607 ... 6-64-error