Hi,

  Specify simply "iup" as library not the full path.

The following command line works:

  gcc -o main.exe main.c -I../../../include -L../../../lib/mingw4 -liup
-lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32
-lole32 -loleaut32 -luuid -lcomctl32

  You may just adapt it to your situation.

Best,
Scuri

Em ter, 15 de mai de 2018 22:10, Joe McCarron via Iup-users <
iup-users@lists.sourceforge.net> escreveu:

> I am trying to run the sammple (shown below) using Code::Blocks IDE &
> mingw32 g++ compiler
> I am getting the error "undefined reference to 'IupOpen', "undefined
> reference to 'IupMessage', "undefined reference to 'IupClose'
> I have been trying to get this to compile for a couple of days with zero
> success. I do not know what I am missing.
> Any help is appreciated.
>
> I have tried switching around the link libraries order to see if that
> would have any effect but it didn't.
>
> Below is the command line shown from the Build log
> mingw32-g++.exe -Wall -IC:\MyLibraries\iup\src\win
> -IC:\MyLibraries\iup\include -IC:\MyLibraries\iup\mingw4_lib\include
>  -IC:\MyLibraries\iup\src -c C:\AAA\CProjects\iupProject\main.cpp -o
> obj\Debug\AAA\CProjects\iupProject\main.o
>
> mingw32-g++.exe -L..\..\..\MyLibraries\iup\mingw4_lib
> -LC:\MyLibraries\iup\mingw4_lib -o bin\Debug\iupProject.exe
> obj\Debug\AAA\CProjects\iupProject\main.o
> obj\Debug\MyLibraries\iup\etc\iup.res
> obj\Debug\AAA\CProjects\iupProject\resource.res
> C:\MyLibraries\iup\libiup.a C:\MyLibraries\iup\mingw4_lib\libiupimglib.a
> -lkernel32 -luser32 -lgdi32 -lcomctl32 -lole32
>
>
> Below is the sample program that i am trying to run.
> ----------------------------------
> #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;
> }
> -------------------------------------------
> I have set up the following in the IDE
>
> Compiler Search Directories
> C:\MyLibraries\iup\src\win
> C:\MyLibraries\iup\include
> C:\MyLibraries\iup\mingw4_lib\include
> C:\MyLibraries\iup\src
>
> Linker : Search Directories
> C:\MyLibraries\iup\mingw4_lib
>
>
> Linker Settings: Link libraries
> C:\MyLibraries\iup\libiup.a
> C:\MyLibraries\iup\mingw4_lib\libiupimglib.a
> kernel32
> user32
> gdo32
> comctl32
> ole32
>
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Iup-users mailing list
> Iup-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/iup-users
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Iup-users mailing list
Iup-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iup-users

Reply via email to