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

Remove ac_cfg.h from libavrdude.h #820

Merged
merged 3 commits into from
Jan 11, 2022

Conversation

dl8dtl
Copy link
Contributor

@dl8dtl dl8dtl commented Jan 10, 2022

Inclusion of ac_cfg.h is not needed, and contradicts the library idea.

On MSVC, this is required in order to have a definition of
PATH_MAX in place.
@yegorich
Copy link
Contributor

I have used the following code:

#include <stdio.h>
#include "libavrdude.h"

int main(int argc, char **argv)
{
        AVRMEM *mem = avr_new_memtype();
        printf("Hello world\n");
        return 0;
}
root@onrisc:/usr/src/avrtest# gcc -o test main.c libavrdude.a
/usr/bin/ld: libavrdude.a(libavrdude_a-avrpart.o): in function `avr_new_opcode':
/usr/src/avrdude/src/avrpart.c:39: undefined reference to `avrdude_message'
/usr/bin/ld: libavrdude.a(libavrdude_a-avrpart.o): in function `avr_new_memtype':
/usr/src/avrdude/src/avrpart.c:252: undefined reference to `avrdude_message'
/usr/bin/ld: libavrdude.a(libavrdude_a-avrpart.o): in function `avr_initmem':
/usr/src/avrdude/src/avrpart.c:276: undefined reference to `avrdude_message'
/usr/bin/ld: /usr/src/avrdude/src/avrpart.c:282: undefined reference to `avrdude_message'
/usr/bin/ld: /usr/src/avrdude/src/avrpart.c:284: undefined reference to `progname'
/usr/bin/ld: libavrdude.a(libavrdude_a-avrpart.o): in function `avr_dup_opcode':
/usr/src/avrdude/src/avrpart.c:59: undefined reference to `avrdude_message'
/usr/bin/ld: libavrdude.a(libavrdude_a-avrpart.o): in function `avr_dup_mem':
/usr/src/avrdude/src/avrpart.c:314: undefined reference to `avrdude_message'
/usr/bin/ld: /usr/src/avrdude/src/avrpart.c:304: undefined reference to `avrdude_message'
/usr/bin/ld: libavrdude.a(libavrdude_a-avrpart.o): in function `avr_new_memtype':
/usr/src/avrdude/src/avrpart.c:252: undefined reference to `avrdude_message'
/usr/bin/ld: libavrdude.a(libavrdude_a-avrpart.o): in function `avr_mem_display':
/usr/src/avrdude/src/avrpart.c:408: undefined reference to `avrdude_message'
/usr/bin/ld: libavrdude.a(libavrdude_a-avrpart.o):/usr/src/avrdude/src/avrpart.c:445: more undefined references to `avrdude_message' follow
/usr/bin/ld: libavrdude.a(libavrdude_a-pindefs.o): in function `pins_check':
/usr/src/avrdude/src/pindefs.c:296: undefined reference to `progname'
collect2: error: ld returned 1 exit status

@dl8dtl
Copy link
Contributor Author

dl8dtl commented Jan 11, 2022

avrdude_message() needs to be provided by the application.
The template in main.c can be used, but it depends on the verbose global variable which is only available in main.c.

Yes, we should document that. ;-)

Btw., it's on purpose that this needs to be provided by the application: if you want to build a GUI app (which was the original idea behind splitting off the backend functionality into a library), you certainly don't want to see those messages go to a console terminal, but somehow create a GUI message box out of that.

@yegorich
Copy link
Contributor

yegorich commented Jan 11, 2022

With avrdude_message() provided everything works fine.

@dl8dtl dl8dtl merged commit 2d833e7 into avrdudes:main Jan 11, 2022
dl8dtl added a commit that referenced this pull request Jan 11, 2022
@mcuee mcuee added the enhancement New feature or request label Jun 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants