Error 017 undefined symbol ошибка

#1

azik215

    Новичок

  • Пользователь
  • Pip

  • 32 сообщений

Отправлено 12 Сентябрь 2014 — 18:29

Помогите , что за ошибка??

Упс. Компилирование

  • Наверх


#2


The

Отправлено 12 Сентябрь 2014 — 18:56

  • Помогите , что за ошибка??

    Упс. Компилирование

    error 017: undefined symbol «%s» — неизвестный символ «%s»;
    warning 217: loose indentation — не выровненная строка

Сообщение отредактировал The: 12 Сентябрь 2014 — 18:56

  • Наверх


#3


azik215

azik215

    Новичок

  • Пользователь
  • Pip

  • 32 сообщений

Отправлено 20 Сентябрь 2014 — 18:46

  • error 017: undefined symbol «%s» — неизвестный символ «%s»;
    с ним то , что делать с 2 я разобрался

  • Наверх


#4


FasT of boni

Отправлено 20 Сентябрь 2014 — 18:58

warning 217: loose indentation 
Проблема с отступами. Внутри функции отступы должны быть сделаны или с помощью TAB, или с помощью пробелов — нельзя их смешивать, выберите что-то одно. 

  • Наверх


#5


azik215

azik215

    Новичок

  • Пользователь
  • Pip

  • 32 сообщений

Отправлено 20 Сентябрь 2014 — 19:03

warning 217: loose indentation 
Проблема с отступами. Внутри функции отступы должны быть сделаны или с помощью TAB, или с помощью пробелов — нельзя их смешивать, выберите что-то одно

Я с этим разобрался мне нужно 

error 017: undefined symbol «%s» — неизвестный символ «%s»;

Что с ним делать?

Вот 93 строчка

LogMgr_Print(g_moduleCore, LogType_Debug, «PurchaseUpgrade», «Client %d tried to buy interlocked upgrade %s», client, name);

  • Наверх


#6


FasT of boni

Отправлено 20 Сентябрь 2014 — 19:08

Я с этим разобрался мне нужно 

error 017: undefined symbol «%s» — неизвестный символ «%s»;

Что с ним делать?

Вот 93 строчка

LogMgr_Print(g_moduleCore, LogType_Debug, «PurchaseUpgrade», «Client %d tried to buy interlocked upgrade %s», client, name);

error 017: undefined symbol «x» 
Используемый символ не найден. Или забыли переменную объявить, или не подключили модуль. Если это какая-то SourceMod команда, например, CS_RespawnPlayer, то зайдите в API и введите её в поле «Search:». Выше над командой жирным шрифтом будет указано имя модуля, например, «cstrike», и чтобы его подключить, добавьте в самый верх кода #include <cstrike> 

  • Наверх


#7


azik215

azik215

    Новичок

  • Пользователь
  • Pip

  • 32 сообщений

Отправлено 20 Сентябрь 2014 — 19:24

Я с этим разобрался мне нужно 

error 017: undefined symbol «%s» — неизвестный символ «%s»;

Что с ним делать?

Вот 93 строчка

LogMgr_Print(g_moduleCore, LogType_Debug, «PurchaseUpgrade», «Client %d tried to buy interlocked upgrade %s», client, name);

error 017: undefined symbol «x» 
Используемый символ не найден. Или забыли переменную объявить, или не подключили модуль. Если это какая-то SourceMod команда, например, CS_RespawnPlayer, то зайдите в API и введите её в поле «Search:». Выше над командой жирным шрифтом будет указано имя модуля, например, «cstrike», и чтобы его подключить, добавьте в самый верх кода #include <cstrike> 

Можно я в лс файл кину. Ты сделаешь??

  • Наверх


#8


FasT of boni

Отправлено 20 Сентябрь 2014 — 19:25

Можно я в лс файл кину. Ты сделаешь??

попробуй

  • Наверх


#9


azik215

azik215

    Новичок

  • Пользователь
  • Pip

  • 32 сообщений

Отправлено 20 Сентябрь 2014 — 19:28

  • Наверх


#10


FasT of boni

Отправлено 20 Сентябрь 2014 — 20:26

Это инклюд.

Кидай все инклюды и исходник.

  • Наверх


#11


Mattko

Отправлено 21 Сентябрь 2014 — 13:29

Нету переменной «name», объявите о ней в начале кода.
Используя вот-так: new name;
 

warning 217: loose indentation 
Проблема с отступами. Внутри функции отступы должны быть сделаны или с помощью TAB, или с помощью пробелов — нельзя их смешивать, выберите что-то одно. 

Не отступами, а с табуляции… Можно объявить #table, но проще соблюдать табуляцию, чтобы работа плагина была стабильна.

PS: Автору темы, кидай исходник мне в ЛС, или тут. Исправлю.

  • Mr.Credo это нравится
  • Наверх


17 минут назад, Nekit_Krut18 сказал:

@x_SkYAs_x Покажите код этих строк, на которых ошибки. Используйте для этого, спойлер и тег ‘ Код ‘.

8452: 	SetVehicleData(GetPlayerVehicleID(playerid),V_BAGAGE_AMOUNT_GUN,0);
10475: if GetVehicleData(vehicleid, V_BAGAGE_AMOUNT_GUN)+500 > 3000 *then SendClientMessage(playerid,-1,"Матовоз переполнен!");
10478: SetVehicleData(vehicleid,V_BAGAGE_AMOUNT_GUN,GetVehicleData(vehicleid, V_BAGAGE_AMOUNT_GUN)+500);
10479: format(l_string,26,"Матовоз загружен: 0/%d",GetVehicleData(vehicleid,V_BAGAGE_AMOUNT_GUN));
10594: if GetVehicleData(vehicleid, V_BAGAGE_AMOUNT_GUN)+500 > 3000 *then SendClientMessage(playerid,-1,"Матовоз переполнен!");
10597: SetVehicleData(vehicleid,V_BAGAGE_AMOUNT_GUN,GetVehicleData(vehicleid, V_BAGAGE_AMOUNT_GUN)+500);
10598: format(l_string,26,"Матовоз загружен: 0/%d",GetVehicleData(vehicleid,V_BAGAGE_AMOUNT_GUN));
new V_BAGAGE_AMOUNT_GUN

Я все правильно сделал с этим?

Ну и в конце » ; » забыл дописать тут

Отредактировано 15 января, 2021 пользователем x_SkYAs_x

From SA-MP Wiki

Jump to: navigation, search

Undefined symbol is a Pawn compiler error message. The Pawn Language Guide formally defines this error as error 017, and explains that the error means «The symbol (variable, constant or function) is not declared«.

The error will look roughly look like this: error 017: undefined symbol «WelcomePlayer»

Cause

The error occurs when a piece of code references a variable, constant or function that the compiler cannot find. Often, this error is encountered by scripters who recklessly copy and paste code from one script to another, not realizing that the code in question depends on other code in the original script. Another, more common mistake made by even the most experienced scripters, is misspelling symbols.

Example with a function

This is example where a function that does not exists is referenced. A reckless copy-paster is copying a piece for code from the original script (awesomeroleplay.pwn) to his or her own (supercoolrp.pwn). awesomeroleplay.pwn compiles without any warnings or errors.

The reckless copy-paster decides to copy this piece of code from the original script:

awesomeroleplay.pwn

public OnPlayerConnect(playerid)
{
    WelcomePlayer(playerid);
}

The reckless copy-paster replaces supercoolrp.pwn’s OnPlayerConnect callback with the one from awesomeroleplay.pwn and then attemps to compile it. The compiler will, however, throw an error: error 017: undefined symbol «WelcomePlayer». This is because the function WelcomePlayer does not exist the paster’s own script. In other words: the piece of code that the reckless copy-paster pasted, depends on other code in awesomeroleplay.pwn. The paster will need to copy the dependent script as well.

In the original script, the function WelcomePlayer is defined.

awesomeroleplay.pwn

WelcomePlayer(playerid)
{
    SendClientMessage(playerid, "Welcome to Interactive Roleplay!", 0xFF0000AA);
}

The reckless copy-paster will need to copy and paste this function into his own script as well to make the code compile correctly. If this function would also depend on other code, the paster will need to copy and paste that code as well. In fact, the paster would need to repeat this step until all dependencies are resolved.

Tips for resolving this error

  • Use Ctrl + F to find the missing symbol (note that the compiler will tell you what symbol is missing after the words undefined symbol!) in the original script. If the symbol is a variable, you will have to copy all code that is relevant to its «ecosystem», that is to say, all code that modifies the variable. For beginning scripters and reckless copy-pasters, this may be hard, because it requires a deep understanding of the code and code paths.
  • Look into the includes of the original script.
  • Make sure you are adding the right includes.
  • Make sure you are not misspelling the symbol.


#1

Пользователь офлайн
 

Отправлено 08 января 2019 — 15:47

  • Прохожий

Помогите не понимаю в чем дело!

C:Users?????Desktopservergamemodesedit.pwn(7435) : error 017: undefined symbol «string»
C:Users?????Desktopservergamemodesedit.pwn(7436) : error 017: undefined symbol «string»
C:Users?????Desktopservergamemodesedit.pwn(7438) : error 017: undefined symbol «string»
C:Users?????Desktopservergamemodesedit.pwn(7439) : error 017: undefined symbol «string»
C:Users?????Desktopservergamemodesedit.pwn(7441) : error 017: undefined symbol «string»
C:Users?????Desktopservergamemodesedit.pwn(7442) : error 017: undefined symbol «string»
C:Users?????Desktopservergamemodesedit.pwn(7462) : error 017: undefined symbol «string»
C:Users?????Desktopservergamemodesedit.pwn(7463) : error 017: undefined symbol «string»
C:Users?????Desktopservergamemodesedit.pwn(7473) : error 017: undefined symbol «pGidra»
C:Users?????Desktopservergamemodesedit.pwn(7485) : error 017: undefined symbol «pCvet»

Вот код где выбевает ошыбку
case 1: {
format(string,128,»[1]> Nitro x2tt10.000$n[2]> Nitro x5tt20.000$n[3]> Nitro x10tt30.000$»);
SPD(playerid,8598,DIALOG_STYLE_LIST,»Закись азота(Нитро)»,string,»Выбрать»,»Назад»); }
case 2: {
format(string,256,»[1]> Shadowtt15.000$n[2]> Megatt15.000$n[3]> Wirestt15.000$n[4]> Classictt15.000$n[5]> Twisttt15.000$n[6]> Grovett15.000$n[7]> Atomictt20.000$n[8]> Dollar [Premium]t30.000$»);
SPD(playerid,8599,DIALOG_STYLE_LIST,»Смена дисков»,string,»Выбрать»,»Назад»); }
case 3: {
format(string,150,»[1]> Покрасочная работа #1tt10.000$n[2]> Покрасочная работа #2tt20.000$n[3]> Покрасочная работа #3tt30.000$n[4]> Удалить покрасочную работу»);
SPD(playerid,8620,DIALOG_STYLE_LIST,»Покрасочные работы»,string,»Выбрать»,»Назад»); }
case 4: {
new c = GetPlayerVehicleID(playerid);
new getmodel = GetVehicleModel©;
if(getmodel == 562 || getmodel == 560 || getmodel == 565 || getmodel == 561 || getmodel == 559 || getmodel == 558) {
SPD(playerid,8601,DIALOG_STYLE_LIST,»Спойлера»,»[1]> X-Flowtt20.000$n[2]> Alientt20.000$»,»Выбрать»,»Отмена»); }
else SendClientMessage(playerid,-1,»Данная деталь недоступна для вашей модели»),TuneDialog(playerid); }
case 5: {
new c = GetPlayerVehicleID(playerid);
new getmodel = GetVehicleModel©;
if(getmodel == 562 || getmodel == 560 || getmodel == 565 || getmodel == 561 || getmodel == 559 || getmodel == 558 || getmodel == 534 || getmodel == 536 || getmodel == 535 || getmodel == 576) {
SPD(playerid,8602,DIALOG_STYLE_LIST,»Передний бампер»,»[1]> X-Flowtt20.000$n[2]> Alientt20.000$»,»Выбрать»,»Отмена»); }
else SendClientMessage(playerid,-1,»Данная деталь недоступна для вашей модели»),TuneDialog(playerid); }
case 6: {
new c = GetPlayerVehicleID(playerid);
new getmodel = GetVehicleModel©;
if(getmodel == 562 || getmodel == 560 || getmodel == 565 || getmodel == 561 || getmodel == 559 || getmodel == 558 || getmodel == 534 || getmodel == 536 || getmodel == 535 || getmodel == 576) {
SPD(playerid,8603,DIALOG_STYLE_LIST,»Задний бампер»,»[1]> X-Flowtt20.000$n[2]> Alientt20.000$»,»Выбрать»,»Отмена»); }
else SendClientMessage(playerid,-1,»Данная деталь недоступна для вашей модели»),TuneDialog(playerid);}
case 7: {
format(string,128,»Стоимость гидравлики составляет: 90000$nВы точно хотите купить?»);
SPD(playerid,9483,DIALOG_STYLE_MSGBOX,»Гидравлика»,string,»Да»,»Назад»);}}}
else {
}}
case 9483: {
if(response){
if(PlayerInfo[playerid][pCash] < 90000) return SendClientMessage(playerid, COLOR_GRAD1, «{F70000}x {ADAEAD}У тебя не достаточно денег. Нужно{5BD93B} 90.000$»);
GameTextForPlayer(playerid, «~y~-90.000~r~$», 5000, 1);
PlayerInfo[playerid][pCash] -= 90000; PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
TuneDialog(playerid);
SendClientMessage(playerid,COLOR_WHITE,»Вы установили Гидравлику!»);
PlayerInfo[playerid][pGidra] = 1087;
AddVehicleComponent(GetPlayerVehicleID(playerid),1087);
SaveCarTuning(playerid);}}
case 8596: {
if(response){
switch(listitem) {
case 0: {
if(PlayerInfo[playerid][pCash] < 50000) return SendClientMessage(playerid, COLOR_GRAD1, «{F70000}x {ADAEAD}У тебя не достаточно денег. Нужно{5BD93B} 50.000$»);
GameTextForPlayer(playerid, «~y~-50.000~r~$», 5000, 1);
PlayerInfo[playerid][pCash] -= 50000; PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
TuneDialog(playerid);
Cvet[playerid] = 000;

Сообщение отредактировал dusenkot: 08 января 2019 — 15:51

0


#2

Отправлено 08 января 2019 — 16:08

  • Пользователь

error 017: undefined symbol — Говорит о том, что отсутствует определенная переменная, в вашем случае отсутствует «string», решается добавлением » new string[256]; » выше ошибки, «pCvet» и «pGidra» — отсутствуют в массиве «PlayerInfo » — решается их добавлением или заменой на имеющиеся, выполняющие такие же функции, переменные.

Сообщение отредактировал opzz: 08 января 2019 — 16:14

0

@Daniel-Cortez

I’ll look into it, but I’m unsure of what is supposed to be the correct output in such situations.
Should we suggest «var<state_a>» for the above example (which, IMHO, would be kind of misleading, because if the user types that instead of just «var», it will only cause a bunch of new errors), or rather don’t suggest anything?
@Y-Less @YashasSamaga ?

@Y-Less

Maybe something like undefined symbol "var"; state symbol not in scope?

@Daniel-Cortez

Is the code in the example even valid? As far as I can recall, in Pawn only functions may have states, not variables.
Even if we do something similar with a function instead of a variable

func() <automaton_1:STATE_1> {}

main()
{
	func();
}

the compiler doesn’t print any warnings/errors (though the generated code raises AMX_ERR_INVSTATE as function func() isn’t implemented for the default state).

Maybe we should close this issue as invalid?

@Y-Less

Yes, variables can have states as well. And two variables in different states may share a memory location, which is quite nice.

@Daniel-Cortez

Yes, you’re right, I just haven’t seen this feature used in the wild. I’ll see what I can do about incorrect suggestions for state variables.

@stale

This issue has been automatically marked as stale because it has not had recent activity.

@Daniel-Cortez

Понравилась статья? Поделить с друзьями:
  • Error converting data type varchar to bigint ошибка
  • Error converting data type nvarchar to bigint ошибка
  • Error connection ошибка соединения с
  • Error connect to server ошибка
  • Error compiling script file ошибка inpa что делать