Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to Compile on Ubuntu 16.04 LTS #14

Closed
brian00715 opened this issue Oct 14, 2021 · 9 comments
Closed

Failed to Compile on Ubuntu 16.04 LTS #14

brian00715 opened this issue Oct 14, 2021 · 9 comments

Comments

@brian00715
Copy link

~/Downloads/CH341SER-master$ sudo make
make -C /lib/modules/4.15.0-142-generic/build  M=/home/simon/Downloads/CH341SER-master 
make[1]: Entering directory '/usr/src/linux-headers-4.15.0-142-generic'
  CC [M]  /home/simon/Downloads/CH341SER-master/ch34x.o
/home/simon/Downloads/CH341SER-master/ch34x.c:1292:20: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
  .write_room     = ch34x_write_room,
                    ^
/home/simon/Downloads/CH341SER-master/ch34x.c:1292:20: note: (near initialization for ‘ch34x_device.write_room’)
/home/simon/Downloads/CH341SER-master/ch34x.c:1293:21: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
  .chars_in_buffer = ch34x_chars_in_buffer,
                     ^
/home/simon/Downloads/CH341SER-master/ch34x.c:1293:21: note: (near initialization for ‘ch34x_device.chars_in_buffer’)
cc1: some warnings being treated as errors
scripts/Makefile.build:337: recipe for target '/home/simon/Downloads/CH341SER-master/ch34x.o' failed
make[2]: *** [/home/simon/Downloads/CH341SER-master/ch34x.o] Error 1
Makefile:1584: recipe for target '_module_/home/simon/Downloads/CH341SER-master' failed
make[1]: *** [_module_/home/simon/Downloads/CH341SER-master] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.15.0-142-generic'
Makefile:7: recipe for target 'default' failed
make: *** [default] Error 2
simon@ubuntu:~/Downloads/CH341SER-master$
@jimmyd-be
Copy link

Same issue in Ubuntu 20.04 LTS on raspberry pi arm64.

@jimmyd-be
Copy link

I changed the code a litte bit to make it compile on those systems. Just change the types of ch34x_write_room and
ch34x_chars_in_buffer to int instead of unsiged int.

@hktari
Copy link

hktari commented Oct 18, 2021

This does indeed fix compilation. Thanks !

@sostholm
Copy link

sostholm commented Oct 23, 2021

Also getting this on:
20.04.3 LTS (Focal Fossa)
CPU: Intel x64 i3-6100

@sostholm
Copy link

I was able to fix the issue by downloading the official driver and then only replacing wait_queue_t wait; with wait_queue_entry_t wait; before running the make command.

@juliagoda
Copy link
Owner

#15

sorry for the late response

@3urobeat
Copy link

3urobeat commented Oct 27, 2021

Hey, just wanted to let you know that I had to revert the changes of 45074ab to make it work on my Arch system.
Otherwise I get the initialization of ‘unsigned int (*)(struct tty_struct *)’ from incompatible pointer type ‘int (*)(struct tty_struct *)’ error.

Arch Linux, Kernel: 5.14.14-zen1-1-zen

Should I open a new issue? Would make sense I guess in case other Arch users get stuck on this and can fix it themselves without you having to work on it right now.
Edit: I just did it, won't hurt I guess.

@sirlucjan
Copy link
Contributor

sirlucjan commented Oct 31, 2021

Question for Ubuntu/Mint users. As a change made by the maintainer of this repository makes it impossible to build this on Arch Linux and therefore we would like to determine the culprit. I have two leads and would like to eliminate one of them.

Could you see if this solution works for you?

If it doesn't build up in you after this change, we can probably pinpoint the real cause of the problem.

@juliagoda
Copy link
Owner

I have tested for both cases - when there is a newer kernel with gcc and an older one, and it looks like the condition from the pull request adjusts correctly. Nevertheless, it would be good if others would confirm this. Users no longer need to clone the repo from @sirlucjan if they don't want to, because the changes were accepted in the pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants