NO

Author Topic: Could not compile my program using IUP GUI library - help wanted  (Read 2864 times)

Offline Nirmal

  • Member
  • *
  • Posts: 1
Hi friends!

I wanted to use the IUP GUI Library from https://www.tecgraf.puc-rio.br/iup/.  I downloaded the library which was a zipped file and extracted it to a folder name IUP in D: drive.  The structure of the folder is like this :

D:\IUP -- IUP (contains many .lib files)
            |   |____Include (contains many .h files)
            |_ cd (contains many .lib files)
            |   |____Include (contains many .h files) 
            |_ im (contains many .lib files)
                 |___Include (contains many .h files)

I created a new project of type Win32 Program (exe). 
Under Project > Options > General > Folders
   Added the following paths for libraries :
              D:\IUP\iup
              D:\IUP\cd
              D:\IUP\im
   Added the following paths for include files :
              D:\IUP\iup\Include
              D:\IUP\cd\Include
              D:\IUP\im\Include

I created a single source file named test1.c with the example code on IUP GUI's website :


#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;
}


When I compiled and ran this program, I got the following error.

Building test1.obj.
Building test1.exe.
POLINK: error: Unresolved external symbol '_IupOpen@8' - referenced from 'D:\temp\Pelles C\test1\output\test1.obj'.
POLINK: error: Unresolved external symbol '_IupMessage@8' - referenced from 'D:\temp\Pelles C\test1\output\test1.obj'.
POLINK: error: Unresolved external symbol '_IupClose@0' - referenced from 'D:\temp\Pelles C\test1\output\test1.obj'.
POLINK: error: Unresolved external symbol '_WinMain@16' - referenced from 'crt.lib(_wincrt0.obj)'.
POLINK: fatal error: 4 unresolved external(s).
*** Error code: 1 ***
Done.

Can anybody tell me what settings I have missed and what is wrong ?
Thanks!


Offline algernon_77

  • Member
  • *
  • Posts: 33
Re: Could not compile my program using IUP GUI library - help wanted
« Reply #1 on: May 12, 2021, 08:59:37 AM »
Hi,
Assuming that you downloaded the 32 bit library, go to "Project->Project Options->Linker" and try adding iupimglib.lib and iup.lib to the library list.
I don't have it installed, so I'm not sure that it works :) , I've just read the docs for a bit. Looks interesting, think I'll give it a try.

Regards!

Offline apabird

  • Member
  • *
  • Posts: 1
Re: Could not compile my program using IUP GUI library - help wanted
« Reply #2 on: May 13, 2021, 11:37:29 AM »
You have to add iup.lib to linkflags.