New Posts  All Forums:Forum Nav:

C compile/make error

post #1 of 13
Thread Starter 
I'm trying to compile this large project and I am getting this error. Anyone have any insights into how to fix it?

Code:
cc -MD -std=gnu99 -O3 -ffast-math -fwhole-program -combine -Werror -Wall -Wextra -Wmissing-prototypes -Wwrite-strings z-sim.c flight-computer.c physics.c pressure_sensor.c sensors.c resample-optimal.c coord.c mat.c vec.c ziggurat/isaac.c ziggurat/random.c ziggurat/normal.c ziggurat/normal_tab.c ziggurat/polynomial.c ziggurat/polynomial_tab.c -lm -o z-sim

z-sim.c: In function ‘trace_state’:
/usr/include/bits/stdio2.h:104: sorry, unimplemented: inlining failed in call to ‘printf’: redefined extern inline functions are not considered for inlining
z-sim.c:50: sorry, unimplemented: called from here
/usr/include/bits/stdio2.h:116: sorry, unimplemented: inlining failed in call to ‘vprintf’: redefined extern inline functions are not considered for inlining
z-sim.c:57: sorry, unimplemented: called from here
/usr/include/bits/stdio2.h:104: sorry, unimplemented: inlining failed in call to ‘printf’: redefined extern inline functions are not considered for inlining
z-sim.c:64: sorry, unimplemented: called from here
make: *** [z-sim] Error 1
This is the trace_state function from z_sim.c. Why is it baulking over printf?
Code:
/*line 43*/
void trace_state(const char *source, struct rocket_state *state, const char *fmt, ...)
{
    va_list args;
    if(trace_physics)
    {
        va_start(args, fmt);
/*50*/  printf("%9.3f: %s %8.2f alt, %8.2f vel, %8.2f acc, %c%c%c",
               t / 1e6, source,
               ECEF_to_geodetic(state->pos).altitude,
               vec_abs(state->vel), vec_abs(state->acc),
               state->engine_burning        ? 'B' : '-',
               state->drogue_chute_deployed ? 'D' : '-',
               state->main_chute_deployed   ? 'M' : '-');
/*57*/ vprintf(fmt, args);
        va_end(args);
    }

    if(trace_ltp && !strcmp(source, "sim"))
    {
            vec3 ltp = ECEF_to_LTP(geodetic_to_ECEF(initial_geodetic), make_LTP_rotation(initial_geodetic), state->pos);
/*64*/  printf("%f,%f,%fn", ltp.x, ltp.z, ltp.y);
        
    }
}

Edited by The Bartender Paradox - 12/14/08 at 9:09pm
½
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD A64 3500+ Winchester DFI nF4 SLi-DR EVGA 7800GT OCZ 4000VX 
Hard DriveOptical DriveOSMonitor
Maxtor 300Gb 16Mb Buffer Spinney one XP Pro SOYO LCD 
KeyboardPowerCaseMouse
Broken Somewhat OCZ PowerStream 520W None Old 
Mouse Pad
Pad? AHAAHAHAH 
  hide details  
Reply
½
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD A64 3500+ Winchester DFI nF4 SLi-DR EVGA 7800GT OCZ 4000VX 
Hard DriveOptical DriveOSMonitor
Maxtor 300Gb 16Mb Buffer Spinney one XP Pro SOYO LCD 
KeyboardPowerCaseMouse
Broken Somewhat OCZ PowerStream 520W None Old 
Mouse Pad
Pad? AHAAHAHAH 
  hide details  
Reply
post #2 of 13
http://www.network-theory.co.uk/docs...cintro_94.html
    
CPUMotherboardGraphicsRAM
AMD X4 9950 2.6GHz ASUS CROSSHAIR II FORMAULA GeForce GTX260 OC 4GB Cricial BallistiX 
Hard DriveOptical DriveOSMonitor
2X 1 TB Samsung F1 SATA II 2X ASUS 22X DVD/RW XP PRO 64 + VISTA 64 BIT DUAL W2407 HP'S 
KeyboardPowerCaseMouse
LOGITECH G15 850 WATT CorsAir Antec 1200 MODDED LOGITECH G7 
Mouse Pad
Leather Asus Signature Series 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
AMD X4 9950 2.6GHz ASUS CROSSHAIR II FORMAULA GeForce GTX260 OC 4GB Cricial BallistiX 
Hard DriveOptical DriveOSMonitor
2X 1 TB Samsung F1 SATA II 2X ASUS 22X DVD/RW XP PRO 64 + VISTA 64 BIT DUAL W2407 HP'S 
KeyboardPowerCaseMouse
LOGITECH G15 850 WATT CorsAir Antec 1200 MODDED LOGITECH G7 
Mouse Pad
Leather Asus Signature Series 
  hide details  
Reply
post #3 of 13
Thread Starter 
Quote:
Originally Posted by christalnet View Post
That's a nice site, thanks for the link. Unfortunately it doesn't have anything about this issue.
½
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD A64 3500+ Winchester DFI nF4 SLi-DR EVGA 7800GT OCZ 4000VX 
Hard DriveOptical DriveOSMonitor
Maxtor 300Gb 16Mb Buffer Spinney one XP Pro SOYO LCD 
KeyboardPowerCaseMouse
Broken Somewhat OCZ PowerStream 520W None Old 
Mouse Pad
Pad? AHAAHAHAH 
  hide details  
Reply
½
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD A64 3500+ Winchester DFI nF4 SLi-DR EVGA 7800GT OCZ 4000VX 
Hard DriveOptical DriveOSMonitor
Maxtor 300Gb 16Mb Buffer Spinney one XP Pro SOYO LCD 
KeyboardPowerCaseMouse
Broken Somewhat OCZ PowerStream 520W None Old 
Mouse Pad
Pad? AHAAHAHAH 
  hide details  
Reply
post #4 of 13
My best guess is you are compiling with an option/switch that is probably trying to force inline some functions, one of which is printf, which cannot be inlined. I'm not positive as I do not use Linux and whatever C++ compiler you are using, and that is a pretty cryptic error message that makes no sense.
Watercooler
(13 items)
 
  
CPUMotherboardGraphicsRAM
i7 920 D0 @ 4400MHz [24/7] X58 Classified 3870 Toxic Dominator GT 1680 [6-6-5-16] 
Hard DriveOptical DriveOSMonitor
7200.12 - 500GB [RAID 1] Plextor PX-7555A Windows 7 Samsung 2343BWX 2048x1152 
KeyboardPowerCaseMouse
Logitech G19 Corsair HX850W Silverstone TJ07 Logitech G9 
Mouse Pad
Fragmat 
  hide details  
Reply
Watercooler
(13 items)
 
  
CPUMotherboardGraphicsRAM
i7 920 D0 @ 4400MHz [24/7] X58 Classified 3870 Toxic Dominator GT 1680 [6-6-5-16] 
Hard DriveOptical DriveOSMonitor
7200.12 - 500GB [RAID 1] Plextor PX-7555A Windows 7 Samsung 2343BWX 2048x1152 
KeyboardPowerCaseMouse
Logitech G19 Corsair HX850W Silverstone TJ07 Logitech G9 
Mouse Pad
Fragmat 
  hide details  
Reply
post #5 of 13
Make sure you included <stdarg.h> NOT <varargs.h>.
Underground
(14 items)
 
  
CPUMotherboardGraphicsRAM
Core i7 920 C0 ASUS P6T6 WS Revolution GTX 460 TR3X6G1600C8D 
Hard DriveOptical DriveCoolingOS
WD1001FALS SAMSUNG SH-S223F 22X DVD MULTI Corsair H50 Fedora 16 KDE x86_64 
MonitorKeyboardPowerCase
HP w19b Microsoft Comfort Curve Corsair CX600 Thermaltake Armor VA8003BWS 
MouseMouse Pad
Razer DeathAdder Black 
  hide details  
Reply
Underground
(14 items)
 
  
CPUMotherboardGraphicsRAM
Core i7 920 C0 ASUS P6T6 WS Revolution GTX 460 TR3X6G1600C8D 
Hard DriveOptical DriveCoolingOS
WD1001FALS SAMSUNG SH-S223F 22X DVD MULTI Corsair H50 Fedora 16 KDE x86_64 
MonitorKeyboardPowerCase
HP w19b Microsoft Comfort Curve Corsair CX600 Thermaltake Armor VA8003BWS 
MouseMouse Pad
Razer DeathAdder Black 
  hide details  
Reply
post #6 of 13
Thread Starter 
Quote:
Originally Posted by error10 View Post
Make sure you included <stdarg.h> NOT <varargs.h>.
<stdarg.h> is included and <varargs.h> is not.
½
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD A64 3500+ Winchester DFI nF4 SLi-DR EVGA 7800GT OCZ 4000VX 
Hard DriveOptical DriveOSMonitor
Maxtor 300Gb 16Mb Buffer Spinney one XP Pro SOYO LCD 
KeyboardPowerCaseMouse
Broken Somewhat OCZ PowerStream 520W None Old 
Mouse Pad
Pad? AHAAHAHAH 
  hide details  
Reply
½
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD A64 3500+ Winchester DFI nF4 SLi-DR EVGA 7800GT OCZ 4000VX 
Hard DriveOptical DriveOSMonitor
Maxtor 300Gb 16Mb Buffer Spinney one XP Pro SOYO LCD 
KeyboardPowerCaseMouse
Broken Somewhat OCZ PowerStream 520W None Old 
Mouse Pad
Pad? AHAAHAHAH 
  hide details  
Reply
post #7 of 13
OK, I had to look that one up.

When I strip this code down to bare minimum, it works. Did you redefine printf() and/or vprintf() somewhere?

Try compiling without -fwhole-program and -combine options.

If those don't work, we'll probably need to see the rest of the project.
Underground
(14 items)
 
  
CPUMotherboardGraphicsRAM
Core i7 920 C0 ASUS P6T6 WS Revolution GTX 460 TR3X6G1600C8D 
Hard DriveOptical DriveCoolingOS
WD1001FALS SAMSUNG SH-S223F 22X DVD MULTI Corsair H50 Fedora 16 KDE x86_64 
MonitorKeyboardPowerCase
HP w19b Microsoft Comfort Curve Corsair CX600 Thermaltake Armor VA8003BWS 
MouseMouse Pad
Razer DeathAdder Black 
  hide details  
