compiler errors when compiling ponyprog

Asked by Thoth

I am attempting to get ponyprog the microcontroller programmer to compile. I have hunted down a few errors. But I am stumped on this new set of error output:

http://pastebin.com/937251

This is what my Config.mk looks like:

http://pastebin.com/937252

I've only changed the lines pertaining to HOMEV and the X11 include location.

Any ideas?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Thoth
Solved:
Last query:
Last reply:
Revision history for this message
Benoit Malet (benoit-malet) said :
#1

Hello !

Problem comes from this line :

ponyioint.cpp:60:21: error: asm/io.h: No such file or directory

Are you sure you include the right path and have the kernel headers installed ?

Regards,
Benoît

Revision history for this message
Thoth (55ubuntu) said :
#2

I'm sure I have the headers installed for my kernel, linux-headers-2.6.20-6 are there any others I'm missing?

Revision history for this message
Cesare Tirabassi (norsetto) said :
#3

Usually asm is just a symlink to the relative architecture directory. For instance:

ls /usr/src/linux-headers-2.6.20-16/include/asm
/usr/src/linux-headers-2.6.20-16/include/asm -> asm-x86_64

and:

ls /usr/src/linux-headers-2.6.20-16/include/asm-x86_64/io.h
/usr/src/linux-headers-2.6.20-16/include/asm-x86_64/io.h

> my kernel, linux-headers-2.6.20-6

I guess you meant 2.6.20-16?

Revision history for this message
Best Thoth (55ubuntu) said :
#4

yep 16

$ ls -lh /usr/src/linux-headers-2.6.20-16/include/asm
lrwxrwxrwx 1 root root 8 2007-06-06 12:18 /usr/src/linux-headers-2.6.20-16/include/asm -> asm-i386

$ ls -lh /usr/src/linux-headers-2.6.20-16/include/asm-i386/io.h
-rw-r--r-- 1 root root 10K 2007-04-12 12:16 /usr/src/linux-headers-2.6.20-16/include/asm-i386/io.h

Here are the lines I changed:

#---------------------------------------------------------------------
# Linux
#---------------------------------------------------------------------
ifeq ($(Arch),linux)
INCDIR += -I/usr/include
LIBDIR += -L/usr/$(X11RV)/lib
LIBS += -lXmu -lXt -lXext -lX11
TARZ = z
RANLIB = ranlib
VGPATH = LINUX
endif

#---------------------------------------------------------------------
# Linux ELF shared library
#---------------------------------------------------------------------
ifeq ($(Arch),linuxelf)
INCDIR += -I/usr/include
LIBDIR += -L/usr/$(X11RV)/lib
LIBS += -lXmu -lXt -lXext -lX11
TARZ = z
RANLIB = ranlib
VGPATH = LINUX
endif

originally the include line included the $(X11RV) just like the lib line.

funny thing is I tried to just for kicks:

ln -s /usr/src/linux-headers-2.6.20-16/include/asm/io.h ./

in the /usr/include/asm folder which was conspicuously missing an io.h file.

The compile goes much further, but I fear this is far too kludgey to have a good outcome.

So I started thinking and reset the lines to how they were originally, and then I symlinked the include out of the linux headers and inside it I symlinked the X11 folder from /usr/include. This did give me a compile finally, however it seems like a bad kludge. Any reprimands?

Revision history for this message
Jan Portegijs (j-portegijs) said :
#5

I tried to compile under Ubuntu 8.04 "Hardy Heron", using advice from locutus42 in:
 http://ubuntuforums.org/showthread.php?t=223247 (read_only archive, can not post anything there).
I got some warnings and an error:

make
...
vpsprntr.cxx: In member function `std::ofstream* vPSPrinter::OpenPrinter()':
vpsprntr.cxx:275: warning: invalid conversion from `int' to `const char*'
vpsprntr.cxx:275: warning: initializing argument 1 of `std::basic_ofstream<_CharT, _Traits>::basic_ofstream(const char*, std::_Ios_Openmode) [with _CharT = char, _Traits = std::char_traits<char>]'
...
ponyioint.cpp:60:21: asm/io.h: No such file or directory

Google on "asm/io.h g++"
asm/io.h is outdated, now it should be sys/io.h, see http://www.instructables.com/id/SU050F2FZQ1GEX8/

I solved it by changing ponyprog source files: Replace all lines:
# include <asm/io.h>
by:
# include <sys/io.h>

To find those lines:
grep asm/io.h *
This gives the following files:
   pic12bus.cpp picbus.cpp picbusnew.cpp ponyioint.cpp sxbus.cpp
In some other files, the "#include <asm/io.h>" has been commented out already (by putting "//" before the "#include") and a new line "#include <sys/io.h>" was added. Apparently, the one who did it, overlooked the lines where there were
spaces between "#" and "include...". These spaces have no effect.

Good luck...

Revision history for this message
jpelletier (jpelletier-ieee) said :
#6

For convenience, someone did a package with all the corrections needed.
See the forum at the PonyProg's home site:

http://ponyprog.sourceforge.net/phorum/read.php?2,905