Results 1 to 4 of 4

Thread: รบกวนด้วยครับ

  1. #1
    Junior Member
    Join Date
    Mar 2009
    Posts
    4


    คือพึ่งหัดเขียนครับ

    พอดีมานเกิด error ขึ้นครับ

    --------------------Configuration: math - Win32 Debug--------------------
    Linking...
    math2.obj : error LNK2005: _main already defined in math1.obj
    Debug/math.exe : fatal error LNK1169: one or more multiply defined symbols found
    Error executing link.exe.

    math.exe - 2 error(s), 0 warning(s)

    อยากทราบว่าจะแก้ยังไง

  2. #2
    Administrator asylu3's Avatar
    Join Date
    Jun 2000
    Location
    Thailand
    Posts
    3,557


    post source code ด้วยได้ไหมครับ

  3. #3


    ข้อมูลมากว้างๆ ก็ตอบให้แบบกว้างๆ ละกัน (จริงๆ ไม่อยากตอบเลย ให้ข้อมูลมาแบบนี้ ปรับปรุงด้วยนะครับ)

    This error is followed by fatal error LNK1169.

    To fix by checking the following possible causes

    1.

    Mixing static and dynamic libraries when also using /clr.
    2.

    The symbol is a packaged function (created by compiling with /Gy) and was included in more than one file but was changed between compilations. Recompile all files that include symbol.
    3.

    The symbol is defined differently in two member objects in different libraries, and both member objects were used.
    4.

    An absolute is defined twice, with a different value in each definition.
    5.

    A header file declared and defined a variable. Possible solutions include:
    *

    Declare the variable in .h: extern BOOL MyBool; and then assign to it in a .c or .cpp file: BOOL MyBool = FALSE;.
    *

    Declare the variable static.
    *

    Declare the variable selectany.
    6.

    If you use uuid.lib in combination with other .lib files that define GUIDs (for example, oledb.lib and adsiid.lib). For example:

    oledb.lib(oledb_i.obj) : error LNK2005: _IID_ITransactionObject
    already defined in uuid.lib(go7.obj)

    To fix, add /FORCE:MULTIPLE to the linker command line options, and make sure that uuid.lib is the first library referenced.

    Reference by MSDN : http://msdn.microsoft.com/en-us/libr...6f(VS.80).aspx

  4. #4
    Senior Member
    Join Date
    Jul 2004
    Location
    Bangkok
    Posts
    187


    ดูจาก Error message ก็พอเดาได้ว่า

    สร้าง project ที่มี demo หลายตัว จริงๆแล้วแต่ละไฟล์ สามารถ compile แล้ว Run ได้เลย
    ลองแยกออกเป็น แต่ละ project ไปนะ

    สาเหตุคือ
    - function main มีมากกว่า 1 อัน (ทั้ง project มีได้แค่ อันเดียว)

    ถ้าไม่หาย ลอง Rebuild

Similar Threads

  1. Replies: 1
    Last Post: 31-08-2007, 11:58 AM
  2. รบกวนด้วยครับ
    By tarn6388 in forum C/C++,C#,VC++,MFC,Win32
    Replies: 0
    Last Post: 01-01-1970, 07:00 AM

Members who have read this thread : 0

Actions : (View-Readers)

There are no names to display.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •