intrig-unicamp / mininet-wifi

Emulator for Software-Defined Wireless Networks
https://mn-wifi.readthedocs.io/
Other
431 stars 239 forks source link

mnexec.c Compilation issue #479

Closed StatelessCat closed 1 year ago

StatelessCat commented 1 year ago

Hi, I need to compile mininet-wifi. During the '''step 4: $ sudo util/install.sh -Wlnfv''', i got the following error:

remote: Total 159 (delta 6), reused 47 (delta 0), pack-reused 0
Réception d'objets: 100% (159/159), 267.69 Kio | 1.09 Mio/s, fait.
Résolution des deltas: 100% (6/6), fait.
/mnt/code/mininet-wifi/mininet /mnt/code/mininet-wifi /mnt/code /mnt/code /mnt/code/mininet-wifi /mnt/code/mininet-wifi/hostap/wpa_supplicant /mnt/code/mininet-wifi/hostap/hostapd /mnt/code/mininet-wifi/hostap /mnt/code/mininet-wifi /mnt/code/mininet-wifi
make: Avertissement : le fichier « mnexec.c » a une date de modification 0,031 s dans le futur
cc -Wall -Wextra  \
-DVERSION=\"`PYTHONPATH=. python3 -B bin/mn --version 2>&1`\" mnexec.c -o mnexec
<command-line>: warning: missing terminating " character
mnexec.c: In function ‘main’:
<command-line>: error: missing terminating " character
mnexec.c:197:28: note: in expansion of macro ‘VERSION’
  197 |             printf("%s\n", VERSION);
      |                            ^~~~~~~
**mnexec.c:197:35: error: expected expression before ‘)’ token**
  197 |             printf("%s\n", VERSION);
      |                                   ^
make: *** [Makefile:50 : mnexec] Erreur 1>

It's like VERSION is not recognised as a global variable How I can workaround this issue ? Thanks for any tips and i can provide further informations if needed. Cordialy

ramonfontes commented 1 year ago

Hello,

I suggest you doing a clean installation. I cannot reproduce the issue.

If you need recompiling the code you should run sudo make install

StatelessCat commented 1 year ago

I just took a clean Ubuntu 22.04, cloned the repo, then it's still the same )-:

ramonfontes commented 1 year ago

This error occurs when a constant string or text is not closed in double quotes; when we have missed closing quotes; or even using single quote instead of double quote while closing the string/text. AFAIK, that's not the case with mnexec.c. I just did a clean installation and I was unable to reproduce the issue.

Which gcc and python versions do you have?

StatelessCat commented 1 year ago

Ok, here are my versions:

$ python --version
Python 3.10.6
$ gcc --version
gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
ramonfontes commented 1 year ago

Well, I have the same versions. Honestly, I have no idea what is going there.

Just successfully did a new clean installation on a new machine and on a docker container.