Reply
Underground
(14 items)
 
  
CPUMotherboardGraphicsRAM
Core i7 920 C0 ASUS P6T6 WS Revolution GTX 460 TR3X6G1600C8D 
Hard DriveOptical DriveCoolingOS
WD1001FALS SAMSUNG SH-S223F 22X DVD MULTI Corsair H50 Fedora 16 KDE x86_64 
MonitorKeyboardPowerCase
HP w19b Microsoft Comfort Curve Corsair CX600 Thermaltake Armor VA8003BWS 
MouseMouse Pad
Razer DeathAdder Black 
  hide details  
Reply
post #8 of 13
My guess is -fwhole-program as well. Google turns up a number of bug reports with it, and it also forces you to pass every single .c file at once, which is bad practice. Unless it gives you serious performance gains I'd take it out.

On a side note, if you're getting into larger projects you may want to learn how to use Makefiles. Unless you're doing crazy stuff they're pretty easy to pick up.
It goes to eleven
(13 items)
 
  
CPUMotherboardGraphicsRAM
E6300 DS3 EVGA 8600GTS 2GB XMS2 DDR2-800 
Hard DriveOSMonitorKeyboard
1.294 TB Arch Linux/XP Samsung 226bw Eclipse II 
PowerCaseMouse
Corsair 520HX Lian-Li v1000B Plus G7 
  hide details  
Reply
It goes to eleven
(13 items)
 
  
CPUMotherboardGraphicsRAM
E6300 DS3 EVGA 8600GTS 2GB XMS2 DDR2-800 
Hard DriveOSMonitorKeyboard
1.294 TB Arch Linux/XP Samsung 226bw Eclipse II 
PowerCaseMouse
Corsair 520HX Lian-Li v1000B Plus G7 
  hide details  
Reply
post #9 of 13
Thread Starter 
Quote:
Originally Posted by error10 View Post
OK, I had to look that one up.

When I strip this code down to bare minimum, it works. Did you redefine printf() and/or vprintf() somewhere?

Try compiling without -fwhole-program and -combine options.

If those don't work, we'll probably need to see the rest of the project.
Quote:
Originally Posted by rabidgnome229 View Post
My guess is -fwhole-program as well. Google turns up a number of bug reports with it, and it also forces you to pass every single .c file at once, which is bad practice. Unless it gives you serious performance gains I'd take it out.

On a side note, if you're getting into larger projects you may want to learn how to use Makefiles. Unless you're doing crazy stuff they're pretty easy to pick up.
Thanks, removing -fwhole-program worked.

I am using a makefile, and if you couldn't already tell, I didn't write most of this project. The project is an open source rocket simulator and event driven flight computer (git repository http version here if you want to look at it). I'm just doing a bit of physics work for it. Ill ask the higher ups about -fwhole-program and see what they have to say about it at our tuesday meeting.
½
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD A64 3500+ Winchester DFI nF4 SLi-DR EVGA 7800GT OCZ 4000VX 
Hard DriveOptical DriveOSMonitor
Maxtor 300Gb 16Mb Buffer Spinney one XP Pro SOYO LCD 
KeyboardPowerCaseMouse
Broken Somewhat OCZ PowerStream 520W None Old 
Mouse Pad
Pad? AHAAHAHAH 
  hide details  
Reply
½
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD A64 3500+ Winchester DFI nF4 SLi-DR EVGA 7800GT OCZ 4000VX 
Hard DriveOptical DriveOSMonitor
Maxtor 300Gb 16Mb Buffer Spinney one XP Pro SOYO LCD 
KeyboardPowerCaseMouse
Broken Somewhat OCZ PowerStream 520W None Old 
Mouse Pad
Pad? AHAAHAHAH 
  hide details  
Reply
post #10 of 13
Thread Starter 
Ok, I talked to the group and they said using -fwhole-program works for them. They suggested the problem was a random weird error between gcc4.3, and the version of libc6-dev that I have where stdio2 is defined.

They said using -fwhole-program is needed because it allows a level of optimisation that wouldn't otherwise be achieved.
½
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD A64 3500+ Winchester DFI nF4 SLi-DR EVGA 7800GT OCZ 4000VX 
Hard DriveOptical DriveOSMonitor
Maxtor 300Gb 16Mb Buffer Spinney one XP Pro SOYO LCD 
KeyboardPowerCaseMouse
Broken Somewhat OCZ PowerStream 520W None Old 
Mouse Pad
Pad? AHAAHAHAH 
  hide details  
Reply
½
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD A64 3500+ Winchester DFI nF4 SLi-DR EVGA 7800GT OCZ 4000VX 
Hard DriveOptical DriveOSMonitor
Maxtor 300Gb 16Mb Buffer Spinney one XP Pro SOYO LCD 
KeyboardPowerCaseMouse
Broken Somewhat OCZ PowerStream 520W None Old 
Mouse Pad
Pad? AHAAHAHAH 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming