Thread: How make platform from DOS to window?

  1. #1
    Registered User
    Join Date
    Sep 2005
    Posts
    30

    How make platform from DOS to window?

    Hello all:

    I am learning a calculation method named mosek in c-format.
    The c software I am using is MS vc6.0. The mosek program can work in the DOS interface all right.

    Say an c-code abc.c, after starting vc6 enviroment in one DOS box, just type:

    cl -DMSKDLL abc.c -I mosek.h mosek3_0.lib

    The program will pass the compiling and linking and out the results.

    I tried this mosek program to run in vc6 it's own beautful color window interface, but failed.

    I draw the mosek.h and mosek3_0.lib into the same fold of abc.c and add #include"mosek.h" in the program. When do the compiling, it passed successfully. When do the building abc.exe, it give ERRORS of "unresolved external symbol " such as:

    abc.obj : error LNK2001: unresolved external symbol _ MSK_maketask

    It seems the program can not find the "mosek3_0.lib"

    Could anyone tell me the way to solve this problem?!

  2. #2
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,268
    you need to put the dll file in the folder as well, not just the .lib file.

  3. #3
    Registered User
    Join Date
    Sep 2005
    Posts
    30
    Hi Bithub: Thank you for the reply.

    I found even if putting the mosek3_0.dll into the same fold, the output is the same: many "unresolved external symbol_..."

  4. #4
    Registered User
    Join Date
    Jan 2005
    Posts
    847
    Put the lib file into your compiler's lib directory. And since you are using #include to include the .h file you don't need to put it on the compiler's command line. Just #include it with quotes " " if it's in the same director or < and > if it's in your compiler's include directory.

  5. #5
    Registered User
    Join Date
    Sep 2005
    Posts
    30
    Hi friends, thanks for your patient help.

    There are three related files: mosrk.h and mosek3_0.lib and mosek3_0.dll. I have put all the three in the same fold where the file abc.c is in.

    Besides, I have put the mosek3_0.lib and mosek3_0.dll into all vc6.0's folds where it's own *.lib and *.dll are located.

    The problem is remaining: many "unsolved external symbol ..."!

  6. #6
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    > mosek3_0.lib and mosek3_0.dll
    Do you know which Compiler (and it's version) was used to create these libraries?

  7. #7
    Registered User
    Join Date
    Aug 2005
    Posts
    1,267
    If mosek3_0.lib was compiled with c++ compiler, and without the extern "C" stuff, then your C code will not be able to link with anything in that library because the function names are mangled by c++ compilers. Change the filename of your *.c file to *.cpp, recompile and see if it will link.

  8. #8
    Registered User
    Join Date
    Sep 2005
    Posts
    30
    Thank you so much for the helps.

    I changed the file name from 'lo1.c' to 'lo1.cpp' and re-run it, the result is completely the same: passed the compiling and 13-"unresolved external symbol..." for the linking. The first two ERRORs in linking are:

    lo1.obj : error LNK2001: unresolved external symbol _MSK_deleteenv
    lo1.obj : error LNK2001: unresolved external symbol _MSK_deletetask

    My OS is winXP, the version of c/c++ is VC++6.0
    Last edited by Yumin; 01-26-2006 at 02:35 PM.

  9. #9
    Registered User
    Join Date
    Aug 2005
    Posts
    1,267
    >>cl -DMSKDLL abc.c -I mosek.h mosek3_0.lib


    The above is incorrect -- the parameter immediately following -I flag is supposed to be the path to the location of include files, not the name of any specific *.h file.
    try this:

    cl -DMSKDLL abc.c mosek3_0.lib

  10. #10
    Registered User
    Join Date
    Sep 2005
    Posts
    30
    Hello Ancient Dragon:

    The original command is quite long, I simplified it. Now yours is even more simple!

    Right now the question is how to run this c-codes in VC6.0 it's own windows, to get rid of DOS interface.

  11. #11
    60% Braindead
    Join Date
    Dec 2005
    Posts
    379
    http://winprog.org/tutorial/

    You need to learn how to make a window before you can make a window .
    Code:
    Error W8057 C:\\Life.cpp: Invalid number of arguments in function run(Brain *)

  12. #12
    Registered User
    Join Date
    Aug 2005
    Posts
    1,267
    you should really ditch that old, ancient VC++ 6.0 compiler. You can get Visual C++ .NET 2005 Express Edition free, and it has a nice IDE, you don't have to do command-line builds anymore. Or if you are a student you can get the Pro for under $100.00 USD.

  13. #13
    Registered User
    Join Date
    Nov 2001
    Posts
    255
    or like me when i signed up for classes i got it with the class. well 2003 anyway.
    hooch

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. 6 measly errors
    By beene in forum Game Programming
    Replies: 11
    Last Post: 11-14-2006, 11:06 AM
  2. Window scrollbar
    By maxorator in forum Windows Programming
    Replies: 2
    Last Post: 10-07-2005, 12:31 PM
  3. Linking OpenGL in Dev-C++
    By linkofazeroth in forum Game Programming
    Replies: 4
    Last Post: 09-13-2005, 10:17 AM
  4. Problem with creating new window, from another window
    By Garfield in forum Windows Programming
    Replies: 6
    Last Post: 01-11-2004, 02:10 PM
  5. how to make 2 text window
    By bluexrogue in forum C Programming
    Replies: 2
    Last Post: 09-15-2001, 08:51 PM