The libraries order for the linker are very important. So your command
line should be:
gcc main.c -I/usr/include/iup -liup
I think the -l path order is irrelevant, but to locate the functions used
in main.c it will look for them in the -liup library that must be specified
after the main module.
Best,
Scuri
On Sun, Feb 21, 2016 at 3:38 AM, Xiang Liu <[email protected]> wrote:
> sorry for the previous dirty message sent by outlook.com
> I have no idea what to do next.
>
> #include <stdlib.h>
> #include <iup.h>
>
> int main(int argc, char **argv)
> {
> IupOpen(&argc, &argv);
>
> IupMessage("Hello World 1", "Hello world from IUP.");
>
> IupClose();
> return EXIT_SUCCESS;
> }
>
>
> $ gcc -I/usr/include/iup -liup main.c
> /tmp/ccjjoTBI.o: In function `main':
> main.c:(.text+0x17): undefined reference to `IupOpen'
> main.c:(.text+0x2b): undefined reference to `IupMessage'
> main.c:(.text+0x30): undefined reference to `IupClose'
> collect2: ld returned 1 exit status
>
>
>
> $ nm /usr/lib/libiup.a |grep -C5 IupOpen
> 00000050 t load_image_arrowup
> 00000750 t load_image_arrowup_highlight
>
> iup_open.o:
> 000001f0 T IupClose
> 00000010 T IupOpen
> U IupSetGlobal
> U IupSetLanguage
> U IupStoreGlobal
> U IupVersion
> U __printf_chk
>
> Regards,
> xiang
>
>
>
>
>
> ------------------------------------------------------------------------------
> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
> http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
> _______________________________________________
> Iup-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/iup-users
>
>
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Iup-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/iup-users