kiml / PSOC_programmer

Open source Unix (Linux/Mac) tools to manipulate hex files and program a PSoC5 via FX2 USB interface (assumes CY8CKIT-050)
Other
29 stars 7 forks source link

Compile Errors #1

Open aniljava opened 10 years ago

aniljava commented 10 years ago

On fresh checkout it gives following error:

 cube Desktop # gc https://github.com/kiml/PSOC_programmer
Cloning into 'PSOC_programmer'...
remote: Counting objects: 74, done.
remote: Compressing objects: 100% (69/69), done.
remote: Total 74 (delta 4), reused 65 (delta 3)
Unpacking objects: 100% (74/74), done.
Checking connectivity... done.
 cube Desktop # cd PSOC_programmer/
 cube PSOC_programmer # make
for dir in src; do \
        make -C $dir all; \
    done
make[1]: Entering directory `/root/Desktop/PSOC_programmer/src'
Make all in subdir: libhex
make[2]: Entering directory `/root/Desktop/PSOC_programmer/src/libhex'
make[2]: *** No rule to make target `all'.  Stop.
make[2]: Leaving directory `/root/Desktop/PSOC_programmer/src/libhex'
Make all in subdir: libini
make[2]: Entering directory `/root/Desktop/PSOC_programmer/src/libini'
g++  -c INIReader.cpp
g++  -c HierINIReader.cpp
In file included from HierINIReader.cpp:7:0:
HierINIReader.h:17:5: error: ‘uint32_t’ does not name a type
     uint32_t GetUint32(std::string section, std::string name, uint32_t default_value);
     ^
HierINIReader.cpp:35:1: error: ‘uint32_t’ does not name a type
 uint32_t HierINIReader::GetUint32(string section, string name, uint32_t default_value)
 ^
make[2]: *** [HierINIReader.o] Error 1
make[2]: Leaving directory `/root/Desktop/PSOC_programmer/src/libini'
Make all in subdir: programmer
make[2]: Entering directory `/root/Desktop/PSOC_programmer/src/programmer'
g++ -I ../libhex -I ../libini -c prog.cpp
prog.cpp: In function ‘void parse_args(int*, char***, config_s*)’:
prog.cpp:170:46: error: ‘getopt’ was not declared in this scope
     while ((ch = getopt(*argc, *argv, "hC:d:")) != -1)
                                              ^
prog.cpp:175:38: error: ‘optarg’ was not declared in this scope
                 config->config_dir = optarg;
                                      ^
prog.cpp:189:14: error: ‘optind’ was not declared in this scope
     *argc -= optind;
              ^
make[2]: *** [prog.o] Error 1
make[2]: Leaving directory `/root/Desktop/PSOC_programmer/src/programmer'
Make all in subdir: tools
make[2]: Entering directory `/root/Desktop/PSOC_programmer/src/tools'
g++  -I ../libhex -I ../programmer -L ../libhex -lhex  hex2bin.cpp   -o hex2bin
/usr/bin/ld: cannot find -lhex
collect2: error: ld returned 1 exit status
make[2]: *** [hex2bin] Error 1
make[2]: Leaving directory `/root/Desktop/PSOC_programmer/src/tools'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/root/Desktop/PSOC_programmer/src'
make: *** [all] Error 2

After making libhex seperately, it gives following error:

 cube PSOC_programmer # make
for dir in src; do \
        make -C $dir all; \
    done
make[1]: Entering directory `/root/Desktop/PSOC_programmer/src'
Make all in subdir: libhex
make[2]: Entering directory `/root/Desktop/PSOC_programmer/src/libhex'
make[2]: *** No rule to make target `all'.  Stop.
make[2]: Leaving directory `/root/Desktop/PSOC_programmer/src/libhex'
Make all in subdir: libini
make[2]: Entering directory `/root/Desktop/PSOC_programmer/src/libini'
g++  -c HierINIReader.cpp
In file included from HierINIReader.cpp:7:0:
HierINIReader.h:17:5: error: ‘uint32_t’ does not name a type
     uint32_t GetUint32(std::string section, std::string name, uint32_t default_value);
     ^
HierINIReader.cpp:35:1: error: ‘uint32_t’ does not name a type
 uint32_t HierINIReader::GetUint32(string section, string name, uint32_t default_value)
 ^
make[2]: *** [HierINIReader.o] Error 1
make[2]: Leaving directory `/root/Desktop/PSOC_programmer/src/libini'
Make all in subdir: programmer
make[2]: Entering directory `/root/Desktop/PSOC_programmer/src/programmer'
g++ -I ../libhex -I ../libini -c prog.cpp
prog.cpp: In function ‘void parse_args(int*, char***, config_s*)’:
prog.cpp:170:46: error: ‘getopt’ was not declared in this scope
     while ((ch = getopt(*argc, *argv, "hC:d:")) != -1)
                                              ^
prog.cpp:175:38: error: ‘optarg’ was not declared in this scope
                 config->config_dir = optarg;
                                      ^
prog.cpp:189:14: error: ‘optind’ was not declared in this scope
     *argc -= optind;
              ^
make[2]: *** [prog.o] Error 1
make[2]: Leaving directory `/root/Desktop/PSOC_programmer/src/programmer'
Make all in subdir: tools
make[2]: Entering directory `/root/Desktop/PSOC_programmer/src/tools'
g++  -I ../libhex -I ../programmer -L ../libhex -lhex  hex2bin.cpp   -o hex2bin
/tmp/ccXY540P.o: In function `main':
hex2bin.cpp:(.text+0x6e): undefined reference to `HexData::HexData()'
hex2bin.cpp:(.text+0x86): undefined reference to `HexData::read_hex(char const*, unsigned int)'
hex2bin.cpp:(.text+0xd5): undefined reference to `HexData::dump(_IO_FILE*, int) const'
hex2bin.cpp:(.text+0xf9): undefined reference to `HexData::minmax_address(unsigned int, unsigned int, unsigned int*, unsigned int*) const'
hex2bin.cpp:(.text+0x154): undefined reference to `HexData::extract2bin(unsigned int, unsigned int, unsigned char*) const'
hex2bin.cpp:(.text+0x1d4): undefined reference to `HexData::minmax_address(unsigned int, unsigned int, unsigned int*, unsigned int*) const'
collect2: error: ld returned 1 exit status
make[2]: *** [hex2bin] Error 1
make[2]: Leaving directory `/root/Desktop/PSOC_programmer/src/tools'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/root/Desktop/PSOC_programmer/src'
make: *** [all] Error 2
 cube PSOC_programmer # 
aniljava commented 10 years ago

Environment:

 cube PSOC_programmer # uname -a
Linux cube 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
 cube PSOC_programmer # gcc --version
gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

 cube PSOC_programmer # g++ --version
g++ (Ubuntu 4.8.2-19ubuntu1) 4.8.2
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

 cube PSOC_programmer # make --version
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for x86_64-pc-linux-gnu
 cube PSOC_programmer # 
kiml commented 10 years ago

Thanks for the feedback. I've updated both repositories (PSOC_programmer and PSOC_compiler). They should now compile out of the box under Linunx. The make files need a bit of cleaning up ... later. I've tested it on my linux VM (finally) with the exception that I don't have python3 so I couldn't test that the two python scripts work ok.

Suggested order: cd PSOC_programmer git pull: make clean make make install (Note it's just a local install)

same with PSOC_compiler

Let me know how you go.

cheers

Kim

On 04/11/2014, at 1:55 AM, aniljava wrote:

Environment:

cube PSOC_programmer # uname -a Linux cube 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux cube PSOC_programmer # gcc --version gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2 Copyright (C) 2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

cube PSOC_programmer # g++ --version g++ (Ubuntu 4.8.2-19ubuntu1) 4.8.2 Copyright (C) 2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

cube PSOC_programmer # make --version GNU Make 3.81 Copyright (C) 2006 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

This program built for x86_64-pc-linux-gnu cube PSOC_programmer # — Reply to this email directly or view it on GitHub.

{"@context":"http://schema.org","@type":"EmailMessage","description":"View this Issue on GitHub","action":{"@type":"ViewAction","url":"https://github.com/kiml/PSOC_programmer/issues/1#issuecomment-61488806","name":"View Issue"}}