* * * *

Privacy Policy

Blog italiano

Clicca qui se vuoi andare al blog italiano su Lazarus e il pascal.

Forum ufficiale

Se non siete riusciti a reperire l'informazione che cercavate nei nostri articoli o sul nostro forum vi consiglio di visitare il
Forum ufficiale di Lazarus in lingua inglese.

Lazarus 1.0

Trascinare un file nel programma
DB concetti fondamentali e ZeosLib
Recuperare codice HTML da pagina web
Mandare mail con Lazarus
Stabilire il sistema operativo
Esempio lista in pascal
File INI
Codice di attivazione
Realizzare programmi multilingua
Lavorare con le directory
Utilizzare Unità esterne
TTreeView
TTreeview e Menu
Generare controlli RUN-TIME
LazReport, PDF ed immagini
Intercettare tasti premuti
Ampliare Lazarus
Lazarus e la crittografia
System Tray con Lazarus
UIB: Unified Interbase
Il file: questo sconosciuto
Conferma di chiusura di un applicazione
Liste e puntatori
Overload di funzioni
Funzioni a parametri variabili
Proprietà
Conversione numerica
TImage su Form e Panel
Indy gestiore server FTP lato Client
PopUpMenu sotto Pulsante (TSpeedButton)
Direttiva $macro
Toolbar
Evidenziare voci TreeView
Visualizzare un file Html esterno
StatusBar - aggirare l'errore variabile duplicata
Da DataSource a Excel
Le permutazioni
Brute force
Indy 10 - Invio email con allegati
La gestione degli errori in Lazarus
Pascal Script
Linux + Zeos + Firebird
Dataset virtuale
Overload di operatori
Lavorare con file in formato JSON con Lazarus
Zeos ... dietro le quinte (prima parte)
Disporre le finestre in un blocco unico (come Delphi)
Aspetto retrò (Cmd Line)
Lazarus 1.0
Come interfacciare periferica twain
Ubuntu - aggiornare free pascal e lazarus
fpcup: installazioni parallele di lazarus e fpc
Free Pascal e Lazarus sul Raspberry Pi
Cifratura: breve guida all'uso dell'algoritmo BlowFish con lazarus e free pascal.
Creare un server multithread
guida all'installazione di fpc trunk da subversion in linux gentoo
Indice
DB concetti fondamentali e connessioni standard
Advanced Record Syntax
DB concetti fondamentali e DBGrid
DB concetti fondamentali e TDBEdit, TDBMemo e TDBText
Advanced Record Syntax: un esempio pratico
Superclasse form base per programmi gestionali (e non)
Superclasse form base per programmi gestionali (e non) #2 - log, exception call stack, application toolbox
Superclasse form base per programmi gestionali (e non) #3 - traduzione delle form
Superclasse form base per programmi gestionali (e non) #4 - wait animation
Un dialog per la connessione al database:TfmSimpleDbConnectionDialog
Installare lazarus su mac osx sierra
immagine docker per lavorare con lazarus e free pascal
TDD o Test-Driven Development
Benvenuto! Effettua l'accesso oppure registrati.
Novembre 25, 2024, 04:26:44 am

Inserisci il nome utente, la password e la durata della sessione.

43 Visitatori, 0 Utenti

Autore Topic: [RISOLTO] Snap7 e linux  (Letto 1336 volte)

onire

  • Newbie
  • *
  • Post: 6
  • Karma: +0/-0
[RISOLTO] Snap7 e linux
« il: Luglio 26, 2021, 11:20:54 am »
Salve ragazzi,
come scritto nell'altra sezione, sono nuovo di Lazarus, ma sono arrivato qui perchè al momento mi sembra l'unico ide multi piattaforma, almeno tra quelli open.

Essendo neofita, immagino che sto facendo qualche cavolata, ma sono giorni che ci sbatto la testa.
Ho scaricato questa libreria https://sourceforge.net/projects/snap7/files/1.4.2/ che serve per collegarsi ai PLC Siemens.
Nella cartella rich-demos ci sono diversi progetti per Lazarus compilabili per varie piattaforme, tra cui x86_64-win64 e x86_64-linux. Se compilo su windows utilizzando l'ultima versione di Lazarus, tutto fila liscio. Se faccio la stessa cosa su Linux, ho provato sia su Ubunu che Suse, ottengo un errore di linking.
Questo è l'output completo:
Codice: [Seleziona]
Compila il progetto, Destinazione: bin/clientdemo: Codice di uscita 1, Errori: 1, avvertimenti: 22, suggerimenti: 82
sc_info.pas(8,68) Hint: Unit "Arrow" not used in sc_info
cp_info.pas(8,68) Hint: Unit "Arrow" not used in cp_info
snap7.pas(1430,39) Hint: Local variable "CPP_tm" does not seem to be initialized
snap7.pas(1497,38) Hint: Function result variable does not seem to be initialized
snap7.pas(1506,38) Hint: Local variable "IsConnected" does not seem to be initialized
snap7.pas(1682,37) Hint: Function result variable does not seem to be initialized
snap7.pas(1689,29) Hint: Function result variable does not seem to be initialized
snap7.pas(1696,41) Hint: Function result variable does not seem to be initialized
snap7.pas(1696,33) Hint: Local variable "Requested" does not seem to be initialized
snap7.pas(1703,41) Hint: Local variable "PduLength" does not seem to be initialized
snap7.pas(1703,30) Hint: Function result variable does not seem to be initialized
snap7.pas(1730,39) Hint: Local variable "EvtReady" does not seem to be initialized
snap7.pas(1740,47) Hint: Function result variable does not seem to be initialized
snap7.pas(1740,39) Hint: Local variable "CpuStatus" does not seem to be initialized
snap7.pas(1740,28) Hint: Local variable "ServerStatus" does not seem to be initialized
snap7.pas(1748,50) Hint: Local variable "ClientsCount" does not seem to be initialized
snap7.pas(1748,36) Hint: Function result variable does not seem to be initialized
snap7.pas(1748,28) Hint: Local variable "ServerStatus" does not seem to be initialized
snap7.pas(1754,37) Hint: Function result variable does not seem to be initialized
snap7.pas(1760,35) Hint: Function result variable does not seem to be initialized
snap7.pas(1768,47) Hint: Local variable "ClientsCount" does not seem to be initialized
snap7.pas(1768,33) Hint: Local variable "CpuStatus" does not seem to be initialized
snap7.pas(1768,22) Hint: Function result variable does not seem to be initialized
snap7.pas(1910,33) Hint: Function result variable does not seem to be initialized
snap7.pas(1929,40) Hint: Function result variable does not seem to be initialized
snap7.pas(1929,32) Hint: Local variable "FSendTime" does not seem to be initialized
snap7.pas(1943,40) Hint: Local variable "FRecvTime" does not seem to be initialized
snap7.pas(1943,29) Hint: Function result variable does not seem to be initialized
snap7.pas(1960,30) Hint: Function result variable does not seem to be initialized
snap7.pas(2064,16) Hint: Conversion between ordinals and pointers is not portable
snap7.pas(2064,10) Hint: Conversion between ordinals and pointers is not portable
snap7.pas(2065,16) Hint: Conversion between ordinals and pointers is not portable
snap7.pas(2065,10) Hint: Conversion between ordinals and pointers is not portable
snap7.pas(2066,16) Hint: Conversion between ordinals and pointers is not portable
snap7.pas(2066,10) Hint: Conversion between ordinals and pointers is not portable
snap7.pas(2064,16) Warning: Converting pointers to signed integers may result in wrong comparison results and range errors, use an unsigned type instead.
snap7.pas(2065,16) Warning: Converting pointers to signed integers may result in wrong comparison results and range errors, use an unsigned type instead.
snap7.pas(2066,16) Warning: Converting pointers to signed integers may result in wrong comparison results and range errors, use an unsigned type instead.
snap7.pas(2074,16) Hint: Conversion between ordinals and pointers is not portable
snap7.pas(2074,10) Hint: Conversion between ordinals and pointers is not portable
snap7.pas(2075,16) Hint: Conversion between ordinals and pointers is not portable
snap7.pas(2075,10) Hint: Conversion between ordinals and pointers is not portable
snap7.pas(2076,16) Hint: Conversion between ordinals and pointers is not portable
snap7.pas(2076,10) Hint: Conversion between ordinals and pointers is not portable
snap7.pas(2074,16) Warning: Converting pointers to signed integers may result in wrong comparison results and range errors, use an unsigned type instead.
snap7.pas(2075,16) Warning: Converting pointers to signed integers may result in wrong comparison results and range errors, use an unsigned type instead.
snap7.pas(2076,16) Warning: Converting pointers to signed integers may result in wrong comparison results and range errors, use an unsigned type instead.
snap7.pas(2084,16) Hint: Conversion between ordinals and pointers is not portable
snap7.pas(2084,10) Hint: Conversion between ordinals and pointers is not portable
snap7.pas(2084,16) Warning: Converting pointers to signed integers may result in wrong comparison results and range errors, use an unsigned type instead.
snap7.pas(2092,16) Hint: Conversion between ordinals and pointers is not portable
snap7.pas(2092,10) Hint: Conversion between ordinals and pointers is not portable
snap7.pas(2093,16) Hint: Conversion between ordinals and pointers is not portable
snap7.pas(2093,10) Hint: Conversion between ordinals and pointers is not portable
snap7.pas(2094,16) Hint: Conversion between ordinals and pointers is not portable
snap7.pas(2094,10) Hint: Conversion between ordinals and pointers is not portable
snap7.pas(2092,16) Warning: Converting pointers to signed integers may result in wrong comparison results and range errors, use an unsigned type instead.
snap7.pas(2093,16) Warning: Converting pointers to signed integers may result in wrong comparison results and range errors, use an unsigned type instead.
snap7.pas(2094,16) Warning: Converting pointers to signed integers may result in wrong comparison results and range errors, use an unsigned type instead.
snap7.pas(2102,16) Hint: Conversion between ordinals and pointers is not portable
snap7.pas(2102,10) Hint: Conversion between ordinals and pointers is not portable
snap7.pas(2102,16) Warning: Converting pointers to signed integers may result in wrong comparison results and range errors, use an unsigned type instead.
snap7.pas(2185,9) Hint: Conversion between ordinals and pointers is not portable
snap7.pas(2185,3) Hint: Conversion between ordinals and pointers is not portable
snap7.pas(2186,9) Hint: Conversion between ordinals and pointers is not portable
snap7.pas(2186,3) Hint: Conversion between ordinals and pointers is not portable
snap7.pas(2187,9) Hint: Conversion between ordinals and pointers is not portable
snap7.pas(2187,3) Hint: Conversion between ordinals and pointers is not portable
snap7.pas(2185,9) Warning: Converting pointers to signed integers may result in wrong comparison results and range errors, use an unsigned type instead.
snap7.pas(2186,9) Warning: Converting pointers to signed integers may result in wrong comparison results and range errors, use an unsigned type instead.
snap7.pas(2187,9) Warning: Converting pointers to signed integers may result in wrong comparison results and range errors, use an unsigned type instead.
snap7.pas(2195,9) Hint: Conversion between ordinals and pointers is not portable
snap7.pas(2195,3) Hint: Conversion between ordinals and pointers is not portable
snap7.pas(2196,9) Hint: Conversion between ordinals and pointers is not portable
snap7.pas(2196,3) Hint: Conversion between ordinals and pointers is not portable
snap7.pas(2197,9) Hint: Conversion between ordinals and pointers is not portable
snap7.pas(2197,3) Hint: Conversion between ordinals and pointers is not portable
snap7.pas(2195,9) Warning: Converting pointers to signed integers may result in wrong comparison results and range errors, use an unsigned type instead.
snap7.pas(2196,9) Warning: Converting pointers to signed integers may result in wrong comparison results and range errors, use an unsigned type instead.
snap7.pas(2197,9) Warning: Converting pointers to signed integers may result in wrong comparison results and range errors, use an unsigned type instead.
snap7.pas(2204,9) Hint: Conversion between ordinals and pointers is not portable
snap7.pas(2204,3) Hint: Conversion between ordinals and pointers is not portable
snap7.pas(2204,9) Warning: Converting pointers to signed integers may result in wrong comparison results and range errors, use an unsigned type instead.
snap7.pas(2213,9) Hint: Conversion between ordinals and pointers is not portable
snap7.pas(2213,3) Hint: Conversion between ordinals and pointers is not portable
snap7.pas(2214,9) Hint: Conversion between ordinals and pointers is not portable
snap7.pas(2214,3) Hint: Conversion between ordinals and pointers is not portable
snap7.pas(2215,9) Hint: Conversion between ordinals and pointers is not portable
snap7.pas(2215,3) Hint: Conversion between ordinals and pointers is not portable
snap7.pas(2213,9) Warning: Converting pointers to signed integers may result in wrong comparison results and range errors, use an unsigned type instead.
snap7.pas(2214,9) Warning: Converting pointers to signed integers may result in wrong comparison results and range errors, use an unsigned type instead.
snap7.pas(2215,9) Warning: Converting pointers to signed integers may result in wrong comparison results and range errors, use an unsigned type instead.
snap7.pas(2222,9) Hint: Conversion between ordinals and pointers is not portable
snap7.pas(2222,3) Hint: Conversion between ordinals and pointers is not portable
snap7.pas(2222,9) Warning: Converting pointers to signed integers may result in wrong comparison results and range errors, use an unsigned type instead.
mainclient.pas(428,46) Hint: Parameter "opCode" not used
mainclient.pas(623,56) Hint: Local variable "Size" does not seem to be initialized
mainclient.pas(384,27) Hint: Parameter "Async" not used
mainclient.pas(808,40) Hint: Local variable "Status" does not seem to be initialized
mainclient.pas(281,46) Hint: Parameter "CloseAction" not used
mainclient.pas(1686,28) Hint: Local variable "Read" does not seem to be initialized
mainclient.pas(2110,40) Hint: Local variable "DT" does not seem to be initialized
mainclient.pas(2254,44) Hint: Local variable "Result" does not seem to be initialized
mainclient.pas(12,21) Hint: Unit "LMessages" not used in mainclient
clientdemo.lpr(24,1) Error: Error while linking

Immagino che gli manchi qualche libreria da linkare ma non ho capito quale.

Cosa mi consigliate di fare?

Grazie
Onire
« Ultima modifica: Luglio 28, 2021, 01:14:13 pm da onire »

schumi

  • Full Member
  • ***
  • Post: 220
  • Karma: +1/-0
Re:Snap7 e linux
« Risposta #1 il: Luglio 26, 2021, 01:44:11 pm »

onire

  • Newbie
  • *
  • Post: 6
  • Karma: +0/-0
Re:Snap7 e linux
« Risposta #2 il: Luglio 26, 2021, 03:53:01 pm »
ciao,
prova a vedere se questo ti aiuta https://forum.lazarus.freepascal.org/index.php?topic=36093.15

Grazie per il suggerimento, mi sono messo nella cartella del compilatore e ho dato i i comandi:
Codice: Bash [Seleziona]
cd /usr/share/fpcsrc/3.2.0
sudo make clean all OS_TARGET=linux CPU_TARGET=x86_64
sudo make install OS_TARGET=linux CPU_TARGET=x86_64 INSTALL_PREFIX=/usr


ma non ha avuto nessun effetto, o dovevo eseguire il codice nella cartella del progetto?

Comunque ho dato "Clean up and build" continua a non funzionare, ma è cambiato un po' l'output, adesso mi dice /usr/bin/ld.bfd: impossibile trovare -lsnap7

Questo è l'output completo: https://pastebin.com/7UHSsbfR


xinyiman

  • Administrator
  • Hero Member
  • *****
  • Post: 3276
  • Karma: +12/-0
Re:Snap7 e linux
« Risposta #3 il: Luglio 27, 2021, 08:02:02 am »
Quel messaggio è perchè non trova snap7 installato nel sistema. Lo hai installato?
Ieri è passato, domani è futuro, oggi è un dono...

onire

  • Newbie
  • *
  • Post: 6
  • Karma: +0/-0
Re:Snap7 e linux
« Risposta #4 il: Luglio 27, 2021, 11:08:24 am »
Hai ragione, c'era scritto anche nella documentazione, bisognava fare prima un make per creare la libreria. Come dicevo ho poca esperienza e poichè in windows non ho dovuto fare nulla, pensavo che anche in linux fosse uguale.
Adesso che sono riuscito a compilare inizia il bello, vorrà dire che mi sentirete di nuovo  ;D

Grazie
Onire

xinyiman

  • Administrator
  • Hero Member
  • *****
  • Post: 3276
  • Karma: +12/-0
Re:Snap7 e linux
« Risposta #5 il: Luglio 28, 2021, 10:03:25 am »
Figurati. Visto che il problema è stato risolto, metti [RISOLTO] all'inizio del titolo del primo post del 3d. Così potrebbe essere d'aiuto in futuro a qualcun'altro.
Ieri è passato, domani è futuro, oggi è un dono...

 

Recenti

How To

Utenti
  • Utenti in totale: 803
  • Latest: maXim.FI
Stats
  • Post in totale: 19189
  • Topic in totale: 2289
  • Online Today: 51
  • Online Ever: 900
  • (Gennaio 21, 2020, 08:17:49 pm)
Utenti Online
Users: 0
Guests: 43
Total: 43

Disclaimer:

Questo blog non rappresenta una testata giornalistica poiché viene aggiornato senza alcuna periodicità. Non può pertanto considerarsi un prodotto editoriale ai sensi della legge n. 62/2001.